forked from Pullautumn/just_for_happy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmly.py
44 lines (40 loc) · 1.98 KB
/
xmly.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import requests, json
#配置喜马拉雅app登录帐号的cookie 支持多账号 cookie一行一个根据实际需求增删
xmly_cookie = [
'channel=****',
'channel=****'
]
for i in range(len(xmly_cookie)):
print(f'开始第{i + 1}个帐号签到')
url = 'https://hybrid.ximalaya.com/web-activity/signIn/v2/signIn?v=new '
headers = {
'Host': 'hybrid.ximalaya.com',
'Content-Type': 'application/json',
'Accept': '*/*',
'X-Xuid-Fp': 'FISDYy0YZLgYhwIObU0_rmpz5ZIWc2doY1AQZ8xlyQk8pafpgABxMiE5LjAuNDMh',
'Connection': 'keep-alive',
'Cookie': f'{xmly_cookie[i]}',
'User-Agent': 'ting_v9.0.87_c5(CFNetwork, iOS 15.6, iPhone14,5)',
'Content-Length': '10',
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
}
data='{"aid":87}'
html = requests.post(url=url, headers=headers, data=data)
result = json.loads(html.text)['data']['msg']
print(result)
m_url='https://m.ximalaya.com/business-vip-presale-mobile-web/page/ts-1671779856199?version=9.0.87'
m_headers={
'Host': 'm.ximalaya.com',
'Accept': 'application/json, text/plain, */*',
'Connection': 'keep-alive',
'Cookie': f'{xmly_cookie[i]}',
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 iting/9.0.87 kdtunion_iting/1.0 iting(main)/9.0.87/ios_1 ;xmly(main)/9.0.87/iOS_1',
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Referer': 'https://m.ximalaya.com/gatekeeper/business-xmvip/main?app=iting&version=9.0.87&impl=com.gemd.iting&orderSource=app_Other_MyPage_VipCard',
'Accept-Encoding': 'gzip, deflate, br',
}
m_html = requests.get(url=m_url, headers=m_headers)
m_result = json.loads(m_html.text)['data']['modules'][0]['userInfo']
info = 'ID: '+str(m_result['userId'])+ ' 用户名: '+ m_result['nickName']+ ' VIP到期日期: '+m_result['subtitle']
print(info)