|
@@ -13,6 +13,7 @@ sys.path.append(os.getcwd())
|
|
|
|
|
|
from application.common.proxies import tunnel_proxies
|
|
|
from application.common.log import AliyunLogger
|
|
|
+from application.common.feishu import FeishuInsert
|
|
|
|
|
|
|
|
|
class PiaoQuanVlog(object):
|
|
@@ -37,6 +38,8 @@ class PiaoQuanVlog(object):
|
|
|
'accept-language': 'en-US,en;q=0.9'
|
|
|
}
|
|
|
self.aliyun_log = AliyunLogger(platform="piaoquanVlog", mode="recommend")
|
|
|
+ self.feishu = FeishuInsert(document_token="PN9usqN4ehDIFxtdsuqcH546nwe")
|
|
|
+ self.sheet_id = "cc9ace"
|
|
|
|
|
|
def send_request(self, page_num):
|
|
|
"""
|
|
@@ -88,7 +91,7 @@ class PiaoQuanVlog(object):
|
|
|
:return: None
|
|
|
"""
|
|
|
for video_obj in video_list:
|
|
|
- print(json.dumps(video_obj, ensure_ascii=False, indent=4))
|
|
|
+ # print(json.dumps(video_obj, ensure_ascii=False, indent=4))
|
|
|
video_item = {
|
|
|
"id": video_obj['id'],
|
|
|
"status": video_obj['status'],
|
|
@@ -101,12 +104,17 @@ class PiaoQuanVlog(object):
|
|
|
"publish_date": video_obj['gmtCreateDescr']
|
|
|
}
|
|
|
time.sleep(12)
|
|
|
- # print(json.dumps(video_item, ensure_ascii=False, indent=4))
|
|
|
self.aliyun_log.logging(
|
|
|
code="7001",
|
|
|
message="监控到一条视频",
|
|
|
data=video_item
|
|
|
)
|
|
|
+ line = [video_item["id"], video_item["status"], video_item["uid"], video_item["title"], video_item["titleId"],video_item['playCount'], video_item["shareCount"], video_item["favorCount"], datetime.datetime.now().__str__(), video_item['publish_date']]
|
|
|
+ self.feishu.insert_value(
|
|
|
+ sheet_id=self.sheet_id,
|
|
|
+ values=[line],
|
|
|
+ ranges="A2:K2"
|
|
|
+ )
|
|
|
|
|
|
def run(self):
|
|
|
"""
|