1
0
mirror of https://github.com/okyyds/yyds.git synced 2026-07-12 15:21:17 +08:00
This commit is contained in:
yyds
2022-03-01 15:17:54 +08:00
parent 5c5165129b
commit fa0a8688e5

View File

@@ -20,22 +20,19 @@ import urllib
#以下部分参考Curtin的脚本https://github.com/curtinlv/JD-Script #以下部分参考Curtin的脚本https://github.com/curtinlv/JD-Script
UserAgent = '' def randomuserAgent():
uuid=''.join(random.sample(['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','a','b','c','z'], 40)) global uuid,addressid,iosVer,iosV,clientVersion,iPhone,area,ADID,lng,lat
addressid = ''.join(random.sample('1234567898647', 10)) uuid=''.join(random.sample(['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','a','b','c','z'], 40))
iosVer = ''.join(random.sample(["14.5.1", "14.4", "14.3", "14.2", "14.1", "14.0.1", "13.7", "13.1.2", "13.1.1"], 1)) addressid = ''.join(random.sample('1234567898647', 10))
iosV = iosVer.replace('.', '_') iosVer = ''.join(random.sample(["15.1.1","14.5.1", "14.4", "14.3", "14.2", "14.1", "14.0.1"], 1))
clientVersion=''.join(random.sample(["10.3.0", "10.2.7", "10.2.4", "10.2.2", "10.2.0", "10.1.6"], 1)) iosV = iosVer.replace('.', '_')
iPhone = ''.join(random.sample(["8", "9", "10", "11", "12", "13"], 1)) clientVersion=''.join(random.sample(["10.3.0", "10.2.7", "10.2.4"], 1))
area=''.join(random.sample('0123456789', 2)) + '_' + ''.join(random.sample('0123456789', 4)) + '_' + ''.join(random.sample('0123456789', 5)) + '_' + ''.join(random.sample('0123456789', 4)) iPhone = ''.join(random.sample(["8", "9", "10", "11", "12", "13"], 1))
ADID = ''.join(random.sample('0987654321ABCDEF', 8)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 12)) area=''.join(random.sample('0123456789', 2)) + '_' + ''.join(random.sample('0123456789', 4)) + '_' + ''.join(random.sample('0123456789', 5)) + '_' + ''.join(random.sample('0123456789', 4))
ADID = ''.join(random.sample('0987654321ABCDEF', 8)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 12))
def userAgent(): lng='119.31991256596'+str(random.randint(100,999))
""" lat='26.1187118976'+str(random.randint(100,999))
随机生成一个UA UserAgent=''
jdapp;iPhone;10.0.4;14.2;9fb54498b32e17dfc5717744b5eaecda8366223c;network/wifi;ADID/2CF597D0-10D8-4DF8-C5A2-61FD79AC8035;model/iPhone11,1;addressid/7785283669;appBuild/167707;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/null;supportJDSHWK/1
:return: ua
"""
if not UserAgent: if not UserAgent:
return f'jdapp;iPhone;10.0.4;{iosVer};{uuid};network/wifi;ADID/{ADID};model/iPhone{iPhone},1;addressid/{addressid};appBuild/167707;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS {iosV} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/null;supportJDSHWK/1' return f'jdapp;iPhone;10.0.4;{iosVer};{uuid};network/wifi;ADID/{ADID};model/iPhone{iPhone},1;addressid/{addressid};appBuild/167707;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS {iosV} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/null;supportJDSHWK/1'
else: else:
@@ -94,7 +91,7 @@ def get_succeedinfo(ck):
'origin':'https://prodev.m.jd.com', 'origin':'https://prodev.m.jd.com',
'content-length':'249', 'content-length':'249',
'accept-language':'zh-CN,zh-Hans;q=0.9', 'accept-language':'zh-CN,zh-Hans;q=0.9',
'User-Agent':userAgent(), 'User-Agent':UserAgent,
'referer':'https://prodev.m.jd.com/', 'referer':'https://prodev.m.jd.com/',
'accept-encoding':'gzip, deflate, br', 'accept-encoding':'gzip, deflate, br',
'cookie':ck 'cookie':ck
@@ -107,19 +104,15 @@ def get_succeedinfo(ck):
if(json.loads(response.text)['data']['list'][i]['text']['text']).find('试用资格将保留')!=-1: if(json.loads(response.text)['data']['list'][i]['text']['text']).find('试用资格将保留')!=-1:
print(json.loads(response.text)['data']['list'][i]['trialName']) print(json.loads(response.text)['data']['list'][i]['trialName'])
try: try:
if remarkinfos[ptpin]!='':
send("京东试用待领取物品通知",'账号名称:'+remarkinfos[ptpin]+'\n'+'商品名称:'+json.loads(response.text)['data']['list'][i]['trialName']+"\n"+"商品链接:https://item.jd.com/"+json.loads(response.text)['data']['list'][i]['skuId']+".html") send("京东试用待领取物品通知",'账号名称:'+remarkinfos[ptpin]+'\n'+'商品名称:'+json.loads(response.text)['data']['list'][i]['trialName']+"\n"+"商品链接:https://item.jd.com/"+json.loads(response.text)['data']['list'][i]['skuId']+".html")
isnull=False isnull=False
else: except:
send("京东试用待领取物品通知",'账号名称:'+urllib.parse.unquote(ptpin)+'\n'+'商品名称:'+json.loads(response.text)['data']['list'][i]['trialName']+"\n"+"商品链接:https://item.jd.com/"+json.loads(response.text)['data']['list'][i]['skuId']+".html") send("京东试用待领取物品通知",'账号名称:'+urllib.parse.unquote(ptpin)+'\n'+'商品名称:'+json.loads(response.text)['data']['list'][i]['trialName']+"\n"+"商品链接:https://item.jd.com/"+json.loads(response.text)['data']['list'][i]['skuId']+".html")
isnull=False isnull=False
except Exception as e:
printf(str(e))
if isnull==True: if isnull==True:
print("没有在有效期内待领取的试用品\n\n") print("没有在有效期内待领取的试用品\n\n")
except: except:
print('获取信息出错,可能是账号已过期') print('获取信息出错,可能是账号已过期')
pass
if __name__ == '__main__': if __name__ == '__main__':
remarkinfos={} remarkinfos={}
try: try:
@@ -144,4 +137,5 @@ if __name__ == '__main__':
printf("--无备注账号:" + urllib.parse.unquote(ptpin) + "--") printf("--无备注账号:" + urllib.parse.unquote(ptpin) + "--")
except Exception as e: except Exception as e:
printf("--账号:" + urllib.parse.unquote(ptpin) + "--") printf("--账号:" + urllib.parse.unquote(ptpin) + "--")
UserAgent=randomuserAgent()
get_succeedinfo(ck) get_succeedinfo(ck)