Skip to content

Commit

Permalink
black'd
Browse files Browse the repository at this point in the history
  • Loading branch information
Barbara Miller committed Apr 18, 2024
1 parent 700c80b commit 423f05b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
13 changes: 9 additions & 4 deletions brozzler/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ def _get_page_headers(self, page):
content_type_header = "CONTENT-LENGTH"
if content_type_header:
page.content_type = r.headers[content_type_header]
self.logger.info("url %s content_type is %s", page.url, page.content_type)
self.logger.info(
"url %s content_type is %s", page.url, page.content_type
)

if "Content-Length" in r.headers:
content_length_header = "Content-Length"
Expand All @@ -309,7 +311,9 @@ def _get_page_headers(self, page):
content_length_header = "CONTENT-LENGTH"
if content_length_header:
page.content_length = int(r.headers[content_length_header])
self.logger.info("url %s content_length is %s", page.url, page.content_length)
self.logger.info(
"url %s content_length is %s", page.url, page.content_length
)

if "Last-Modified" in r.headers:
last_modified_header = "Last-Modified"
Expand All @@ -319,14 +323,15 @@ def _get_page_headers(self, page):
last_modified_header = "LAST-MODIFIED"
if last_modified_header:
page.last_modified = r.headers[last_modified_header]
self.logger.info("url %s last_modified is %s", page.url, page.last_modified)
self.logger.info(
"url %s last_modified is %s", page.url, page.last_modified
)

def _needs_browsing(self, page):
if page.content_type and "html" not in page.content_type:
return False
return True


def _browse_page(self, browser, site, page, on_screenshot=None, on_request=None):
def _on_screenshot(screenshot_jpeg):
if on_screenshot:
Expand Down
1 change: 1 addition & 0 deletions brozzler/ydl.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

thread_local = threading.local()


def should_ytdlp(page):
ytdlp_url = page.redirect_url if page.redirect_url else page.url

Expand Down

0 comments on commit 423f05b

Please sign in to comment.