Skip to content

Commit

Permalink
avsox: 改用/tw/的搜索接口以解决特定影片在/cn/下无法搜索的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuukiy committed Sep 21, 2024
1 parent 80b6aaf commit 66a2914
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions web/avsox.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ def parse_data(movie: MovieInfo):
full_id = movie.dvdid
if full_id.startswith('FC2-'):
full_id = full_id.replace('FC2-', 'FC2-PPV-')
html = get_html(f'{base_url}/cn/search/{full_id}')
html = get_html(f'{base_url}/tw/search/{full_id}')
ids = html.xpath("//div[@class='photo-info']/span/date[1]/text()")
urls = html.xpath("//a[contains(@class, 'movie-box')]/@href")
ids_lower = list(map(str.lower, ids))
if full_id.lower() in ids_lower:
url = urls[ids_lower.index(full_id.lower())]
url = url.replace('/tw/', '/cn/', 1)
else:
raise MovieNotFoundError(__name__, movie.dvdid, ids)

Expand Down Expand Up @@ -69,7 +70,7 @@ def parse_data(movie: MovieInfo):
pretty_errors.configure(display_link=True)
logger.root.handlers[1].level = logging.DEBUG

movie = MovieInfo('FC2-718323')
movie = MovieInfo('082713-417')
try:
parse_data(movie)
print(movie)
Expand Down

0 comments on commit 66a2914

Please sign in to comment.