|
|
@ -145,6 +145,16 @@ class PendingList(PendingIndex):
|
|
|
|
cookie_path = CookieHandler().use()
|
|
|
|
cookie_path = CookieHandler().use()
|
|
|
|
self.yt_obs.update({"cookiefile": cookie_path})
|
|
|
|
self.yt_obs.update({"cookiefile": cookie_path})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def close_config(self):
|
|
|
|
|
|
|
|
"""remove config after task finished"""
|
|
|
|
|
|
|
|
config = AppConfig().config
|
|
|
|
|
|
|
|
if config["downloads"]["cookie_import"]:
|
|
|
|
|
|
|
|
CookieHandler().hide()
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
del self.yt_obs["cookiefile"]
|
|
|
|
|
|
|
|
except KeyError:
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
def parse_url_list(self):
|
|
|
|
def parse_url_list(self):
|
|
|
|
"""extract youtube ids from list"""
|
|
|
|
"""extract youtube ids from list"""
|
|
|
|
self.missing_videos = []
|
|
|
|
self.missing_videos = []
|
|
|
@ -225,6 +235,8 @@ class PendingList(PendingIndex):
|
|
|
|
query_str = "\n".join(bulk_list)
|
|
|
|
query_str = "\n".join(bulk_list)
|
|
|
|
_, _ = ElasticWrap("_bulk").post(query_str, ndjson=True)
|
|
|
|
_, _ = ElasticWrap("_bulk").post(query_str, ndjson=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.close_config()
|
|
|
|
|
|
|
|
|
|
|
|
def _notify_add(self, idx):
|
|
|
|
def _notify_add(self, idx):
|
|
|
|
"""send notification for adding videos to download queue"""
|
|
|
|
"""send notification for adding videos to download queue"""
|
|
|
|
progress = f"{idx + 1}/{len(self.missing_videos)}"
|
|
|
|
progress = f"{idx + 1}/{len(self.missing_videos)}"
|
|
|
|