Using python requests and vimeo endpoints it becomes very easy and simple to upload our videos and customize them.
Vimeo Access token:
Create an account at vimeo, vimeo has different levels of account, so based on your requirement signup for suitable account.
This article assumes pro account.
After you log in, create an app and generate token based on your requirement like editing, uploading, view etc..
Get your desired video id and use the following iframe to display video.
Customizing your uploaded video:
Using python requests library you can customize your vimeo video.
Following code will edit description of the video, its name and setting the privacy rules like who can embed your video, who can view your video.
In the above code the patch request sets the video to be viewed by anybody.
The video embed setting as whitelist, which means that the video should be embeded only to the whitelisted domains. The whitelist domains can be added by using put request, shown below.
Custom image for the video:
Vimeo sets the image by default but we can customize it as follows.
What the above code does is, it gets the link to which our picture should be uploaded, as you can see rs.post does a post request using headers and gets the response, this response will have the link to which our picture should be uploaded.
Finall we send a patch request saying to activate the uploaded picture.
Vimeo preset helps to customize the vimeo player. First you have to create a preset by doing so a preset id will be created.
To list all the preset id's for a video send get request as below.
Select your desired preset id and send a put request.
python class special methods or magic methods. magic methods allow us to override or add the default functionality of python objects. One of the biggest ...
Python Collections - named tuple is to access by the names specified and deque is to append and pop the elements from both sides of ...
When something goes wrong with your code instead of using standard debugging techniques such as print statements use debugging tools. I found two great tools ...
MicroPyramid - India
HIG499, 6th phase KPHB, Hyderabad, India - 500072, +91 9959166266
Monday - Friday : 10:00 - 19:00
MicroPyramid - USA
280 Moon Clinton Rd,STE D Moon Twp, Pittsburgh, Pennsylvania 15108, +1 5102300949
MicroPyramid - UAE
Khalifa Building(Near Old Nesto Super Market),Opp Fire Station, Sharjah, UAE 341246, +971 566061239