[Scummvm-git-logs] scummvm master -> 73b5db52d68b46ee3f20085db98bada0bc5a648d

bluegr bluegr at gmail.com
Sun May 30 17:49:52 UTC 2021


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
4219ae5591 DEVTOOLS: Add gameId getting script for GOG Galaxy
73b5db52d6 DEVTOOLS: Fix steam_gameid.py for current steamdb format


Commit: 4219ae5591a896b9b6513169c372c53a3c79c726
    https://github.com/scummvm/scummvm/commit/4219ae5591a896b9b6513169c372c53a3c79c726
Author: lb_ii (lolbot_iichan at mail.ru)
Date: 2021-05-30T20:49:49+03:00

Commit Message:
DEVTOOLS: Add gameId getting script for GOG Galaxy

Changed paths:
  A devtools/gog_gameid.py


diff --git a/devtools/gog_gameid.py b/devtools/gog_gameid.py
new file mode 100644
index 0000000000..677bb9c5ce
--- /dev/null
+++ b/devtools/gog_gameid.py
@@ -0,0 +1,56 @@
+#!/usr/bin/env python3
+
+# This script takes the game name as parameter and returns the GOG Galaxy game id
+# Return with exit code 127 if no game was found for the given title
+# Return with exit code 1 if there are multiple games for the given name
+# Return with exit code 0 if there is exactly one match found
+
+import requests
+import argparse
+import urllib.parse
+from requests_html import HTMLSession
+import sys
+
+parser = argparse.ArgumentParser()
+parser.add_argument('-n', '--name', required=True, help="The GOG Galaxy game name")
+parser.add_argument('-a', '--all', action='store_true', help="Show all matches, not just the exact match")
+parser.add_argument('-v', '--verbose', action='store_true', help="Also print some meta information next to the GOG Galaxy game id")
+args = parser.parse_args()
+
+searchurl = "https://gogdb.org/products?search={0}".format(urllib.parse.quote_plus(args.name, safe='!'))
+if args.verbose:
+	sys.stderr.write('query url: {0}\n'.format(searchurl))
+
+try:
+	session = HTMLSession()
+	response = session.get(searchurl)
+	game_rows = response.html.xpath("//table[@id='product-table']/tr/td")
+	game_columns = 5 # thumb, id, name, type, os
+	entries = int(len(game_rows) / game_columns)
+	if args.verbose:
+		sys.stderr.write('found {0} games\n'.format(entries))
+
+	matches = 0
+	for i in range(entries):
+		idx               = game_columns * i
+		game_thumb        = game_rows[idx + 0].text.strip()
+		game_id           = game_rows[idx + 1].text.strip()
+		game_name         = game_rows[idx + 2].text.strip()
+		game_type         = game_rows[idx + 3].text.strip()
+		game_os           = game_rows[idx + 4].text.strip().replace(" ","")
+		if not args.all and game_name != args.name:
+			if args.verbose:
+				sys.stderr.write('found {0} - no match for {1}\n'.format(game_name, args.name))
+			continue
+		if args.verbose:
+			print("{0} {1} {2}#{3}".format(game_id, game_type, game_os, game_name))
+		else:
+			print("{0}".format(game_id))
+		matches += 1
+
+	if matches == 0:
+		sys.exit(127)
+	if matches > 1:
+		sys.exit(1)
+except requests.exceptions.RequestException as e:
+	print(e)


Commit: 73b5db52d68b46ee3f20085db98bada0bc5a648d
    https://github.com/scummvm/scummvm/commit/73b5db52d68b46ee3f20085db98bada0bc5a648d
Author: lb_ii (lolbot_iichan at mail.ru)
Date: 2021-05-30T20:49:49+03:00

Commit Message:
DEVTOOLS: Fix steam_gameid.py for current steamdb format

Changed paths:
    devtools/steam_gameid.py


diff --git a/devtools/steam_gameid.py b/devtools/steam_gameid.py
index faec0ada6f..08a5caa6d5 100755
--- a/devtools/steam_gameid.py
+++ b/devtools/steam_gameid.py
@@ -37,7 +37,7 @@ try:
 		game_id           = game_rows[idx + 0].text.strip()
 		game_type         = game_rows[idx + 1].text.strip()
 		game_name         = game_rows[idx + 2].text.strip()
-		game_last_changed = game_rows[idx + 3].attrs["title"].strip()
+		game_last_changed = game_rows[idx + 3].attrs["data-time"].strip()
 		if not args.all and game_name != args.name:
 			if args.verbose:
 				sys.stderr.write('found {0} - no match for {1}\n'.format(game_name, args.name))




More information about the Scummvm-git-logs mailing list