我正在使用Dailymotion python sdk将视频上传到Dailymotion。我无法将类别设置为“教育”
无法将类别设置为“教育”,如果将其设置为“新闻”,则效果良好
upload_folder = r"D:\My Folder\Dailymotion\Download_DM\automated_upload"
for file in os.listdir(upload_folder):
try:
d.set_grant_type(
"password",
api_key=_API_KEY,
api_secret=_API_SECRET,
scope=["manage_videos"],
info={"username": _USERNAME, "password": _PASSWORD},
)
# Uploading the file on dailymotion servers
file_path = upload_folder +'\\' + os.path.splitext(file)[0] + ".mp4"
url = d.upload(file_path)
# Filling the information about the video
parameters = {
"url": url,
"title": os.path.splitext(file)[0],
"tags": "life,love,reality,god,spirituality,education,truth,saints,scriptures",
#"description": "my first automatic uplaod",
"published": 1,
"channel": "education"
}
# Sending the information to create the video on dailymotion
result = d.post("/me/videos?fields=id,url", parameters)
print("Uploaded video: ", os.path.splitext(file)[0], "\nDailymotion url: ", result['url'], "\n\n")
except Exception as e:
print("An error occured: %s" % str(e))
错误消息:DailyMotionAPIRROR:未找到:找不到“通道”参数的对象通道
教育是频道的标签,你必须通过它的id,即“学校”
您可以检索此端点处的所有通道ID:https://api.dailymotion.com/channels?fields=id,name
相关问题 更多 >
编程相关推荐