Skip to content

Commit 12b4eb8

Browse files
authored
fixed some minor bugs (#486)
* fix ai crop match logic * bring back manual scrape after refactoring * fix plot scrape in prestige * fix config validation
1 parent 80904a0 commit 12b4eb8

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ scanner:
2020
# 格式要求:https://docs.pydantic.dev/2.0/usage/types/bytesize/
2121
minimum_size: 232MiB
2222
skip_nfo_dir: yes
23+
manual: yes
2324
################################
2425
network:
2526
# 设置代理服务器地址,支持 http, socks5/socks5h 代理,比如'http://127.0.0.1:1080'

javsp/__main__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ def reviewMovieID(all_movies, root):
402402
def process_poster(movie: Movie):
403403
def should_use_ai_crop_match(label):
404404
for r in Cfg().summarizer.cover.crop.on_id_pattern:
405-
re.match(r, label)
406-
return True
405+
if re.match(r, label):
406+
return True
407407
return False
408408
crop_engine = None
409409
if (movie.info.uncensored or
@@ -615,6 +615,8 @@ def entry():
615615
recognize_fail = []
616616
error_exit(movie_count, '未找到影片文件')
617617
logger.info(f'扫描影片文件:共找到 {movie_count} 部影片')
618+
if Cfg().scanner.manual:
619+
reviewMovieID(recognized, root)
618620
RunNormalMode(recognized + recognize_fail)
619621

620622
sys.exit(0)

javsp/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class Scanner(BaseConfig):
1616
ignored_folder_name_pattern: List[str]
1717
minimum_size: ByteSize
1818
skip_nfo_dir: bool
19+
manual: bool
1920

2021
class CrawlerID(str, Enum):
2122
airav = 'airav'

javsp/web/prestige.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def parse_data(movie: MovieInfo):
5151
genre_tags = container.xpath("//p[text()='ジャンル:']/following-sibling::div/a")
5252
genre = [tag.text.strip() for tag in genre_tags]
5353
serial = container.xpath("//p[text()='レーベル:']/following-sibling::div/a/text()")[0].strip()
54-
plot = container.xpath("//h2[text()='商品紹介']/following-sibling::p")[0].text.strip()
54+
plot = container.xpath("//h2[text()='商品紹介']/following-sibling::div/p")[0].text.strip()
5555
preview_pics = container.xpath("//h2[text()='サンプル画像']/following-sibling::div/div/picture/source/img/@src")
5656
preview_pics = [i.split('?')[0] for i in preview_pics]
5757

0 commit comments

Comments
 (0)