From 068c8adfb3cc958daf3f03f93550800eb3ef83fb Mon Sep 17 00:00:00 2001 From: Simon Esposito Date: Mon, 18 Sep 2023 12:03:41 +0200 Subject: [PATCH] Update steam api url (#1081) --- CHANGELOG.md | 3 +++ social/social.go | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 429e06b3d7..0e9407fed5 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project are documented below. The format is based on [keep a changelog](http://keepachangelog.com) and this project uses [semantic versioning](http://semver.org). ## [Unreleased] +### Changed +- Use Steam partner API instead of public API for Steam profiles and friends requests. + ### Fixed - Fixed multiple issues found by linter. diff --git a/social/social.go b/social/social.go index b8c9174e07..5ce631da7a 100644 --- a/social/social.go +++ b/social/social.go @@ -276,7 +276,7 @@ func (c *Client) GetFacebookFriends(ctx context.Context, accessToken string) ([] func (c *Client) GetSteamFriends(ctx context.Context, publisherKey, steamId string) ([]SteamProfile, error) { c.logger.Debug("Getting Steam friends", zap.String("steamId", steamId)) - path := fmt.Sprintf("https://api.steampowered.com/ISteamUser/GetFriendList/v0001/?key=%s&steamid=%s&relationship=friend", publisherKey, steamId) + path := fmt.Sprintf("https://partner.steam-api.com/ISteamUser/GetFriendList/v0001/?key=%s&steamid=%s&relationship=friend", publisherKey, steamId) var steamFriends steamFriendsWrapper err := c.request(ctx, "steam friends", path, nil, &steamFriends) if err != nil { @@ -621,7 +621,7 @@ func (c *Client) CheckGameCenterID(ctx context.Context, playerID string, bundleI func (c *Client) GetSteamProfile(ctx context.Context, publisherKey string, appID int, ticket string) (*SteamProfile, error) { c.logger.Debug("Getting Steam profile", zap.String("publisherKey", publisherKey), zap.Int("appID", appID), zap.String("ticket", ticket)) - path := "https://api.steampowered.com/ISteamUserAuth/AuthenticateUserTicket/v1/?format=json" + + path := "https://partner.steam-api.com/ISteamUserAuth/AuthenticateUserTicket/v1/?format=json" + "&key=" + url.QueryEscape(publisherKey) + "&appid=" + strconv.Itoa(appID) + "&ticket=" + url.QueryEscape(ticket) var profileWrapper SteamProfileWrapper err := c.request(ctx, "steam profile", path, nil, &profileWrapper)