|
@@ -17,6 +17,21 @@ class Hot:
|
|
|
|
|
|
page = 0
|
|
|
|
|
|
+ @classmethod
|
|
|
+ def filter_words(cls, log_type):
|
|
|
+ try:
|
|
|
+ filter_words_sheet = Feishu.get_values_batch(log_type, 'haokan', 'nKgHzp')
|
|
|
+ filter_words_list = []
|
|
|
+ for x in filter_words_sheet:
|
|
|
+ for y in x:
|
|
|
+ if y is None:
|
|
|
+ pass
|
|
|
+ else:
|
|
|
+ filter_words_list.append(y)
|
|
|
+ return filter_words_list
|
|
|
+ except Exception as e:
|
|
|
+ Common.logger(log_type).error(f'filter_words异常:{e}')
|
|
|
+
|
|
|
@classmethod
|
|
|
def get_hot_feeds(cls, log_type, our_id, env):
|
|
|
try:
|
|
@@ -176,6 +191,8 @@ class Hot:
|
|
|
def download_publish(cls, log_type, video_dict, our_id, env):
|
|
|
if video_dict['video_title'] == 0 or video_dict['video_url'] == 0:
|
|
|
Common.logger(log_type).info('无效视频\n')
|
|
|
+ elif any(word if word in video_dict['video_title'] else False for word in cls.filter_words(log_type)) is True:
|
|
|
+ Common.logger(log_type).info('已中过滤词库\n')
|
|
|
elif video_dict['video_id'] in [x for y in Feishu.get_values_batch(log_type, 'haokan', '5pWipX') for x in y]:
|
|
|
Common.logger(log_type).info('视频已下载\n')
|
|
|
elif video_dict['video_id'] in [x for y in Feishu.get_values_batch(log_type, 'haokan', '7f05d8') for x in y]:
|