增加多关键词的循环,和指定机器号
This commit is contained in:
parent
58aac99a1c
commit
2fbb358c24
26
oneget.py
26
oneget.py
@ -1,3 +1,4 @@
|
|||||||
|
import argparse
|
||||||
import base64
|
import base64
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import concurrent.futures
|
import concurrent.futures
|
||||||
@ -226,6 +227,25 @@ class DMVideoInfo:
|
|||||||
print(f"[ERROR] 请求失败 vxid={v_xid} : {e}")
|
print(f"[ERROR] 请求失败 vxid={v_xid} : {e}")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def parse_args() -> argparse.Namespace:
|
||||||
|
global MACHINE_ID
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
description="Configure worker settings."
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"-m", "--machine-id",
|
||||||
|
type=int,
|
||||||
|
help=f"Machine identifier (default: {MACHINE_ID})"
|
||||||
|
)
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if args.machine_id is not None:
|
||||||
|
MACHINE_ID = args.machine_id
|
||||||
|
|
||||||
|
if MACHINE_ID is None:
|
||||||
|
raise ValueError("请指定机器编号")
|
||||||
|
return args
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
kwdata = db.get_web_items()
|
kwdata = db.get_web_items()
|
||||||
@ -641,7 +661,11 @@ def main():
|
|||||||
executor.map(dmvideo_info.get_video_info, tancks)
|
executor.map(dmvideo_info.get_video_info, tancks)
|
||||||
if edges_len < 20:
|
if edges_len < 20:
|
||||||
break
|
break
|
||||||
|
def run():
|
||||||
|
parse_args()
|
||||||
|
while True:
|
||||||
|
main()
|
||||||
|
time.sleep(60)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
Loading…
x
Reference in New Issue
Block a user