Last active
September 10, 2023 09:16
-
-
Save Cha14ka/b8f23570f415bed184206b7fd7ab9518 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import re | |
import subprocess | |
hsr_process = subprocess.run( | |
'ps aux | grep "StarRail.exe"', | |
shell=True, | |
stdout=subprocess.PIPE | |
).stdout.decode().split('\n')[0] | |
hsr_dir = re.findall('\D\:(\\\\.+)StarRail.exe\s', hsr_process)[0].replace('\\','/') | |
cache = open(f'{hsr_dir}/StarRail_Data/webCaches/Cache/Cache_Data/data_2', 'rb').read() | |
cache = str(cache) | |
spl = cache.split('getGachaLog') | |
url = 'https://{}getGachaLog{}end_id=0'.format( | |
spl[-2].split('https://')[-1], | |
spl[-1].split('end_id=0')[0] | |
) | |
print(url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Got this error when running the script.