From 1a88c85436a399e16ea10162c8ca6cc091257e85 Mon Sep 17 00:00:00 2001 From: simon Date: Sun, 17 Oct 2021 10:49:02 +0700 Subject: [PATCH] skip video if is_live now --- tubearchivist/home/src/download.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tubearchivist/home/src/download.py b/tubearchivist/home/src/download.py index 8c114a53..9d3196bc 100644 --- a/tubearchivist/home/src/download.py +++ b/tubearchivist/home/src/download.py @@ -80,7 +80,6 @@ class PendingList: # skip already downloaded continue video = self.get_youtube_details(youtube_id) - thumb_url = video["vid_thumb_url"] # skip on download error if not video: continue @@ -89,6 +88,7 @@ class PendingList: video["channel_indexed"] = True else: video["channel_indexed"] = False + thumb_url = video["vid_thumb_url"] video["status"] = "pending" action = {"create": {"_id": youtube_id, "_index": "ta_download"}} bulk_list.append(json.dumps(action)) @@ -126,6 +126,9 @@ class PendingList: except youtube_dl.utils.DownloadError: print("failed to extract info for: " + youtube_id) return False + # stop if video is streaming live now + if vid["is_live"]: + return False # parse response seconds = vid["duration"] duration_str = DurationConverter.get_str(seconds)