From 6cc5fd88907f7f7c6540e24d25d77a4c7409135f Mon Sep 17 00:00:00 2001 From: simon Date: Sat, 30 Apr 2022 16:40:36 +0700 Subject: [PATCH] add cookiefile to yt_obs in YouTubeItem baseclass --- tubearchivist/home/src/index/generic.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tubearchivist/home/src/index/generic.py b/tubearchivist/home/src/index/generic.py index 709dde9..c4dcac5 100644 --- a/tubearchivist/home/src/index/generic.py +++ b/tubearchivist/home/src/index/generic.py @@ -6,6 +6,7 @@ functionality: import math import yt_dlp +from home.src.download.yt_cookie import CookieHandler from home.src.es.connect import ElasticWrap from home.src.ta.config import AppConfig from home.src.ta.ta_redis import RedisArchivist @@ -37,6 +38,9 @@ class YouTubeItem: """read user conf""" self.config = AppConfig().config self.app_conf = self.config["application"] + if self.config["downloads"]["cookie_import"]: + cookie_path = CookieHandler().use() + self.yt_obs.update({"cookiefile": cookie_path}) def get_from_youtube(self): """use yt-dlp to get meta data from youtube"""