wangkun hace 2 años
padre
commit
8c96b52a91
Se han modificado 4 ficheros con 8 adiciones y 95 borrados
  1. 4 0
      README.md
  2. 0 69
      main/demo.py
  3. 3 25
      main/get_signature.py
  4. 1 1
      main/xigua_follow.py

+ 4 - 0
README.md

@@ -18,6 +18,10 @@
 2. python3 /main/run_xigua_follow.py
 
 #### 需求
+2022/9/28
+1. 排除置顶过期(发布时间超过10天)视频
+
+2022/9/23
 1. 爬取时间:不限制时间:只要定向账号更新,就进行爬取
 2. 爬取规则: 
    1. 视频时长:1分钟以上 

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 69
main/demo.py


+ 3 - 25
main/get_signature.py

@@ -33,8 +33,8 @@ class GetSignature:
             driver = webdriver.Chrome(desired_capabilities=ca, options=chrome_options)
 
             driver.implicitly_wait(10)
-            Common.logger(log_type).info('打开『北京旅游等着瞧』个人主页')
-            driver.get('https://www.ixigua.com/home/2176672314697038')
+            Common.logger(log_type).info('打开个人主页')
+            driver.get('https://www.ixigua.com/home/100909070373/')
             time.sleep(5)
 
             # 向上滑动 1000 个像素
@@ -57,7 +57,7 @@ class GetSignature:
                     pass
                 elif 'documentURL' not in msg['message']['params']:
                     pass
-                elif 'www.ixigua.com/home/2176672314697038' not in msg['message']['params']['documentURL']:
+                elif 'www.ixigua.com/home/100909070373' not in msg['message']['params']['documentURL']:
                     pass
                 elif 'url' not in msg['message']['params']['request']:
                     pass
@@ -78,27 +78,6 @@ class GetSignature:
                     Feishu.update_values(log_type, 'xigua', '6tZHhs', 'A2:B2', values)
                     Common.logger(log_type).info('signature写入飞书成功:{}\n', signature)
                     cls.del_signature(log_type)
-
-                # if 'message' in line \
-                #         and 'message' in json.loads(line['message'])\
-                #         and 'params' in json.loads(line['message'])['message']\
-                #         and 'response' in json.loads(line['message'])['message']['params']\
-                #         and 'url' in json.loads(line['message'])['message']['params']['response']\
-                #         and '_signature' in json.loads(line['message'])['message']['params']['response']['url']\
-                #         and 'web/user/settings' in json.loads(line['message'])['message']['params']['response']['url']:
-                #     url = json.loads(line['message'])['message']['params']['response']['url']
-                #     signature = url.split('_signature=')[-1]
-                #     if len(signature) < 50:
-                #         pass
-                #     else:
-                #         get_signature_time = time.strftime('%Y/%m/%d %H:%M:%S', time.localtime(time.time()))
-                #         values = [[get_signature_time, signature]]
-                #         Feishu.update_values(log_type, 'xigua', '6tZHhs', 'A2:B2', values)
-                #         Common.logger(log_type).info('signature写入飞书成功:{}\n', signature)
-                #         cls.del_signature(log_type)
-                # else:
-                #     Common.logger(log_type).info('未获取到signature:{}\n', line)
-
         except Exception as e:
             Common.logger(log_type).error('get_signature异常:{}', e)
 
@@ -118,5 +97,4 @@ class GetSignature:
 
 if __name__ == '__main__':
     GetSignature.get_signature('follow')
-    # GetSignature.del_signature('follow')
     pass

+ 1 - 1
main/xigua_follow.py

@@ -619,7 +619,7 @@ class Follow:
                     cls.get_follow_feeds_by_pc(log_type, v.split(',')[0])
                     time.sleep(1)
                     cls.run_download_publish(log_type, env, v.split(',')[-1])
-                    time.sleep(random.randint(5, 10))
+                    time.sleep(random.randint(30, 60))
         except Exception as e:
             Common.logger(log_type).error('get_all_person_videos异常:{}\n', e)
 

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio