diff --git a/sdga/authv1.py b/sdga/authv1.py index 87e6d9b..09057bd 100644 --- a/sdga/authv1.py +++ b/sdga/authv1.py @@ -5,12 +5,12 @@ import re def DownloadOrder(): 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)) http = urllib3.PoolManager() r = http.request( 'POST', - 'https://naominet.jp/sys/servlet/DownloadOrder', + 'http://naominet.jp/sys/servlet/DownloadOrder', body = body, headers = { 'Pragma': 'DFI', @@ -19,12 +19,13 @@ def DownloadOrder(): } ) resp_data = r.data - response = zlib.decompress(base64.b64decode(resp_data)) + response = zlib.decompress(base64.b64decode(resp_data)).decode() return response def uri(): data = DownloadOrder() - endpoint = re.findall("https://[^&s]+", data)[0] + pattern = r"https://[^\s]+" + endpoint = re.search(pattern, data).group() http = urllib3.PoolManager() r = http.request( 'GET', @@ -33,7 +34,8 @@ def uri(): 'User-Agent': 'A63E01E0000', } ) - response = r.data + resp_data = r.data + response = resp_data.decode() return response if __name__ == "__main__":