Update video metadata (with Python SDK)
Dailymotion’s Python SDK allows you to update your video metadata once you uploaded them on our platform. Follow this quick tutorial to learn how to programmatically modify this information in a few lines of code.
Steps to update your video metadata
1. Authentication
- First you need to import our Python SDK
import importlib
_DAILYMOTION = importlib.import_module("dailymotion-sdk-python.dailymotion")
- Then connect to Dailymotion by providing your API key and API secret
_DM = _DAILYMOTION.Dailymotion()
_DM.set_grant_type(
"password",
api_key=_API_KEY,
api_secret=_API_SECRET,
scope=["manage_videos"],
info={"username": _USERNAME, "password": _PASSWORD},
)
2. Update metadata
You can now update your video metadata using our Python SDK. Use the HTTP POST method to modify the metadata by requesting to the appropriate URL. For example, this is how to edit the title of a video by posting to /video/<VIDEO_ID>
:
result = _DM.post("/video/<xid>", {"title": "My new title"})