无法在上载中将类别设置为“教育”

2024-09-29 01:24:08 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用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:未找到:找不到“通道”参数的对象通道


Tags: thepathapiurlosvideopasswordfolder