Skip to content

Commit

Permalink
fixed some minor bugs (#486)
Browse files Browse the repository at this point in the history
* fix ai crop match logic

* bring back manual scrape after refactoring

* fix plot scrape in prestige

* fix config validation
  • Loading branch information
cyrahs authored Dec 19, 2024
1 parent 80904a0 commit 12b4eb8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ scanner:
# 格式要求:https://docs.pydantic.dev/2.0/usage/types/bytesize/
minimum_size: 232MiB
skip_nfo_dir: yes
manual: yes
################################
network:
# 设置代理服务器地址,支持 http, socks5/socks5h 代理,比如'http://127.0.0.1:1080'
Expand Down
6 changes: 4 additions & 2 deletions javsp/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,8 @@ def reviewMovieID(all_movies, root):
def process_poster(movie: Movie):
def should_use_ai_crop_match(label):
for r in Cfg().summarizer.cover.crop.on_id_pattern:
re.match(r, label)
return True
if re.match(r, label):
return True
return False
crop_engine = None
if (movie.info.uncensored or
Expand Down Expand Up @@ -615,6 +615,8 @@ def entry():
recognize_fail = []
error_exit(movie_count, '未找到影片文件')
logger.info(f'扫描影片文件:共找到 {movie_count} 部影片')
if Cfg().scanner.manual:
reviewMovieID(recognized, root)
RunNormalMode(recognized + recognize_fail)

sys.exit(0)
Expand Down
1 change: 1 addition & 0 deletions javsp/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Scanner(BaseConfig):
ignored_folder_name_pattern: List[str]
minimum_size: ByteSize
skip_nfo_dir: bool
manual: bool

class CrawlerID(str, Enum):
airav = 'airav'
Expand Down
2 changes: 1 addition & 1 deletion javsp/web/prestige.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def parse_data(movie: MovieInfo):
genre_tags = container.xpath("//p[text()='ジャンル:']/following-sibling::div/a")
genre = [tag.text.strip() for tag in genre_tags]
serial = container.xpath("//p[text()='レーベル:']/following-sibling::div/a/text()")[0].strip()
plot = container.xpath("//h2[text()='商品紹介']/following-sibling::p")[0].text.strip()
plot = container.xpath("//h2[text()='商品紹介']/following-sibling::div/p")[0].text.strip()
preview_pics = container.xpath("//h2[text()='サンプル画像']/following-sibling::div/div/picture/source/img/@src")
preview_pics = [i.split('?')[0] for i in preview_pics]

Expand Down

0 comments on commit 12b4eb8

Please sign in to comment.