Skip to content

Commit

Permalink
Fix Yuukiy#110: 支持设置刮削完一部影片后的等待时间
Browse files Browse the repository at this point in the history
Co-authored-by: Yuukiy <[email protected]>
  • Loading branch information
todoXu and Yuukiy committed Dec 20, 2023
1 parent 111efc1 commit 2c43041
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions JavSP.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,10 @@ def check_step(result, msg='步骤错误'):
check_step(True)

logger.info(f'整理完成,相关文件已保存到: {movie.save_dir}\n')

if movie != all_movies[-1] and cfg.Crawler.sleep_after_scraping > 0:
time.sleep(cfg.Crawler.sleep_after_scraping)

except Exception as e:
logger.debug(e, exc_info=True)
logger.error(f'整理失败: {e}')
Expand Down
2 changes: 2 additions & 0 deletions core/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ fc2fan_local_path =
title__remove_actor = yes
# 标题处理:优先使用中文标题(如果能获取到的话)
title__chinese_first = yes
# 刮削一部电影后的等待时间(秒,设置为0禁用此功能)
sleep_after_scraping = 1


# 各个站点的免代理地址。地址失效时软件会自动尝试获取新地址,你也可以手动设置
Expand Down
1 change: 1 addition & 0 deletions core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ def norm_int(cfg: Config):
cfg.NamingRule.max_path_len = min(cfg.getint('NamingRule', 'max_path_len'), 256)
cfg.NamingRule.max_actress_count = max(cfg.getint('NamingRule', 'max_actress_count'), 1)
cfg.File.ignore_video_file_less_than = int(cfg.getfloat('File', 'ignore_video_file_less_than') * 2**20)
cfg.Crawler.sleep_after_scraping = max(cfg.getint('Crawler', 'sleep_after_scraping'), 0)


def norm_tuples(cfg: Config):
Expand Down

0 comments on commit 2c43041

Please sign in to comment.