add / check status code for yt-dlp

This commit is contained in:
Barbara Miller 2024-04-18 16:19:13 -07:00
parent 423f05b841
commit 12e49bf29e
2 changed files with 5 additions and 0 deletions

View File

@ -253,6 +253,8 @@ class BrozzlerWorker:
browser, site, page, on_screenshot, on_request
)
outlinks.update(browser_outlinks)
page.status_code = browser.websock_thread.page_status
self.logger.info("url %s status code %s", page.url, page.status_code)
except brozzler.PageInterstitialShown:
self.logger.info("page interstitial shown (http auth): %s", page)

View File

@ -33,6 +33,9 @@ thread_local = threading.local()
def should_ytdlp(page):
if page.status_code != 200:
return False
ytdlp_url = page.redirect_url if page.redirect_url else page.url
if "chrome-error:" in ytdlp_url: