Last active
May 28, 2021 23:56
-
-
Save zach-morris/196ab188bbb04b3e076e4df8f98260c3 to your computer and use it in GitHub Desktop.
Creates dummy files for use with MAME software lists that can play games using them
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
# Creates dummy files for use with MAME software lists that can play games using them with python. Quick and dirty | |
# As described here: https://forums.libretro.com/t/guide-play-non-arcade-systems-with-mame-or-mess/17728/ | |
# Using pathlib and xmltodict https://pypi.org/project/xmltodict/ | |
from pathlib import Path | |
import xmltodict | |
import requests | |
folder = Path('.../neocdz/') #Path to where the dummy files should be generated | |
with requests.get('https://raw.githubusercontent.com/mamedev/mame/master/hash/neocd.xml') as url: #Update url as required | |
games = [x.get('@name') for x in xmltodict.parse(url.content).get('softwarelist').get('software') if x.get('@name')] | |
for gg in games: | |
folder.joinpath(gg+'.zip').write_text('') #Write dummy file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment