Skip to content

Commit

Permalink
fetch douban editions after fetching work
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name authored and alphatownsman committed Jul 27, 2024
1 parent a96cd77 commit fc193ed
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion catalog/sites/douban_book.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,15 @@ def scrape(self):
if not title:
raise ParseError(self, "title")
book_urls = content.xpath('//a[@class="pl2"]/@href')
related_resources = []
for url in book_urls:
site = SiteManager.get_site_by_url(url)
if site:
related_resources.append({"url": url})
d = {
"title": title,
"localized_title": [{"lang": "zh-cn", "text": title}],
"edition_urls": book_urls,
"related_resources": related_resources,
}
pd = ResourceContent(metadata=d)
return pd

0 comments on commit fc193ed

Please sign in to comment.