modify scripts

This commit is contained in:
oscarz
2025-04-26 17:54:43 +08:00
parent a7b04ad56d
commit 6d9d4df0a8

View File

@ -3,6 +3,7 @@ import json
import time
import csv
import argparse
import textwrap
import logging
from functools import partial
import config
@ -440,7 +441,21 @@ if __name__ == "__main__":
# 命令行参数处理
keys_str = ",".join(function_map.keys())
parser = argparse.ArgumentParser(description='fetch javdb data.')
usage_examples = textwrap.dedent('''
示例用法:
python3 ./fetch # 遍历新增的所有记录
python3 ./fetch --scan_mode=0 # 遍历新增的 uncensored 记录(无码片)
python3 ./fetch --scan_mode=1 # 遍历新增的 非uncensored 记录(有码片)
python3 ./fetch --update=4 # 遍历全量的记录
python3 ./fetch --update=4 --scan_mode=0 # 遍历全量的 uncensored 记录(无码片)
python3 ./fetch --update=4 --scan_mode=1 # 遍历全量的 非uncensored 记录(有码片)
''')
parser = argparse.ArgumentParser(
description='fetch javdb data.\n\n' + usage_examples,
formatter_class=argparse.RawDescriptionHelpFormatter
)
#parser = argparse.ArgumentParser(description='fetch javdb data.')
parser.add_argument("--cmd", type=str, help=f"Comma-separated list of function shortcuts: {keys_str}")
parser.add_argument('--update', type=int, choices=[0, 1, 2, 3, 4], default=0, help='0-只遍历is_full_data=0(默认), 1-只遍历is_full_data=1, 2-遍历is_full_data<=1, 3-只遍历is_full_data>1(异常数据), 4-遍历所有')
parser.add_argument('--scan_mode', type=int, choices=[0, 1, 2], default=2, help='0-只遍历所有 uncensored 的 makers/series/actors/movies, 1-与前者相反, 2-全量(默认)')
@ -449,14 +464,4 @@ if __name__ == "__main__":
args = parser.parse_args()
set_env(args)
main(args.cmd, args)
'''
python3 ./fetch # 遍历新增的所有记录
python3 ./fetch --scan_mode=0 # 遍历新增的 uncensored 记录(无码片)
python3 ./fetch --scan_mode=1 # 遍历新增的 非uncensored 记录(有码片)
python3 ./fetch --update=4 # 遍历全量的记录
python3 ./fetch --update=4 --scan_mode=0 # 遍历全量的 uncensored 记录(无码片)
python3 ./fetch --update=4 --scan_mode=1 # 遍历全量的 非uncensored 记录(有码片)
'''
main(args.cmd, args)