From 5784c37013ad50a3f5284ef610b6e8bdcf4cad89 Mon Sep 17 00:00:00 2001 From: tech234a <46801700+tech234a@users.noreply.github.com> Date: Tue, 22 Sep 2020 12:50:22 -0400 Subject: [PATCH] Reduce double-scanning channels --- worker.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/worker.py b/worker.py index 522c112..8bb8458 100644 --- a/worker.py +++ b/worker.py @@ -114,11 +114,12 @@ def prrun(): sleep(30) ydl = YoutubeDL({"extract_flat": "in_playlist", "simulate": True, "skip_download": True, "quiet": True, "cookiefile": "cookies.txt", "source_address": "0.0.0.0", "call_home": False}) - for chaninfo in info[3]: + for chaninfo in set(info[3]): if chaninfo not in recchans: while True: try: y = ydl.extract_info("https://www.youtube.com/channel/"+chaninfo, download=False) + recchans.add(chaninfo) break except: sleep(30) @@ -126,11 +127,12 @@ def prrun(): for itemyv in y["entries"]: recvids.add(itemyv["id"]) - for playlinfo in info[5]: + for playlinfo in set(info[5]): if playlinfo not in recplayl: while True: try: y = ydl.extract_info("https://www.youtube.com/playlist?list="+playlinfo, download=False) + recplayl.add(playlinfo) break except: sleep(30)