From 7af4e6221bf0dc60bebc4a7df8e3287135d83df6 Mon Sep 17 00:00:00 2001 From: Tjiho Date: Sun, 5 Jan 2020 01:31:23 +0100 Subject: [PATCH] add channel name in error file --- youtube2peertube.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/youtube2peertube.py b/youtube2peertube.py index f93ed34..e478b46 100644 --- a/youtube2peertube.py +++ b/youtube2peertube.py @@ -239,9 +239,9 @@ 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") +def log_upload_error(yt_url,channel_conf): + error_file = open("video_errors.csv", "a") + error_file.write(channel_conf['name']+","+yt_url+"\n") error_file.close() print("error !") @@ -301,7 +301,7 @@ def run_steps(conf): if pt_result: print("done !") else: - log_upload_error(queue_item["link"]) + log_upload_error(queue_item["link"],channel_conf) if delete_videos: print("deleting videos and/or thumbnails...") rmtree(dl_dir + "/" + channel_conf["name"], ignore_errors=True)