skip video if is_live now

This commit is contained in:
simon 2021-10-17 10:49:02 +07:00
parent 63be6afcfe
commit 1a88c85436
1 changed files with 4 additions and 1 deletions

View File

@ -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)