From a6469621b7ec012c0bc5d00ce188012f2ca46530 Mon Sep 17 00:00:00 2001 From: Tjiho Date: Sat, 4 Jan 2020 17:05:36 +0100 Subject: [PATCH] write upload error in a file --- youtube2peertube.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/youtube2peertube.py b/youtube2peertube.py index 83addfa..f93ed34 100644 --- a/youtube2peertube.py +++ b/youtube2peertube.py @@ -239,6 +239,11 @@ def pt_http_import(dl_dir, channel_conf, queue_item, access_token, thumb_extensi return handle_peertube_result(requests.post(pt_api + "/videos/imports", data=multipart_data, headers=headers)) +def log_upload_error(yt_url): + error_file = open("video_errors.txt", "a") + error_file.write(yt_url+"\n") + error_file.close() + print("error !") def run_steps(conf): # TODO: logging @@ -296,7 +301,7 @@ def run_steps(conf): if pt_result: print("done !") else: - print("Error !") + log_upload_error(queue_item["link"]) if delete_videos: print("deleting videos and/or thumbnails...") rmtree(dl_dir + "/" + channel_conf["name"], ignore_errors=True)