Coder Social home page Coder Social logo

scraper's Introduction

scraper

Build Status GoDoc

An auto-scraper for EmulationStation written in Go using hashes. This currently works with NES, SNES, N64, GB, GBC, GBA, MD, SMS, 32X, GG, PCE, A2600, LNX, MAME/FBA(see below), Dreamcast(bin/gdi), PSX(bin/cue), ScummVM, SegaCD ROMs.

How it Works

The script works by crawling a directory of ROM files looking for known extensions. When it finds a file it hashes the ROM data minus any headers or special file formatting with the goal of hashing only the data pulled from the original game. It compares this hash to a DB I've compiled to look up the correct game in theGamesDB.net. It downloads the metadata and builds the gamelist.xml file.

If you have RetroPie-Setup 3.1 or later you can follow the instructions on their wiki instead.

Donate

I don't accept donations but feel free to donate to:
retropie
theGamesDB

Installation

Make sure you have go version 1.3.3 or later installed.

$ go version
go version go1.3.3 linux/amd64

Fetch and build.

$ go get github.com/sselph/scraper
$ go build github.com/sselph/scraper

If you have issues that mention snappy try adding -tags noasm to the build command.

Usage

$ cd <rom directory>
$ scraper

ROMs will be scanned and a gamelist.xml file will be created. All images will be placed inside the images folder.

MAME/FBA

The scraper now supports MAME/FBA but using file names instead of hashing. Since it uses a different DB and lookup method, several of the command line flags no longer apply. When the -mame flag is used it disables all other databases and the mamedb only has the one size of image so the flags about thumbnails, gdb, ovgdb, etc don't do anything.

$ scraper -mame

You can choose your preference of image type with the mame_img flag. If you prefer marquees but want to fallback to titles then snapshots you can do:

$ scraper -mame -mame_img "m,t,s"

Command Line Flags

There are several command flags you can pass. To see a full list use -help

$ scraper -help

Raspberry Pi

Note: Scraper is included in RetroPie-Setup from version 3.1 and can be accessed from their UI. Otherwise you can use the instructions below.

At the time of writing this raspbian has an old version of go 1.0.2 so you can cross-compile on another system or download an unofficial go binary from http://dave.cheney.net/unofficial-arm-tarballs.

Build:

Rpi v1

$ GOARM=6 GOARCH=arm GOOS=linux go build github.com/sselph/scraper

Rpi v2

$ GOARM=7 GOARCH=arm GOOS=linux go build github.com/sselph/scraper

Install from my Binaries

Replace the release_name with the release like v0.6.3-beta

Rpi v1

$ wget https://github.com/sselph/scraper/releases/download/<release_name>/scraper_rpi.zip
$ sudo unzip scraper_rpi.zip scraper -d /usr/local/bin/

Rpi v2

$ wget https://github.com/sselph/scraper/releases/download/<release_name>/scraper_rpi2.zip
$ sudo unzip scraper_rpi2.zip scraper -d /usr/local/bin/

Usage

Add thumb_only can speed things up since the pi doesn't have a ton of memory.

Single System

$ cd ~/RetroPie/roms/<rom_dir>
$ scraper -thumb_only

All Systems

$ scraper -scrape_all -thumb_only

Used libraries

Package Description License
github.com/nfnt/resize resizes images ISC
github.com/kr/fs provides filesystem-related functions New BSD
github.com/mattn/go-sqlite3 provides sqlite MIT
github.com/mitchellh/go-homedir get user homedir MIT
github.com/syndtr/goleveldb provides leveldb Simplified BSD
github.com/hashicorp/golang-lru provides a LRU cache Mozilla

scraper's People

Contributors

sselph avatar javiersigler avatar seriema avatar

Watchers

James Cloos avatar Kris Morrison avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.