删除游戏信息和图像

mamescraper的Python项目详细描述


Downloads

mamescraper

从以下位置删除游戏信息和图像:

并生成一个XML文件,用于EmulationStation,它是RetroPie和RecalBox的默认前端。

刮刀工作的简单示例:

$ mamescraper

Initializing the scraper...

Scraping from: bigode - http://mame.bigode.net/

Mame database xml not found
 Downloading: 100%
Done!

Generating list of images to download...
Done!

Downloading 10 images:
 aliensyn.png downloaded
 guwange.png downloaded
 bjourney.png downloaded
 ecofghtr.png downloaded
 captcomm.png downloaded
 spf2t.png downloaded
 nbahangt.png downloaded
 ldrun.png downloaded
 raiden2.png downloaded
 tmnt2.png downloaded
Done!

Generating new gamelist xml...
 New gamelist.xml file created!

Total time spent: 0m 1s

All set! Happy gaming :)

关于

这个刮刀的目的是简单快速。目前它支持 两个来源的刮削方法截然不同。

默认的源代码(bigode)要快得多,因为scraper将下载 一个完整的MAME数据库(压缩了110万字节)并丢弃所有的游戏信息 一次完成。除此之外,这个源使用一个cdn和一个非常快速的web服务器来 提供图像服务,提高响应速度和下载速度。

adb的来源是一种更传统的方法,对于找到的每一个游戏,scraper 将执行http请求以获取所需信息,然后将下载 合适的形象。

需要注意的是,“bigode”源上的图像传单较小 因为它们有固定的400宽。

为了说明刮削速度的差异,下面显示了时间 在两个源上刮取整个MAME 037B5集(2241个ROM)所花费的时间:

“bigode”源:

Command: mamescraper -w 10 -i title
Time spent: 1m 10s

“ADB”来源:

Command: mamescraper -w 10 -i title -s adb
Time spent: 8m 29s

注意,Mamescraper只有10名工人,而且只刮头衔。如果运行 在“混合”图像模式(默认)中,差异甚至更大,因为图像 亚行的传单更大:

“bigode”源:

Command: mamescraper -w 10
Time spent: 2m 2s

“ADB”来源:

Command: mamescraper -w 10 -s adb
Time spent: 26m 47s

基于此,建议使用默认的“bicode”源运行 如果找不到游戏,只需在“附加”模式下再次运行scraper (仅扫描丢失的游戏)使用“adb”作为源。

非常感谢安托皮萨创造了Progetto Snaps 图片和大量的资源。

另外,非常感谢Arcade Database的Motoschifo创建者 为棒极了的街机数据库网站。

注释

  • 适用于Python2.7和Python3.3+
  • 仅使用Python标准库以获得最大兼容性

安装

使用pip安装:

pip install mamescraper

下载并设置脚本文件的可执行权限:

chmod +x mamescraper.py

使用python解释器下载并运行:

python mamescraper.py

releases页下载windows可执行文件。

用法

Usage: mamescraper [options]

scrap mame games information and images from 'mame.bigode.net' or
'adb.arcadeitalia.net'

Options:
--version           show program's version number and exit
-h, --help          show this help message and exit
-a, --append        scrap only missing roms from output file and append it
                    to the file (default: disabled)
-d ROMS_DIR         directory containing the games (default: current
                    directory)
-e IMAGES_DIR_NAME  directory name to download the images (default: images)
-f FORMAT           file format of the games: 'zip' or '7z' (default: zip)
-i IMAGES           images type: 'mixed', 'title' or 'flyer' - mixed will
                    download a flyer and fallback to title if a flyer is not
                    found (default: mixed)
-o OUTPUT_FILE      the xml file that will be created (default:
                    gamelist.xml)
-s SOURCE           information and images source: 'bigode' or 'adb'
                    (default: bigode)
-w WORKERS          number of workers threads to use (default: 5)

示例

最简单的用例是在mame games目录本身上运行:

$ cd my_games_dir
$ mamescraper

或者,您可以将目录传递给scraper:

$ mamescraper -d path_to_games_dir

仅在现有的“GAMELIST.XML”文件中删除游戏:

$ mamescraper -a

如果找不到游戏,这对两个来源的碎片都很有用。你就跑吧 第二次使用附加启用和另一个源刮管器:

$ mamescraper
$ mamescraper -a -s adb

如果您有混合格式的游戏,以下将在第一次运行 以“zip”格式抓取游戏(默认)并第二次附加 缺少“7Z”格式的游戏:

$ mamescraper
$ mamescraper -a -f 7z

与10名工人一起运行,只下载标题图像:

$ mamescraper -i title -w 10

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
如何在Java中创建固定大小的泛型数组?   javascript Paypal Braintree订阅付款   使用BufferedReader和PrintWriter实现java数据持久化?   类似于iCloud的java唯一google id   java使用网格布局和抓取组合框   java我的while循环无限运行,当我检查它时,它说while循环没有主体,而我认为它显然没有主体   java LWJGL碰撞3D OpenGL   java将Tibco RV切换到WebSphere MQ?   java如何使用Postman从curl发布REST   java是超级的,在通用通配符中是独占的吗?   在swing 1.5中,java在指定时间后自动关闭非模态对话框   java PrimeFaces饼图在JSF 2.0中不显示   java如何在Spring MVC中提供带有xml配置的默认bean实现?   java在eclipse中使用按钮关闭JFrame   java Sqoop jar已弃用   Java中的Getter方法