|
@@ -4,7 +4,7 @@ import time
|
|
|
|
|
|
import requests
|
|
|
|
|
|
-from common import Material, Oss, Common
|
|
|
+from common import Material, Oss, Common, Feishu
|
|
|
from common.sql_help import sqlCollect
|
|
|
from data_channel.shipinhao import SPH
|
|
|
|
|
@@ -91,10 +91,27 @@ class SphHistory:
|
|
|
fav_count = obj['fav_count'] # 大拇指点赞数
|
|
|
sqlCollect.sph_data_info('视频号', objectId, video_url, cover, video_title, str(share_cnt), str(like_cnt), oss_video_key, oss_cover_key, nick_name, user_name, comment_count, fav_count, create_time)
|
|
|
Common.logger("sph_crawling").info(f"{nick_name}插入数据成功")
|
|
|
+ sqlCollect.update_sph_channel_user_status(user)
|
|
|
+ Common.logger("sph_crawling").info(f"{user}用户抓取完成")
|
|
|
+ count = sqlCollect.sph_data_info_count(user, "视频号")
|
|
|
+ text = (
|
|
|
+ f"**{user}抓取完成共抓了{count}条数据**\n"
|
|
|
+ )
|
|
|
+ Feishu.finish_bot(text,
|
|
|
+ "https://open.feishu.cn/open-apis/bot/v2/hook/029fa989-9847-4574-8e1b-5c396e665f16",
|
|
|
+ "【 视频号历史数据抓取通知 】")
|
|
|
except Exception as e:
|
|
|
Common.logger("sph_crawling").info(f"{user}异常,异常信息{e}")
|
|
|
+ Feishu.finish_bot(e,
|
|
|
+ "https://open.feishu.cn/open-apis/bot/v2/hook/029fa989-9847-4574-8e1b-5c396e665f16",
|
|
|
+ "【 视频号抓取异常通知 】")
|
|
|
continue
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@classmethod
|
|
|
def get_sph_user(cls):
|
|
|
data = sqlCollect.sph_channel_user_list()
|
|
@@ -110,4 +127,6 @@ class SphHistory:
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
- SphHistory.sph_data_info()
|
|
|
+ # SphHistory.sph_data_info()
|
|
|
+ count = sqlCollect.sph_data_info_count("郑蓝旗", "视频号")
|
|
|
+ print(count)
|