1
0
Fork 0
mirror of https://github.com/kemayo/leech synced 2025-12-06 16:33:16 +01:00

Royalroad's markup has changed slightly, fix so title and summary work

This commit is contained in:
David Lynch 2023-03-17 16:06:52 -05:00
parent b8314341b2
commit fe5ca86d87

View file

@ -43,11 +43,11 @@ class RoyalRoad(Site):
http.client._MAXHEADERS = 1000 http.client._MAXHEADERS = 1000
story = Section( story = Section(
title=soup.find('h1', property='name').string.strip(), title=soup.find('h1').string.strip(),
author=soup.find('meta', property='books:author').get('content').strip(), author=soup.find('meta', property='books:author').get('content').strip(),
url=soup.find('meta', property='og:url').get('content').strip(), url=soup.find('meta', property='og:url').get('content').strip(),
cover_url=self._join_url(base, soup.find('img', class_='thumbnail')['src']), cover_url=self._join_url(base, soup.find('img', class_='thumbnail')['src']),
summary=str(soup.find('div', property='description')).strip(), summary=str(soup.find('div', class_='description')).strip(),
tags=[tag.get_text().strip() for tag in soup.select('span.tags a.fiction-tag')] tags=[tag.get_text().strip() for tag in soup.select('span.tags a.fiction-tag')]
) )