Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

重新修复wiki字段 #260

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/models/tools/emby_actor_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def _get_wiki_detail(url, url_log, actor_info: EMbyActressInfo):
signal.show_log_text(" 🔴 页面内容未命中关键词,识别为非女优或导演!")
return False

res = re.sub(r'\[\d+\]', '', res) # 替换[1],[2]等注释
res = re.sub(r'<a href=\"#cite_note.*?</a>', '', res) # 替换[1],[2]等注释
soup = bs4.BeautifulSoup(res, 'lxml')
actor_output = soup.find(class_='mw-parser-output')

Expand All @@ -309,7 +309,7 @@ def _get_wiki_detail(url, url_log, actor_info: EMbyActressInfo):
actor_profile = actor_output.find(name='table', class_=['infobox', 'infobox vcard plainlist'])
if actor_profile:
att_keys = actor_profile.find_all(scope=["row"])
att_values = actor_profile.find_all(name='td', style=[''], class_=['infobox-data', 'infobox-data org'])
att_values = actor_profile.find_all(name='td', style=[''], colspan=False)
bday = actor_output.find(class_='bday')
bday = '(%s)' % bday.get_text('', strip=True) if bday else ''
if att_keys and att_values:
Expand Down