mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Go Comics
This commit is contained in:
parent
4d0adb94b3
commit
e2b64d42ab
@ -20,6 +20,16 @@ class GoComics(BasicNewsRecipe):
|
||||
simultaneous_downloads = 1
|
||||
|
||||
recipe_specific_options = {
|
||||
'coverurl': {
|
||||
'short': 'Cover URL',
|
||||
'long': 'URL of an image to be used as book cover',
|
||||
'default': 'https://upload.wikimedia.org/wikipedia/commons/thumb/7/78/GoComics_logo.jpg/960px-GoComics_logo.jpg'
|
||||
},
|
||||
'mastheadurl': {
|
||||
'short': 'Masthead URL',
|
||||
'long': 'URL of an image to be used as masthead',
|
||||
'default': 'https://upload.wikimedia.org/wikipedia/commons/thumb/7/78/GoComics_logo.jpg/960px-GoComics_logo.jpg'
|
||||
},
|
||||
'comics': {
|
||||
'short': 'enter the slugs of the url\nof the comics you want seperated by a space',
|
||||
'long': 'calvinandhobbes garfield animalcrackers the-born-loser ... ...',
|
||||
@ -48,6 +58,12 @@ class GoComics(BasicNewsRecipe):
|
||||
if r and isinstance(r, str):
|
||||
if r.lower().strip() == 'yes':
|
||||
self.reverse_article_order = True
|
||||
r = self.recipe_specific_options.get('coverurl')
|
||||
if r and isinstance(r, str):
|
||||
self.cover_url=r
|
||||
r = self.recipe_specific_options.get('mastheadurl')
|
||||
if r and isinstance(r, str):
|
||||
self.masthead_url=r
|
||||
|
||||
def parse_index(self):
|
||||
d = self.recipe_specific_options.get('days')
|
||||
@ -86,7 +102,7 @@ class GoComics(BasicNewsRecipe):
|
||||
soup = BeautifulSoup(raw)
|
||||
div = soup.find(
|
||||
attrs={
|
||||
'class': lambda x: x and x.startswith('ComicViewer_comicViewer__comic__')
|
||||
'class': lambda x: x and x.startswith('ShowComicViewer_showComicViewer__comic')
|
||||
}
|
||||
)
|
||||
script = div.find('script', attrs={'type': 'application/ld+json'})
|
||||
|
Loading…
x
Reference in New Issue
Block a user