Skip to content

Commit

Permalink
Fix game list acquisition
Browse files Browse the repository at this point in the history
Accessing the games tab apparently requires being logged in to Steam, but requesting the list in XML format still works
  • Loading branch information
dozeworthy authored and boppreh committed Apr 20, 2023
1 parent 36f069e commit cd672e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion games.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type Game struct {

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

// Fetches the list of games from the public user profile. This is better than
// looking locally because the profiles give the full game name, which can be
Expand Down
2 changes: 1 addition & 1 deletion users.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func GetUsers(installationDir string) ([]User, error) {
}

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

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

0 comments on commit cd672e4

Please sign in to comment.