# *_*coding:utf-8 *_*
import requests
import json
url = 'https://i.snssdk.com/bds/feed/stream/?api_version=4.2&layout_style=1&feed_count=5&cursor=1607864083610&auto_play=1&first_launch=false&is_new_story=true&auto_play_wifi=false&auto_play_mobile=true&list_type=1&sub_channel_type=0&direction=2&iid=404242811586408&device_id=2955087819584408&ac=wifi&mac_address=00%3A81%3Aeb%3A12%3A74%3A22&channel=tengxun&aid=1319&app_name=super&version_code=310&version_name=3.1.0&device_platform=android&ssmix=a&device_type=SM-G9730&device_brand=samsung&language=zh&os_api=22&os_version=5.1.1&uuid=865166026081698&openudid=3c7e3988f3dd1c3c&manifest_version_code=310&resolution=1280*720&dpi=240&update_version_code=31050&_rticket=1607864812292&cdid=94bc9102-5bd9-400b-a88a-f951dba7d451&app_region=CN&sys_region=CN&time_zone=Asia%2FShanghai&app_language=ZH&carrier_region=CN&last_channel=&last_update_version_code=0&ts=1607864814&as=a111111111111111111111&cp=a000000000000000000000&mas=011faa18fcf33cf2159b9c0565a06807f58c8c8c8c8c8c8c8c8c8c'
# url = 'https://i.snssdk.com/bds/feed/stream/?api_version=4.2&layout_style=1&feed_count=6&cursor=1607864072610&auto_play=1&first_launch=false&is_new_story=true&auto_play_wifi=false&auto_play_mobile=true&list_type=1&sub_channel_type=0&direction=2&iid=404242811586408&device_id=2955087819584408&ac=wifi&mac_address=00%3A81%3Aeb%3A12%3A74%3A22&channel=tengxun&aid=1319&app_name=super&version_code=310&version_name=3.1.0&device_platform=android&ssmix=a&device_type=SM-G9730&device_brand=samsung&language=zh&os_api=22&os_version=5.1.1&uuid=865166026081698&openudid=3c7e3988f3dd1c3c&manifest_version_code=310&resolution=1280*720&dpi=240&update_version_code=31050&_rticket=1607866998357&cdid=94bc9102-5bd9-400b-a88a-f951dba7d451&app_region=CN&sys_region=CN&time_zone=Asia%2FShanghai&app_language=ZH&carrier_region=CN&last_channel=&last_update_version_code=0&ts=1607867000&as=a111111111111111111111&cp=a000000000000000000000&mas=011faa18fcf33cf2159b9c0565a06807f58c8c8c8c8c8c8c8c8c8c'
# url = 'https://i.snssdk.com/bds/feed/stream/?api_version=4.2&layout_style=1&feed_count=7&cursor=1607864061610&auto_play=1&first_launch=false&is_new_story=true&auto_play_wifi=false&auto_play_mobile=true&list_type=1&sub_channel_type=0&direction=2&iid=404242811586408&device_id=2955087819584408&ac=wifi&mac_address=00%3A81%3Aeb%3A12%3A74%3A22&channel=tengxun&aid=1319&app_name=super&version_code=310&version_name=3.1.0&device_platform=android&ssmix=a&device_type=SM-G9730&device_brand=samsung&language=zh&os_api=22&os_version=5.1.1&uuid=865166026081698&openudid=3c7e3988f3dd1c3c&manifest_version_code=310&resolution=1280*720&dpi=240&update_version_code=31050&_rticket=1607867530409&cdid=94bc9102-5bd9-400b-a88a-f951dba7d451&app_region=CN&sys_region=CN&time_zone=Asia%2FShanghai&app_language=ZH&carrier_region=CN&last_channel=&last_update_version_code=0&ts=1607867532&as=a111111111111111111111&cp=a000000000000000000000&mas=011faa18fcf33cf2159b9c0565a06807f58c8c8c8c8c8c8c8c8c8c'
headers = {
'Accept-Encoding': 'gzip',
'X-SS-QUERIES': 'dGMFEAAALKb45244N2Q4WvZRaWJ43MHnNutwf3ezOKOIakGvmRRer2p7PWNt3oVnlkF0MfY6JudbjVSLm0QZ3%2FwrOWEI7cEeRrNjxL%2Bh81Cvk%2BlR0U%2FJPnw6TOiz7BDIenFnuZ9ms%2FpQMEmGCMkEEzUvVK1s6CGCUOtiPh9jNxSBwWHxJKESn32AupRlbUgaoF%2F05V1uGTH28KhzNMX5PQYxBtAuJybX%2FV%2Fz75gyFhqAizH15qF%2FmWZOaiVnUdMcofBdnX7aRFqCRl%2FnwcYohIU%2FQLf5B1GYlGb4SxS4DITNq9Ri%2B98%3D',
'X-SS-REQ-TICKET': '1607864812299',
'sdk-version': '1',
'User-Agent': 'ttnet okhttp/3.10.0.2',
'Cookie': 'd_ticket=fb76f4b5600697d133c8fecd35329d029da2c; odin_tt=ac704e8fd8703e27e7cf14edde603d864ffe1a9a4373bf796c20793b9196da808efa8ce56635229aea208be00fee4f70; n_mh=5CPRU9W2V4vPoaX-0-2TPdOvOsZoi5YzrOvHTVEJ4U8; sid_guard=d135f984cfd29725e6e8ddb960906af3%7C1607740914%7C5184000%7CWed%2C+10-Feb-2021+02%3A41%3A54+GMT; uid_tt=0c1094f9d8f32f964b95ed966182270e; sid_tt=d135f984cfd29725e6e8ddb960906af3; sessionid=d135f984cfd29725e6e8ddb960906af3; install_id=404242811586408; ttreq=1$fe319892ccdf9ac7e3a4132a7f21bcb432fa7d6c',
'x-tt-token': '00d135f984cfd29725e6e8ddb960906af30175422c24e6eae31288d84c275f55e25dc8eb5bd4c35a6534842c12e02d7597be352d94205a8e9c1a5bd2472cdabe5fac578e04e53e74467cfb7c13d448d309ec8-1.0.0',
'X-Gorgon': '04084877401129aab917856373c902a24c260648508b3c735e5e',
'X-Khronos': '1607864812',
'Host': 'i.snssdk.com',
'Connection': 'Keep-Alive',
}
response = requests.get(url,headers=headers)
# print(response.text)
date = json.loads(response.text)
date_list = date['data']['data']
# print(date_list)
for share_list in date_list:
video_list = share_list['item']['share']['share_url']
print(video_list)
with open('链接.txt', 'a', encoding = 'utf-8') as f:
f.write(video_list + '\n')
|