Skip to content

Instantly share code, notes, and snippets.

@intrnl
Last active July 31, 2022 10:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save intrnl/266ab0aabed4acd3b3c26d99b21d5e20 to your computer and use it in GitHub Desktop.
Save intrnl/266ab0aabed4acd3b3c26d99b21d5e20 to your computer and use it in GitHub Desktop.
Create exclusion list for PSO2 NGS Global

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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment