|
@@ -18,7 +18,7 @@ class WebDouYin:
|
18
|
18
|
|
19
|
19
|
# print('_signature',d)
|
20
|
20
|
return d
|
21
|
|
- def get_ck(self):
|
|
21
|
+ def get_ck(self, proxy=None):
|
22
|
22
|
requests.packages.urllib3.disable_warnings()
|
23
|
23
|
headers = {
|
24
|
24
|
'authority': 'www.douyin.com',
|
|
@@ -31,7 +31,7 @@ class WebDouYin:
|
31
|
31
|
'upgrade-insecure-requests': '1',
|
32
|
32
|
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36',
|
33
|
33
|
}
|
34
|
|
- res = requests.get('https://www.douyin.com/', headers=headers,verify=False)
|
|
34
|
+ res = requests.get('https://www.douyin.com/', headers=headers,verify=False, proxies=proxy)
|
35
|
35
|
cookie_dict=res.cookies.get_dict()
|
36
|
36
|
ck=''
|
37
|
37
|
if cookie_dict:
|
|
@@ -65,9 +65,12 @@ class WebDouYin:
|
65
|
65
|
json_data = "请求失败" + str(e)
|
66
|
66
|
print(json_data)
|
67
|
67
|
return json_data
|
68
|
|
- def get_user_videos(self,sec_user_id,max_cursor=0,count=10,proxy=None):
|
|
68
|
+ def get_user_videos(self,sec_user_id,max_cursor=0,count=10,proxy=None,cookie=None):
|
69
|
69
|
|
70
|
70
|
ua,ck=self.get_ua_ck('get_user_videos')
|
|
71
|
+
|
|
72
|
+ if cookie:
|
|
73
|
+ ck = cookie
|
71
|
74
|
|
72
|
75
|
url='https://www.douyin.com/aweme/v1/web/aweme/post/?'
|
73
|
76
|
param={
|