pass self...

This commit is contained in:
Barbara Miller 2024-04-05 11:25:49 -07:00
parent 2e79e31ae9
commit b6014c03e0
2 changed files with 4 additions and 3 deletions

View File

@ -244,7 +244,7 @@ class BrozzlerWorker:
self.logger.info("brozzling {}".format(page))
ydl_fetches = None
outlinks = set()
if enable_youtube_dl and ydl.should_ytdlp(page, site):
if enable_youtube_dl and ydl.should_ytdlp(self, page, site):
try:
ydl_fetches, outlinks = ydl.do_youtube_dl(self, site, page)
except brozzler.ReachedLimit as e:

View File

@ -50,9 +50,10 @@ def _timestamp4datetime(timestamp):
int(timestamp[-2:])
)
def should_ytdlp(page, site):
def should_ytdlp(worker, page, site):
ytdlp_url = page.redirect_url if page.redirect_url else page.url
ytdlp_seed = site.get("warcprox-meta", {}).get("metadata", {}).get("ait_seed_id", "")
ytdlp_seed = site.seed_id if site.seed_id else None
# ytdlp_seed = site.get(site.id).pluck("metadata", "ait_seed_id").default(None) if site.rr else None ???
logging.info("ytdlp_seed: %s", ytdlp_seed)
if ytdlp_seed and "youtube.com/watch?v" in ytdlp_url: