refactor: 调整item_report方法参数与调用逻辑,修正主流程数据获取方式并优化report_video初始化参数
This commit is contained in:
parent
fbbc1ec1bc
commit
a8e2ac1167
4
DB.py
4
DB.py
@ -270,9 +270,9 @@ class DBVidcon:
|
||||
return result['parameter'] if result else None
|
||||
|
||||
@redis_retry(max_retries=3)
|
||||
def item_report(self, count: int = 20):
|
||||
def item_report(self, count: int = 1):
|
||||
try:
|
||||
items = self.fetch_from_redis(count, list_key=self.l0_list_key)
|
||||
items = self.fetch_from_redis(count, list_key=self.report_list)
|
||||
except Exception as e:
|
||||
logger.info("[Redis l0 pop error]", e)
|
||||
self.reconnect_redis()
|
||||
|
@ -24,9 +24,10 @@ while True:
|
||||
# 处理主流程
|
||||
if now - last_main_run >= MAIN_INTERVAL:
|
||||
last_main_run = now
|
||||
lis = db.get_report_video()
|
||||
lis = db.item_report()
|
||||
if len(lis) > 0:
|
||||
for li in lis:
|
||||
for _,li in lis:
|
||||
print(li)
|
||||
logger.logger.info(f"name:{li['name_title']},link:{li['link']} ")
|
||||
try:
|
||||
info, report_id, status, report_ts = d.process_ticket(li['name_title'], li['link'])
|
||||
|
@ -92,7 +92,7 @@ class DailymotionClient:
|
||||
EMAIL = "copyright@qiyi.com"
|
||||
PASSWORD = "ppsIQIYI2018@"
|
||||
|
||||
def __init__(self, headless: bool = None):
|
||||
def __init__(self,email, password, headless: bool = None):
|
||||
self.email = self.EMAIL
|
||||
self.password = self.PASSWORD
|
||||
self.headless = headless
|
||||
|
Loading…
x
Reference in New Issue
Block a user