Fix Client.fetch_image_url in some cases

Sometimes (or always?), jsmods require includes a JS version specifier.

This means we couldn't find the url
This commit is contained in:
Mads Marquart
2020-05-07 11:46:42 +02:00
parent db284cefdf
commit 18a3ffb90d
4 changed files with 28 additions and 9 deletions

View File

@@ -24,6 +24,8 @@ def parse_server_js_define(html: str) -> Mapping[str, Any]:
# Find points where we should start parsing
define_splits = SERVER_JS_DEFINE_REGEX.split(html)
# TODO: Extract jsmods "require" and "define" from `bigPipe.onPageletArrive`?
# Skip leading entry
_, *define_splits = define_splits