Skip to content

Commit 4a17c86

Browse files
committed
scrape video media from TheGamesDB
1 parent f41e9c1 commit 4a17c86

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

docs/SCRAPINGMODULES.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ over a table cell to display the scraper module as tooltip:
2020
| [GameBase](#gamebase-db) (10/18) | ✓ {title='GameBase'} | ✓ {title='GameBase'} |   {title='GameBase'} | ✓ {title='GameBase'} | ✓ {title='GameBase'} | ✓ {title='GameBase'} | ✓ {title='GameBase'} | ✓ {title='GameBase'} | ✓ ³ {title='GameBase'} | ✓ {title='GameBase'} | ✓ {title='GameBase'} |   {title='GameBase'} |   {title='GameBase'} |   {title='GameBase'} |   {title='GameBase'} |   {title='GameBase'} |   {title='GameBase'} |   {title='GameBase'} |
2121
| [Internet Game DB (IGDB)](#igdb-internet-game-database) (12/18) | ✓ {title='Internet Game DB (IGDB)'} | ✓ {title='Internet Game DB (IGDB)'} | ✓ {title='Internet Game DB (IGDB)'} | ✓ {title='Internet Game DB (IGDB)'} | ✓ {title='Internet Game DB (IGDB)'} | ✓ {title='Internet Game DB (IGDB)'} | ✓ {title='Internet Game DB (IGDB)'} | ✓ {title='Internet Game DB (IGDB)'} | ✓ {title='Internet Game DB (IGDB)'} | ✓ {title='Internet Game DB (IGDB)'} | ✓ {title='Internet Game DB (IGDB)'} |   {title='Internet Game DB (IGDB)'} |   {title='Internet Game DB (IGDB)'} |   {title='Internet Game DB (IGDB)'} |   {title='Internet Game DB (IGDB)'} | ✓ {title='Internet Game DB (IGDB)'} |   {title='Internet Game DB (IGDB)'} |   {title='Internet Game DB (IGDB)'} |
2222
| [File Import](#custom-resource-import) (18/18) | ✓ {title='File Import'} | ✓ {title='File Import'} | ✓ {title='File Import'} | ✓ {title='File Import'} | ✓ {title='File Import'} | ✓ {title='File Import'} | ✓ {title='File Import'} | ✓ {title='File Import'} | ✓ {title='File Import'} | ✓ {title='File Import'} | ✓ {title='File Import'} | ✓ {title='File Import'} | ✓ {title='File Import'} | ✓ {title='File Import'} | ✓ {title='File Import'} | ✓ {title='File Import'} | ✓ {title='File Import'} | ✓ {title='File Import'} |
23-
| [MobyGames](#mobygames) (8/18) | ✓ {title='MobyGames'} | ✓ ⁴ {title='MobyGames'} | ✓ {title='MobyGames'} | See ⁴ {title='MobyGames'} | ✓ {title='MobyGames'} | ✓ {title='MobyGames'} | ✓ {title='MobyGames'} | See ⁴ {title='MobyGames'} | See ⁴ {title='MobyGames'} | ✓ {title='MobyGames'} | ✓ {title='MobyGames'} |   {title='MobyGames'} |   {title='MobyGames'} | See ⁴ {title='MobyGames'} |   {title='MobyGames'} |   {title='MobyGames'} |   {title='MobyGames'} |   {title='MobyGames'} |
23+
| [MobyGames](#mobygames) (11/18) | ✓ {title='MobyGames'} | ✓ ⁴ {title='MobyGames'} | ✓ {title='MobyGames'} | {title='MobyGames'} | ✓ {title='MobyGames'} | ✓ {title='MobyGames'} | ✓ {title='MobyGames'} | {title='MobyGames'} | {title='MobyGames'} | ✓ {title='MobyGames'} | ✓ {title='MobyGames'} |   {title='MobyGames'} |   {title='MobyGames'} | See ⁴ {title='MobyGames'} |   {title='MobyGames'} |   {title='MobyGames'} |   {title='MobyGames'} |   {title='MobyGames'} |
2424
| [OpenRetro](#openretro) (11/18) | ✓ {title='OpenRetro'} | ✓ {title='OpenRetro'} | ✓ {title='OpenRetro'} | ✓ {title='OpenRetro'} | ✓ {title='OpenRetro'} | ✓ {title='OpenRetro'} | ✓ {title='OpenRetro'} | ✓ {title='OpenRetro'} |   {title='OpenRetro'} | ✓ {title='OpenRetro'} | ✓ {title='OpenRetro'} |   {title='OpenRetro'} | ✓ {title='OpenRetro'} |   {title='OpenRetro'} |   {title='OpenRetro'} |   {title='OpenRetro'} |   {title='OpenRetro'} |   {title='OpenRetro'} |
2525
| [ScreenScraper](#screenscraper) (18/18) | ✓ {title='ScreenScraper'} | ✓ {title='ScreenScraper'} | ✓ {title='ScreenScraper'} | ✓ {title='ScreenScraper'} | ✓ {title='ScreenScraper'} | ✓ {title='ScreenScraper'} | ✓ {title='ScreenScraper'} | ✓ {title='ScreenScraper'} | ✓ {title='ScreenScraper'} | ✓ {title='ScreenScraper'} | ✓ {title='ScreenScraper'} | ✓ {title='ScreenScraper'} | ✓ {title='ScreenScraper'} | ✓ {title='ScreenScraper'} | ✓ {title='ScreenScraper'} | ✓ {title='ScreenScraper'} | ✓ {title='ScreenScraper'} | ✓ {title='ScreenScraper'} |
26-
| [The Games DB](#thegamesdb-tgdb) (14/18) | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} |   {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} |   {title='The Games DB'} |   {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} |   {title='The Games DB'} |
26+
| [The Games DB](#thegamesdb-tgdb) (15/18) | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} |   {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} | {title='The Games DB'} |   {title='The Games DB'} | ✓ {title='The Games DB'} | ✓ {title='The Games DB'} |   {title='The Games DB'} |
2727
| [ZXInfo](#zxinfo-formerly-world-of-spectrum) (10/18) | ✓ {title='ZXInfo'} | ✓ {title='ZXInfo'} |   {title='ZXInfo'} | ✓ {title='ZXInfo'} | ✓ {title='ZXInfo'} | ✓ {title='ZXInfo'} | ✓ {title='ZXInfo'} | ✓ {title='ZXInfo'} | ✓ ⁵ {title='ZXInfo'} | ✓ {title='ZXInfo'} | ✓ {title='ZXInfo'} |   {title='ZXInfo'} |   {title='ZXInfo'} |   {title='ZXInfo'} |   {title='ZXInfo'} |   {title='ZXInfo'} |   {title='ZXInfo'} |   {title='ZXInfo'} |
28-
| Scraper coverage per metadata | 10/10<br>Title | 10/10<br>Release Date | 8/10<br>Description | 9/10<br>Max. Players | 9/10<br>Developer | 10/10<br>Publisher | 10/10<br>Genre/Tags | 7/10<br>Rating | 6/10<br>Age Recommend. | 10/10<br>Cover | 10/10<br>Screenshot | 4/10<br>Wheel/Logo | 6/10<br>Marquee | 4/10<br>Video | 3/10<br>Manual | 5/10<br>Fan Art | 4/10<br>Back of Cover | 2/10<br>Texture |
28+
| Scraper coverage per metadata | 10/10<br>Title | 10/10<br>Release Date | 8/10<br>Description | 10/10<br>Max. Players | 9/10<br>Developer | 10/10<br>Publisher | 10/10<br>Genre/Tags | 8/10<br>Rating | 7/10<br>Age Recommend. | 10/10<br>Cover | 10/10<br>Screenshot | 4/10<br>Wheel/Logo | 6/10<br>Marquee | 5/10<br>Video | 3/10<br>Manual | 5/10<br>Fan Art | 4/10<br>Back of Cover | 2/10<br>Texture |
2929

3030
**Remarks**:
3131
¹ Skyscraper uses ArcadeDB's Flyer and as a failsafe the Title screen, as Arcade games usually were not sold in a box
@@ -99,7 +99,7 @@ I strongly recommend supporting them by contributing data to the database, or by
9999
- API request limit: _Limited to 1000 requests per IP per month_
100100
- Thread limit: _None_
101101
- Platform support: _[Link to list](https://thegamesdb.net/list_platforms.php) or see `tgdb_platforms.json` sibling to your `config.ini`_
102-
- Media support: `backcover`, `cover`, `fanart`, `marquee`, `screenshot`, `wheel`
102+
- Media support: `backcover`, `cover`, `fanart`, `marquee`, `screenshot`, `video`, `wheel`
103103
- Example use:
104104
```bash
105105
Skyscraper -p snes -s thegamesdb

src/thegamesdb.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ TheGamesDb::TheGamesDb(Settings *config, QSharedPointer<NetManager> manager)
5353
fetchOrder.append(GameEntry::Elem::MARQUEE);
5454
fetchOrder.append(GameEntry::Elem::FANART);
5555
fetchOrder.append(GameEntry::Elem::BACKCOVER);
56+
fetchOrder.append(GameEntry::Elem::VIDEO);
5657
}
5758

5859
void TheGamesDb::getSearchResults(QList<GameEntry> &gameEntries,
@@ -313,6 +314,16 @@ void TheGamesDb::getFanart(GameEntry &game) {
313314
}
314315
}
315316

317+
void TheGamesDb::getVideo(GameEntry &game) {
318+
QString req =
319+
QString("https://cdn.thegamesdb.net/videos/%1/%1-1.mp4").arg(game.id);
320+
game.videoData = downloadMedia(req, false);
321+
if (!game.videoData.isEmpty()) {
322+
game.videoFormat = req.right(3);
323+
qDebug() << "tgdb: got video from " << req;
324+
}
325+
}
326+
316327
bool TheGamesDb::loadMaps() {
317328
genreMap = readJson("tgdb_genres.json");
318329
if (genreMap.isEmpty()) {

src/thegamesdb.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class TheGamesDb : public AbstractScraper {
5555
void getMarquee(GameEntry &game) override;
5656
void getFanart(GameEntry &game) override;
5757
void getBackcover(GameEntry &game) override;
58+
void getVideo(GameEntry &game) override;
5859
QVector<int> getPlatformId(const QString platform) override;
5960
QString getKey();
6061

0 commit comments

Comments
 (0)