Skip to content

Commit

Permalink
fix: failed to get title list (wiki.eternal-twin.net)
Browse files Browse the repository at this point in the history
  • Loading branch information
yzqzss committed Dec 18, 2023
1 parent 5efe4a5 commit 3605cd1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dokuWikiDumper/dump/content/titles.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ def getTitles(url, ns=None, session: requests.Session=None, useOldMethod=None):
for a in soup.findAll('a', href=True):
if a.has_attr('title'):
title = a['title']
elif a.has_attr('data-wiki-id'):
# for https://wiki.eternal-twin.net/start?do=index
# (log: https://cdn.digitaldragon.dev/wikibot/jobs/4efda8bd-3bd2-4f59-81ef-8e37cf574431/log.txt)
title = a['data-wiki-id']
else:
query = urlparse.parse_qs(urlparse.urlparse(a['href']).query)
title = (query['idx' if 'idx' in query else 'id'])[0]
Expand Down

0 comments on commit 3605cd1

Please sign in to comment.