Last active
January 24, 2023 20:03
-
-
Save pxdl/ace6325154fac10c9211ac1cf3cfab85 to your computer and use it in GitHub Desktop.
Converts the NoPayStation TSV for PS3 Games to pkgi-ps3 format
This file contains 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
import csv | |
import urllib.request | |
url = "http://nopaystation.com/tsv/PS3_GAMES.tsv" | |
print('Downloading PS3_GAMES.tsv...') | |
urllib.request.urlretrieve(url, 'PS3_GAMES.tsv') | |
newlist = [] | |
with open('PS3_GAMES.tsv', newline='', encoding="utf8") as csvfile: | |
listreader = csv.reader(csvfile, delimiter=' ', quotechar='"') | |
csvfile.readline() # Skip first line | |
print("Rearranging list...") | |
for row in listreader: | |
newrow = [] | |
newrow.append(row[5]) # Content ID | |
newrow.append('0') # Flags (unused) | |
newrow.append(row[2]) # Name | |
newrow.append('') # Description (unused) | |
newrow.append('') # RAP file in HEX (16 bytes) | |
newrow.append(row[3]) # PKG Download Link | |
newrow.append(row[8]) # Filesize | |
newrow.append(row[9]) # Checksum | |
newlist.append(newrow) | |
with open('pkgi.txt', 'w', newline='', encoding="utf8") as csvfile: | |
listwriter = csv.writer(csvfile, delimiter=',', | |
quotechar='"', quoting=csv.QUOTE_MINIMAL) | |
print('Saving pkgi.txt...') | |
for newrow in newlist: | |
listwriter.writerow(newrow) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's the version of the script with @ChronosWasTaken's suggested edit: