Skip to content

Commit

Permalink
Merge branch 'master' into fix/262
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuukiy authored Aug 17, 2024
2 parents c40f716 + 70f155d commit 3711ff6
Show file tree
Hide file tree
Showing 22 changed files with 30 additions and 513 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/pyinstaller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ jobs:
- name: Build with PyInstaller for windows
run: cmd.exe /c 'make.bat'

- name: Install pytest
run: |
python -m pip install pytest
# - name: Install pytest
# run: |
# python -m pip install pytest

- name: Switch code page
run: |
chcp 65001
# - name: Switch code page
# run: |
# chcp 65001

- name: Test JavSP.exe
run: pytest unittest/test_exe.py
# - name: Test JavSP.exe
# run: pytest unittest/test_exe.py

- name: Set VERSION variable for windows
run: |
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test-web-funcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ jobs:
- name: Switch code page
run: |
chcp 65001
- name: Test proxyfree.py
run: |
pytest unittest/test_proxyfree.py
- name: Test web crawlers
run: |
pytest unittest/test_crawlers.py
Expand Down
10 changes: 1 addition & 9 deletions JavSP.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@


from core.print import TqdmOut
from core.baidu_aip import aip_crop_poster


# 将StreamHandler的stream修改为TqdmOut,以与Tqdm协同工作
Expand Down Expand Up @@ -440,21 +441,12 @@ def reviewMovieID(all_movies, root):
def crop_poster_wrapper(fanart_file, poster_file, method='normal', hard_sub=False, uncensored=False):
"""包装各种海报裁剪方法,提供统一的调用"""
if method == 'baidu':
from core.ai_crop.baidu_aip import aip_crop_poster
try:
aip_crop_poster(fanart_file, poster_file)
except Exception as e:
logger.debug('人脸识别失败,回退到常规裁剪方法')
logger.debug(e, exc_info=True)
crop_poster(fanart_file, poster_file)
elif method == 'retina':
from core.ai_crop.retina import ai_crop_poster
try:
ai_crop_poster(fanart_file, poster_file)
except Exception as e:
logger.debug('人脸识别失败,回退到常规裁剪方法')
logger.debug(e, exc_info=True)
crop_poster(fanart_file, poster_file)
else:
crop_poster(fanart_file, poster_file)
if cfg.Picture.add_label_to_cover:
Expand Down
25 changes: 0 additions & 25 deletions core/ai_crop/retina.py

This file was deleted.

File renamed without changes.
5 changes: 2 additions & 3 deletions core/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ retry = 3
timeout = 10

# 要使用的爬虫列表(汇总数据时从前到后进行)
# airav avsox avwiki fanza fc2 fc2fan javbus javdb javlib javmenu jav321 msin mgstage prestige
# airav avsox avwiki fanza fc2 fc2fan javbus javdb javlib javmenu jav321 mgstage prestige
[CrawlerSelect]
normal = airav,avsox,javbus,javdb,javlib,jav321,mgstage,prestige
fc2 = fc2,msin,avsox,javdb,javmenu
fc2 = fc2,avsox,javdb,javmenu
cid = fanza
getchu = dl_getchu
gyutto = gyutto
Expand Down Expand Up @@ -104,7 +104,6 @@ use_ai_crop = no
# 要使用图像识别来裁剪的番号系列($label), \d表示纯数字番号(FC2和识别到的无码影片会自动使用图像识别裁剪)
use_ai_crop_labels = \d,ARA,SIRO,GANA,MIUM
# 要使用的图像识别引擎,详细配置见文档 https://github.com/Yuukiy/JavSP/wiki/AI-%7C-%E4%BA%BA%E8%84%B8%E8%AF%86%E5%88%AB
# Can be either 'baidu' or 'retina'
ai_engine =
# 百度人体分析应用的AppID(仅在图像识别引擎为baidu时需要)
aip_appid =
Expand Down
2 changes: 0 additions & 2 deletions core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,6 @@ def validate_ai_config(cfg: Config):
empty_keys = [i for i in required_keys if not piccfg[i]]
if empty_keys:
logger.error('使用百度人体分析时,相关设置不能为空: ' + ', '.join(empty_keys))
elif piccfg.ai_engine.lower() == 'retina':
piccfg.ai_engine = 'retina'
else:
logger.error('不支持的图像识别引擎: ' + piccfg.ai_engine)

Expand Down
4 changes: 2 additions & 2 deletions requirements-linux.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
altgraph==0.17
baidu-aip==2.2.18.0
certifi==2023.7.22
certifi==2024.7.4
chardet==4.0.0
cloudscraper==1.2.71
colorama==0.4.4
Expand All @@ -14,7 +14,7 @@ pretty-errors==1.2.19
pycryptodome==3.19.1
PySocks==1.7.1
requests==2.31.0
tqdm==4.59.0
tqdm==4.66.3
urllib3==1.25.11
cryptography==42.0.4
retina-face==0.0.14
Expand Down
7 changes: 3 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
altgraph==0.17
baidu-aip==2.2.18.0
certifi==2023.7.22
certifi==2024.7.4
chardet==4.0.0
cloudscraper==1.2.71
colorama==0.4.4
Expand All @@ -14,9 +14,8 @@ pretty-errors==1.2.19
pycryptodome==3.19.1
PySocks==1.7.1
requests==2.31.0
tqdm==4.59.0
tqdm==4.66.3
urllib3==1.25.11
pywin32==303
pywin32-ctypes==0.2.0
retina-face==0.0.14
keras==2.15.0
cryptography==42.0.4
2 changes: 1 addition & 1 deletion unittest/data/62knbm009 (fanza).json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"6123"
],
"genre_norm": null,
"score": "4.00",
"score": "5.00",
"title": "同居する粘液 第1話日常の中の非日常",
"ori_title": null,
"magnet": null,
Expand Down
37 changes: 0 additions & 37 deletions unittest/data/FC2-1879420 (msin).json

This file was deleted.

26 changes: 0 additions & 26 deletions unittest/data/FC2-238629 (msin).json

This file was deleted.

30 changes: 0 additions & 30 deletions unittest/data/FC2-626157 (msin).json

This file was deleted.

41 changes: 0 additions & 41 deletions unittest/data/FC2-718323 (msin).json

This file was deleted.

41 changes: 0 additions & 41 deletions unittest/data/FC2-985469 (msin).json

This file was deleted.

Loading

0 comments on commit 3711ff6

Please sign in to comment.