luojunhui 4 miesięcy temu
rodzic
commit
1bba5757c9
2 zmienionych plików z 5 dodań i 3 usunięć
  1. 4 2
      applications/wxSpiderApi.py
  2. 1 1
      updatePublishedMsgDaily.py

+ 4 - 2
applications/wxSpiderApi.py

@@ -35,9 +35,10 @@ class WeixinSpider(object):
         return response.json()
 
     @classmethod
-    def get_article_text(cls, content_link, is_count=False) -> dict:
+    def get_article_text(cls, content_link, is_count=False, is_cache=True) -> dict:
         """
         获取文章
+        :param is_cache:
         :param is_count:
         :param content_link:
         :return:
@@ -46,7 +47,8 @@ class WeixinSpider(object):
         payload = json.dumps({
             "content_link": content_link,
             "is_count": is_count,
-            "is_ad": False
+            "is_ad": False,
+            "is_cache": is_cache
         })
         response = requests.request("POST", url, headers=cls.headers, data=payload, timeout=120)
         return response.json()

+ 1 - 1
updatePublishedMsgDaily.py

@@ -620,7 +620,7 @@ def monitor():
         url = article[3]
         wx_sn = article[4]
         try:
-            response = spider.get_article_text(url)
+            response = spider.get_article_text(url, is_cache=False)
             response_code = response['code']
             if response_code == const.ARTICLE_ILLEGAL_CODE:
                 bot(