fix: http in naominet.jp

This commit is contained in:
91c0e59d-6161-45ab-8aa4-2371574db28f 2025-01-21 09:34:47 +08:00
parent 559e30a59e
commit 1881d38907

View File

@ -5,12 +5,12 @@ import re
def DownloadOrder(): def DownloadOrder():
ua = 'Windows/3.0' ua = 'Windows/3.0'
content = b'title_id=SDGA&title_ver=1.50&serial=A63E01E0048&encode=UTF-8' content = b'game_id=SDGA&ver=1.50&serial=A63E01E0048&encode=UTF-8'
body = base64.b64encode(zlib.compress(content)) body = base64.b64encode(zlib.compress(content))
http = urllib3.PoolManager() http = urllib3.PoolManager()
r = http.request( r = http.request(
'POST', 'POST',
'https://naominet.jp/sys/servlet/DownloadOrder', 'http://naominet.jp/sys/servlet/DownloadOrder',
body = body, body = body,
headers = { headers = {
'Pragma': 'DFI', 'Pragma': 'DFI',
@ -19,12 +19,13 @@ def DownloadOrder():
} }
) )
resp_data = r.data resp_data = r.data
response = zlib.decompress(base64.b64decode(resp_data)) response = zlib.decompress(base64.b64decode(resp_data)).decode()
return response return response
def uri(): def uri():
data = DownloadOrder() data = DownloadOrder()
endpoint = re.findall("https://[^&s]+", data)[0] pattern = r"https://[^\s]+"
endpoint = re.search(pattern, data).group()
http = urllib3.PoolManager() http = urllib3.PoolManager()
r = http.request( r = http.request(
'GET', 'GET',
@ -33,7 +34,8 @@ def uri():
'User-Agent': 'A63E01E0000', 'User-Agent': 'A63E01E0000',
} }
) )
response = r.data resp_data = r.data
response = resp_data.decode()
return response return response
if __name__ == "__main__": if __name__ == "__main__":