Creates an exclusion list to only download the NGS version for PSO2 Global.
You can't use this on a mainline version of Legendary just yet, pull request is still pending
Creates an exclusion list to only download the NGS version for PSO2 Global.
You can't use this on a mainline version of Legendary just yet, pull request is still pending
import configparser | |
import requests | |
headers = { 'User-Agent': 'AQUA_HTTP' } | |
# Retrieve PSO2 JP management config | |
# GL doesn't have a patchlist that we can download unfortunately, but this is good enough | |
print('Retrieving management config') | |
management_req = requests.get('http://patch01.pso2gs.net/patch_prod/patches/management_beta.txt', | |
headers=headers) | |
management_config = configparser.ConfigParser() | |
management_config.read_string('[default]\n' + management_req.text) | |
patch_url = management_config['default']['PatchURL'] | |
# Retrieve PSO2 classic patchlist | |
print('Retrieving classic patchlist') | |
patchlist_req = requests.get(patch_url + 'patchlist_classic.txt', headers=headers) | |
patchlist_raw = patchlist_req.text.splitlines() | |
print('Creating exclusion list') | |
patchlist = [] | |
for line in patchlist_raw: | |
idx = line.index('\t') | |
line = line[:idx] | |
if line.endswith('.pat'): | |
line = line[:-4] | |
patchlist.append('pso2_bin/' + line) | |
# JP patchlist doesn't contain the GL-specific files, and we have no way | |
# of knowing this easily, so we'll just duplicate this for every file. | |
if line.startswith('data/win32/'): | |
patchlist.append('pso2_bin/data/win32_na/' + line[11:]) | |
elif line.startswith('data/win32reboot/'): | |
patchlist.append('pso2_bin/data/win32reboot_na/' + line[17:]) | |
exclude_file = open('exclude_patchlist.txt', 'w') | |
exclude_file.write('\n'.join(patchlist)) | |
exclude_file.close() |