Up the page download limit for youtube compatibility
This commit is contained in:
parent
c2696592b1
commit
e4cf248afd
|
@ -149,7 +149,9 @@ def handle_message(*, prefix, message, nick, channel, irc):
|
||||||
if response.info().get_content_type() == 'text/html':
|
if response.info().get_content_type() == 'text/html':
|
||||||
# First 4KiB of a page should be enough for any <title>
|
# First 4KiB of a page should be enough for any <title>
|
||||||
# Turns out it's not, so download 64KiB
|
# Turns out it's not, so download 64KiB
|
||||||
page_source_fragment = response.read(64 * 1024)
|
# As of 2023-09-10, youtube requires up to 320KiB (!),
|
||||||
|
# so download first 512KiB
|
||||||
|
page_source_fragment = response.read(512 * 1024)
|
||||||
title = sanitize(extract_title(page_source_fragment))
|
title = sanitize(extract_title(page_source_fragment))
|
||||||
|
|
||||||
if title is not None:
|
if title is not None:
|
||||||
|
|
Loading…
Reference in New Issue