Skip to content

Commit cd672e4

Browse files
dozeworthyboppreh
authored andcommitted
Fix game list acquisition
Accessing the games tab apparently requires being logged in to Steam, but requesting the list in XML format still works
1 parent 36f069e commit cd672e4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

games.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type Game struct {
3636

3737
// Pattern of game declarations in the public profile. It's actually JSON
3838
// inside Javascript, but this way is easier to extract.
39-
const profileGamePattern = `\{"appid":\s*(\d+),\s*"name":\s*"(.+?)"`
39+
const profileGamePattern = `<appID>(\d+)<\/appID>\s*<name><!\[CDATA\[(.+?)\]\]><\/name>`
4040

4141
// Fetches the list of games from the public user profile. This is better than
4242
// looking locally because the profiles give the full game name, which can be

users.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func GetUsers(installationDir string) ([]User, error) {
8484
}
8585

8686
// URL to get the game list from the SteamId64.
87-
const profilePermalinkFormat = `http://steamcommunity.com/profiles/%v/games?tab=all`
87+
const profilePermalinkFormat = `http://steamcommunity.com/profiles/%v/games?xml=1`
8888

8989
// The Steam website has the terrible habit of returning 200 OK when requests
9090
// fail, and signaling the error in HTML. So we have to parse the request to

0 commit comments

Comments
 (0)