mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-08-02 11:36:15 -04:00
add / check status code for yt-dlp
This commit is contained in:
parent
423f05b841
commit
12e49bf29e
2 changed files with 5 additions and 0 deletions
|
@ -253,6 +253,8 @@ class BrozzlerWorker:
|
||||||
browser, site, page, on_screenshot, on_request
|
browser, site, page, on_screenshot, on_request
|
||||||
)
|
)
|
||||||
outlinks.update(browser_outlinks)
|
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:
|
except brozzler.PageInterstitialShown:
|
||||||
self.logger.info("page interstitial shown (http auth): %s", page)
|
self.logger.info("page interstitial shown (http auth): %s", page)
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,9 @@ thread_local = threading.local()
|
||||||
|
|
||||||
|
|
||||||
def should_ytdlp(page):
|
def should_ytdlp(page):
|
||||||
|
if page.status_code != 200:
|
||||||
|
return False
|
||||||
|
|
||||||
ytdlp_url = page.redirect_url if page.redirect_url else page.url
|
ytdlp_url = page.redirect_url if page.redirect_url else page.url
|
||||||
|
|
||||||
if "chrome-error:" in ytdlp_url:
|
if "chrome-error:" in ytdlp_url:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue