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
09fd203e87
commit
29f02c9f82
@ -556,8 +556,10 @@ class GoComics(BasicNewsRecipe):
|
|||||||
if img is None:
|
if img is None:
|
||||||
raise StopIteration()
|
raise StopIteration()
|
||||||
img['srcset'] = ''
|
img['srcset'] = ''
|
||||||
date = content.find('date')
|
a = content.find('a', title=True)
|
||||||
return {'h1':content.find('h1'), 'date':self.tag_to_string(date), 'img':str(img)}
|
title_parts = a['title'].split()
|
||||||
|
title = ' '.join(title_parts[:-2])
|
||||||
|
return {'h1':title, 'date':title_parts[-1], 'img':str(img)}
|
||||||
|
|
||||||
def render_comic_page(self, data, num, title):
|
def render_comic_page(self, data, num, title):
|
||||||
fname = ascii_filename('%03d_%s' % (num, title)).replace(' ', '_')
|
fname = ascii_filename('%03d_%s' % (num, title)).replace(' ', '_')
|
||||||
@ -577,11 +579,11 @@ class GoComics(BasicNewsRecipe):
|
|||||||
page_soup = self.index_to_soup(url)
|
page_soup = self.index_to_soup(url)
|
||||||
if not page_soup:
|
if not page_soup:
|
||||||
break
|
break
|
||||||
content = page_soup.find(attrs={'class':'layout-1col'})
|
content = page_soup.find(attrs={'class':'item-comic-container'})
|
||||||
if content is None:
|
if content is None:
|
||||||
break
|
break
|
||||||
current_articles.append(self.parse_comic_page(content))
|
current_articles.append(self.parse_comic_page(content))
|
||||||
a = content.find('a', attrs={'href':True, 'class':lambda x: x and 'fa-caret-left' in x.split()})
|
a = content.parent.find('a', attrs={'href':True, 'class':lambda x: x and 'fa-caret-left' in x.split()})
|
||||||
if a is None:
|
if a is None:
|
||||||
break
|
break
|
||||||
url = a['href']
|
url = a['href']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user