From a68e0800e5443c6223dcf51446a0ac1394865555 Mon Sep 17 00:00:00 2001 From: Jakob Date: Sat, 6 Mar 2021 03:58:36 +0100 Subject: [PATCH] fix Response 400 error on use_pt_http_import=true (#20) --- youtube2peertube.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/youtube2peertube.py b/youtube2peertube.py index 04960e8..0845b9a 100644 --- a/youtube2peertube.py +++ b/youtube2peertube.py @@ -164,6 +164,7 @@ def upload_to_pt(dl_dir, channel_conf, queue_item, access_token, thumb_extension thumb_file = dl_dir + channel_conf["name"] + "/" + queue_item["yt_videoid"] + "." + thumb_extension description = channel_conf["description_prefix"] + "\n\n" + queue_item["summary"] + "\n\n" + channel_conf["description_suffix"] channel_id = str(get_pt_channel_id(channel_conf)) + category = utils.set_pt_category(channel_conf["pt_channel_category"]) # We need to transform fields into tuple to deal with tags as # MultipartEncoder does not support list refer # https://github.com/requests/toolbelt/issues/190 and @@ -176,7 +177,7 @@ def upload_to_pt(dl_dir, channel_conf, queue_item, access_token, thumb_extension ("nsfw", channel_conf["nsfw"]), ("channelId", channel_id), ("originallyPublishedAt", queue_item["published"]), - ("category", channel_conf["pt_channel_category"]), + ("category", category), ("language", channel_conf["default_lang"]), ("privacy", str(channel_conf["pt_privacy"])), ("commentsEnabled", channel_conf["comments_enabled"]),