This repository has been archived by the owner on Mar 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added timeouts to requests and fixed login (#4)
- Loading branch information
Lucas
committed
Sep 11, 2021
1 parent
8105401
commit 7b11dd0
Showing
11 changed files
with
68 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
import requests | ||
import json | ||
import socket | ||
|
||
import globals | ||
|
||
from utilities.log import log | ||
|
||
def shaking_sats(): | ||
# all these headers are required for shaking sats | ||
local_headers = globals.headers.copy() | ||
local_headers['X-Device-Brand'] = 'samsung' | ||
local_headers['X-Device-Model'] = 'SM-G930W8' | ||
local_headers['X-Device-System-Name'] = 'Android' | ||
local_headers['X-Device-System-Version'] = '8.0.0' | ||
local_headers['X-Device-Carrier'] = 'Bell' | ||
local_headers['X-Device-Mac-Address'] = 'AA:BB:CC:DD:EE:FF' | ||
local_headers['X-Device-Manufacturer'] = 'samsung' | ||
local_headers['X-Device-Id'] = 'universal8890' | ||
local_headers['X-Device-Ip-Address'] = '10.0.0.0' | ||
local_headers['X-Device-Locale'] = 'en-CA' | ||
local_headers['X-Device-Country'] = 'CA' | ||
local_headers['X-Device-Name'] = f'@burnttoaster bot v{globals.version}' | ||
local_headers['X-Device-Total-Disk-Capacity'] = '138764288' | ||
local_headers['X-Device-Total-Memory'] = '37019976576' | ||
local_headers['X-Device-Is-Tablet'] = 'false' | ||
local_headers['X-Device-Has-Notch'] = 'false' | ||
local_headers['X-Notification-Token'] = '' | ||
local_headers['Content-Type'] = 'application/json' | ||
# copy global headers so that we can append our own headers without affecting global | ||
local_headers = {**globals.headers, **{ | ||
'X-Device-Brand': 'bot', | ||
'X-Device-Model': socket.gethostname(), | ||
'X-Device-System-Name': 'burntbot', | ||
'X-Device-System-Version': str(globals.version), | ||
'X-Device-Carrier': '', | ||
'X-Device-Mac-Address': 'AA:BB:CC:DD:EE:FF', | ||
'X-Device-Manufacturer': '@burnttoaster', | ||
'X-Device-Id': '', | ||
'X-Device-Ip-Address': '10.0.0.1', | ||
'X-Device-Locale': 'en-CA', | ||
'X-Device-Country': 'CA', | ||
'X-Device-Name': f'@burnttoaster bot v{globals.version}', | ||
'X-Device-Total-Disk-Capacity': '138764288', | ||
'X-Device-Total-Memory': '37019976576', | ||
'X-Device-Is-Tablet': 'false', | ||
'X-Device-Has-Notch': 'false', | ||
'X-Notification-Token': '', | ||
'Content-Type': 'application/json' | ||
}} | ||
|
||
response = requests.post('https://api.shakepay.com/shaking-sats', headers = local_headers, data = json.dumps({})) | ||
response = requests.post('https://api.shakepay.com/shaking-sats', headers = local_headers, data = json.dumps({}), timeout = 5) | ||
|
||
log(f'shaking-sats code: {response.status_code}', True) | ||
log(f'shaking-sats data: {response.json()}', True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters