|
@@ -8,29 +8,12 @@ from argparse import ArgumentParser
|
|
|
|
|
|
from applications import longArticlesMySQL, bot
|
|
from applications import longArticlesMySQL, bot
|
|
from coldStartTasks.crawler.weixinCategoryCrawler import weixinCategory
|
|
from coldStartTasks.crawler.weixinCategoryCrawler import weixinCategory
|
|
-from coldStartTasks.publish.publish_single_video_pool_videos import PublishSingleVideoPoolVideos
|
|
|
|
from coldStartTasks.publish.publishCategoryArticles import CategoryColdStartTask
|
|
from coldStartTasks.publish.publishCategoryArticles import CategoryColdStartTask
|
|
from coldStartTasks.filter.title_similarity_task import ColdStartTitleSimilarityTask
|
|
from coldStartTasks.filter.title_similarity_task import ColdStartTitleSimilarityTask
|
|
|
|
|
|
DEFAULT_CATEGORY_LIST = ['1030-手动挑号', 'account_association']
|
|
DEFAULT_CATEGORY_LIST = ['1030-手动挑号', 'account_association']
|
|
|
|
|
|
|
|
|
|
-def publish_single_video_task():
|
|
|
|
- """
|
|
|
|
- 从视频内容池获取抓取
|
|
|
|
- """
|
|
|
|
- try:
|
|
|
|
- publish_single_video_pool_videos = PublishSingleVideoPoolVideos()
|
|
|
|
- publish_single_video_pool_videos.deal()
|
|
|
|
- except Exception as e:
|
|
|
|
- bot(
|
|
|
|
- title="视频内容池任务创建失败",
|
|
|
|
- detail={
|
|
|
|
- "error": str(e),
|
|
|
|
- "error_msg": traceback.format_exc()
|
|
|
|
- }
|
|
|
|
- )
|
|
|
|
-
|
|
|
|
|
|
|
|
class AccountColdStartDailyTask(object):
|
|
class AccountColdStartDailyTask(object):
|
|
"""
|
|
"""
|
|
@@ -127,21 +110,17 @@ def main(date_str, category_list=None, article_source=None):
|
|
main job, use crontab to do job daily
|
|
main job, use crontab to do job daily
|
|
:return:
|
|
:return:
|
|
"""
|
|
"""
|
|
- # 首先发布视频内容池
|
|
|
|
- publish_single_video_task()
|
|
|
|
-
|
|
|
|
- # 再处理文章内容池
|
|
|
|
if not category_list:
|
|
if not category_list:
|
|
category_list = DEFAULT_CATEGORY_LIST
|
|
category_list = DEFAULT_CATEGORY_LIST
|
|
if not article_source:
|
|
if not article_source:
|
|
article_source = 'weixin'
|
|
article_source = 'weixin'
|
|
task = AccountColdStartDailyTask()
|
|
task = AccountColdStartDailyTask()
|
|
if task.init_db():
|
|
if task.init_db():
|
|
- # if article_source == 'weixin':
|
|
|
|
- # task.crawler_task(category_list=category_list, date_str=date_str)
|
|
|
|
-
|
|
|
|
task.publish_article_task(category_list=category_list, article_source=article_source)
|
|
task.publish_article_task(category_list=category_list, article_source=article_source)
|
|
|
|
|
|
|
|
+ if article_source == 'weixin':
|
|
|
|
+ task.crawler_task(category_list=category_list, date_str=date_str)
|
|
|
|
+
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
parser = ArgumentParser()
|
|
parser = ArgumentParser()
|
|
@@ -153,9 +132,6 @@ if __name__ == '__main__':
|
|
else:
|
|
else:
|
|
run_date = datetime.date.today().isoformat()
|
|
run_date = datetime.date.today().isoformat()
|
|
|
|
|
|
- # 执行微信抓取发布
|
|
|
|
- main(date_str=run_date)
|
|
|
|
-
|
|
|
|
# 执行头条发布
|
|
# 执行头条发布
|
|
main(
|
|
main(
|
|
date_str=run_date,
|
|
date_str=run_date,
|
|
@@ -163,4 +139,7 @@ if __name__ == '__main__':
|
|
article_source='toutiao'
|
|
article_source='toutiao'
|
|
)
|
|
)
|
|
|
|
|
|
|
|
+ # 执行微信抓取发布
|
|
|
|
+ main(date_str=run_date)
|
|
|
|
+
|
|
|
|
|