SEC1 = 'test1234' SEC2 = 'esdd1234' DB = 'tiktokdebug.db' USERNAME = '******' VID = '6945812541574499585' VID2 = '6992419824760671489' set_settings('debug', True) set_settings('tiktokRSSSecrets', SEC1) set_settings('tiktokDatabaseLocation', DB) set_settings('RSSProxySerects', SEC2) if exists(DB): remove(DB) r = Req(SEC1) print("Get User's RSS:") re = r.getWithSign('/tiktokRSS', {"u": [USERNAME], 't': ['rss']}) if re.status_code >= 400: print(re.text) raise ValueError(f"{re.status_code} {re.reason}") print("Get video's link with VID:") re = r.getWithSign('/tiktokRSS', { "vid": [VID], 't': ['url'] }, allow_redirects=False) if re.status_code != 302: print(re.text) raise ValueError(f"{re.status_code} {re.reason}") print(f"Get proxy link: {re.headers['location']}") print("Get video's link with VID and username:") re = r.getWithSign('/tiktokRSS', {
def getT(): from time import time return str(round(time())) dl = DebugList('proxy.txt') SEC = 'test1234' DB = 'proxydebug.db' set_settings('proxyAPISecrets', SEC) set_settings('proxyDatabaseLocation', DB) if exists(DB): remove(DB) r = Req(SEC) print('GET /proxy/list') re = r.getWithSign('/proxy/list', {"a": ["list"], "t": [getT()]}) re = dealAPIResponse(re) debug(f"Get {dumps(re)}", dl=dl) print('GET /proxy/add') re = r.getWithSign('/proxy/add', {"a": ["add"], "t": [getT()], "id": ["test1"], "headers": ["test=1;a=2"], "cookies": ["tes=1;a=3"]}) re = dealAPIResponse(re) debug(f"Get {dumps(re)}", dl=dl) print('POST /proxy/add') re = r.postWithSign('/proxy/add', {"a": ["add"], "t": [getT()], "id": ["test2"], "headers": ['{"test":"2","a":"4"}'], "cookies": ['{"te":"3","a":"1"}']}) re = dealAPIResponse(re) debug(f"Get {dumps(re)}", dl=dl)