Skip to content
This repository has been archived by the owner on Dec 10, 2022. It is now read-only.

Commit

Permalink
add FlareSolverr
Browse files Browse the repository at this point in the history
  • Loading branch information
Nickwasused committed Nov 3, 2021
1 parent 331430a commit f5b8fe6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 7 additions & 1 deletion steam.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,15 @@ def getfreegames(s):
from urllib3 import PoolManager, exceptions
from bs4 import BeautifulSoup
import certifi

try:
https = PoolManager(ca_certs=certifi.where())
response = https.request('GET', url, headers=config.headers).data.decode('utf-8')
encoded_body = json.dumps({
"cmd": "request.get",
"url": url,
"maxTimeout": config.proxytimeout
})
response = https.request('POST', config.proxyurl, headers=config.headers, body=encoded_body).data.decode('utf-8')
logwrite('Got url: {}'.format(url))
except exceptions.ConnectionError:
pp.pprint('Cant connect to {}'.format(url))
Expand Down
9 changes: 4 additions & 5 deletions steamconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ class config:
log = 'true'
# Logfile Default: freegames-log
logfile = 'freegames.log'
# Proxys are disabled by default
proxy = 'disabled'
# Proxys url (FlareSolverr)
proxyurl = '127.0.0.1:8191'
proxytimeout = 60000
# Timeout for redeeming Keys: Default 2 Seconds
timeout = 2

Expand All @@ -34,8 +35,6 @@ def getsteamapilink(self, steamid):
return
return "https://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key={}&steamid={}&format=json".format(steam_api_key, steamid)

# You can change the User Agent here:
# Default: Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail appname/appversion
headers = {
'User-Agent': 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail appname/appversion'
'Content-Type': 'application/json'
}

0 comments on commit f5b8fe6

Please sign in to comment.