Explorar o código

update cookie切换

lierqiang %!s(int64=2) %!d(string=hai) anos
pai
achega
5a388a337b
Modificáronse 1 ficheiros con 13 adicións e 6 borrados
  1. 13 6
      kuaishou/kuaishou_follow/kuaishou_follow.py

+ 13 - 6
kuaishou/kuaishou_follow/kuaishou_follow.py

@@ -380,19 +380,26 @@ class Follow:
                 payload = json.dumps({
                     "operationName": "visionProfilePhotoList",
                     "variables": {
-                        "userId": out_uid,
-                        "pcursor": pcursor,
+                        "userId": "3xnmyk8gnhs5eze",
+                        "pcursor": "",
                         "page": "profile"
                     },
                     "query": "fragment photoContent on PhotoEntity {\n  id\n  duration\n  caption\n  originCaption\n  likeCount\n  viewCount\n  realLikeCount\n  coverUrl\n  photoUrl\n  photoH265Url\n  manifest\n  manifestH265\n  videoResource\n  coverUrls {\n    url\n    __typename\n  }\n  timestamp\n  expTag\n  animatedCoverUrl\n  distance\n  videoRatio\n  liked\n  stereoType\n  profileUserTopPhoto\n  musicBlocked\n  __typename\n}\n\nfragment feedContent on Feed {\n  type\n  author {\n    id\n    name\n    headerUrl\n    following\n    headerUrls {\n      url\n      __typename\n    }\n    __typename\n  }\n  photo {\n    ...photoContent\n    __typename\n  }\n  canAddComment\n  llsid\n  status\n  currentPcursor\n  tags {\n    type\n    name\n    __typename\n  }\n  __typename\n}\n\nquery visionProfilePhotoList($pcursor: String, $userId: String, $page: String, $webPageArea: String) {\n  visionProfilePhotoList(pcursor: $pcursor, userId: $userId, page: $page, webPageArea: $webPageArea) {\n    result\n    llsid\n    webPageArea\n    feeds {\n      ...feedContent\n      __typename\n    }\n    hostName\n    pcursor\n    __typename\n  }\n}\n"
                 })
 
                 headers = {
-                    'Cookie': 'kpf=PC_WEB; clientid=3; did=web_8832834f71f4c6ed405b5a35e95abc6d; kpn=KUAISHOU_VISION',
-                    'Referer': f'https://www.kuaishou.com/profile/{out_uid}',
-                    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.41',
+                    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/111.0',
+                    'Accept': '*/*',
+                    'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
+                    'Accept-Encoding': 'gzip, deflate, br',
+                    'Referer': 'https://www.kuaishou.com/profile/3xnmyk8gnhs5eze',
                     'content-type': 'application/json',
-
+                    'Origin': 'https://www.kuaishou.com',
+                    'Connection': 'keep-alive',
+                    'Cookie': 'kpf=PC_WEB; clientid=3; did=web_3f264336f6a6c191cd36fb15e87ab708; kpn=KUAISHOU_VISION',
+                    'Sec-Fetch-Dest': 'empty',
+                    'Sec-Fetch-Mode': 'cors',
+                    'Sec-Fetch-Site': 'same-origin'
                 }
                 urllib3.disable_warnings()
                 s = requests.session()