Mainly make the python code to make it javascript for nuxt to access.

Python is just used for testing stuff, as it is a fine lang to do so.
This commit is contained in:
yuanhau 2025-05-18 09:28:08 +08:00
parent 81012f5061
commit 5f78e8c58a
9 changed files with 71 additions and 2 deletions

View file

@ -42,9 +42,11 @@ try:
req = Request(url, headers=headers)
response = urlopen(req)
if response.info().get('Content-Encoding') == 'gzip':
print("GZIP")
gzip_file = gzip.GzipFile(fileobj=io.BytesIO(response.read()))
html = gzip_file.read().decode('utf-8')
else:
print("Not GZIP")
html = response.read().decode('utf-8')