Esempio n. 1
0
# Update details about your video
import apivideo
from apivideo.apis import VideosApi
from apivideo.exceptions import ApiAuthException

api_key = "your api key here"
video_id = "video ID for the video you want to update"

client = apivideo.AuthenticatedApiClient(api_key)

# If you'd rather use the sandbox environment:
# client = apivideo.AuthenticatedApiClient(api_key, production=False)

client.connect()

videos_api = VideosApi(client)

# Set up payload with details you want to change. For a complete list of what's available
# see https://docs.api.video

video_update_payload = {
    'title': 'Sample AVI Video',
    'description': 'This video is for demo purposes.'
}

# Send data you want to update your video with
response = videos_api.update(video_id, video_update_payload)
print(response)
Esempio n. 2
0
# Check the status of a video by video ID

import apivideo
from apivideo.apis import VideosApi
from apivideo.exceptions import ApiAuthException

api_key = "your api key here"
video_id = "video ID to get the status of here"

client = apivideo.AuthenticatedApiClient(api_key)

# If you'd rather use the sandbox environment:
# client = apivideo.AuthenticatedApiClient(api_key, production=False)

client.connect()

videos_api = VideosApi(client)

# Get the status of your video
response = videos_api.get_status(video_id)
print(response)
Esempio n. 3
0
import apivideo
from apivideo.apis import VideosApi
from apivideo.exceptions import ApiAuthException

api_key = "your api key here"

client = apivideo.AuthenticatedApiClient(api_key)

# If you rather like to use the sandbox environment:
# client = apivideo.AuthenticatedApiClient(api_key, production=False)

client.connect()

videos_api = VideosApi(client)

# Retrieve a list of all videos.
response = videos_api.list()
print(response)
Esempio n. 4
0
# Delete a video using its video ID
import apivideo
from apivideo.apis import VideosApi
from apivideo.exceptions import ApiAuthException

api_key = "your api key here"
video_id = "video ID of the video to delete"

client = apivideo.AuthenticatedApiClient(api_key)

# If you'd rather use the sandbox environment:
# client = apivideo.AuthenticatedApiClient(api_key, production=False)

client.connect()

videos_api = VideosApi(client)

# Delete the video
response = videos_api.delete(video_id)
print(response)
Esempio n. 5
0
# Upload an image as a thumbnail for your video
import apivideo
from apivideo.apis import VideosApi
from apivideo.exceptions import ApiAuthException

# Set variables, you need the video ID for the video you want to add a thumbnail to.
api_key = "your api key here"
video_id = "your video ID here"

# Open the file you want to use as the thumbnail in binary format. Your image must
# have an extension that is one of these: jpeg, jpg, JPG, JPEG
file = open("your jpg", "rb")

# Authenticate and set up your client
client = apivideo.AuthenticatedApiClient(api_key)

client.connect()

videos_api = VideosApi(client)

# Send the thumbnail and video ID to API video. The thumbnail is added to the video associated with the ID
# you provide. You can check on your dashboard to make sure the thumbnail was added.

response = videos_api.upload_thumbnail(video_id, file)
print(response)
Esempio n. 6
0
import apivideo
from apivideo.apis import VideosApi
from apivideo.exceptions import ApiAuthException

api_key = "your api key here"

# Set up the authenticated client
client = apivideo.AuthenticatedApiClient(api_key)

# if you rather like to use the sandbox environment:
# client = apivideo.AuthenticatedApiClient(api_key, production=False)
client.connect()

videos_api = VideosApi(client)

# Create the payload with video details
video_create_payload = {
    "title": "Client Video Test",
    "description": "Client test",
    "public": True,
    "tags": ["bunny"]
}

# Create the container for your video and print the response
response = videos_api.create(video_create_payload)
print("Video Container", response)

# Retrieve the video ID, you can upload once to a video ID
video_id = response["video_id"]

# Prepare the file you want to upload. Place the file in the same folder as your code.
Esempio n. 7
0
# Get details about a single video using its video ID
import apivideo
from apivideo.apis import VideosApi
from apivideo.exceptions import ApiAuthException

api_key = "your api key here"
video_id = "video ID for video you want info about here"

client = apivideo.AuthenticatedApiClient(api_key)

# If you'd rather use the sandbox environment:
# client = apivideo.AuthenticatedApiClient(api_key, production=False)

client.connect()

videos_api = VideosApi(client)

# Get details about a single video by video ID
response = videos_api.get(video_id)
print(response)
Esempio n. 8
0
# Pick a thumbnail from your video's timeline to use instead of uploading an image
import apivideo
from apivideo.apis import VideosApi
from apivideo.exceptions import ApiAuthException

# Set variables, you need the video ID for the video you want to add a thumbnail to.
api_key = "your api key here"
video_id = "video ID for video to pick thumbnail for here"

client = apivideo.AuthenticatedApiClient(api_key)

# If you'd rather use the sandbox environment:
# client = apivideo.AuthenticatedApiClient(api_key, production=False)

client.connect()

videos_api = VideosApi(client)

# Choose a time from your video to use as the thumbnail.
video_thumbnail_pick_payload = {"timecode": "00:00:10:000"}

response = videos_api.pick_thumbnail(video_id, video_thumbnail_pick_payload)
print(response)