zhangyong 5 months ago
parent
commit
6b391b2bce
3 changed files with 12 additions and 6 deletions
  1. 0 0
      spider/crawler_offline/xng_zh.txt
  2. 11 5
      spider/crawler_offline/xng_zhanghao.py
  3. 1 1
      xng_zh_job.py

File diff suppressed because it is too large
+ 0 - 0
spider/crawler_offline/xng_zh.txt


+ 11 - 5
spider/crawler_offline/xng_zhanghao.py

@@ -47,12 +47,18 @@ class XNGZH(object):
         }
         headers = {
             'accept': 'application/json',
+            'accept-language': 'zh-CN,zh;q=0.9',
             'content-type': 'application/json;',
-            'cookie': 'SESSION=YjM4YmE5NDgtMjJmNi00NjA1LTgyNDUtYTNlZGVlOGNmODMy',
+            'cookie': 'SESSION=YWNiZDg0YWUtNDNhZS00MmRkLTk1YmEtZjY1N2M5NDNlMGRi',
             'origin': 'https://admin.piaoquantv.com',
-            'pragma': 'no-cache',
             'priority': 'u=1, i',
-            'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36'
+            'sec-ch-ua': '"Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"',
+            'sec-ch-ua-mobile': '?0',
+            'sec-ch-ua-platform': '"macOS"',
+            'sec-fetch-dest': 'empty',
+            'sec-fetch-mode': 'cors',
+            'sec-fetch-site': 'same-origin',
+            'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36'
         }
 
         requests.request("POST", url, headers=headers, json=payload)
@@ -160,9 +166,9 @@ class XNGZH(object):
                     with open(file_path, 'r') as file:
                         content = file.read()
                     if content and content[-1] != ',':
-                        uid = ',' + str(uid)
+                        m_id = ',' + str(m_id)
                     with open(file_path, 'a') as file:
-                        file.write(uid)
+                        file.write(m_id)
                     with open(file_path, 'r') as file:
                         content = file.read()
                 time.sleep(1)

+ 1 - 1
xng_zh_job.py

@@ -9,7 +9,7 @@ def bot_xng_count_recommend():
         xng = XNGZH()
         xng.get_video_info_2()
     except Exception as e:
-        print(f"新推荐异常了{e}")
+        print(f"异常了{e}")
 
 def schedule_tasks():
     schedule.every().day.at("00:50").do(bot_xng_count_recommend)

Some files were not shown because too many files changed in this diff