mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Update GoComics
This commit is contained in:
parent
75174f603a
commit
28848cf705
@ -10,6 +10,12 @@ from calibre.ptempfile import PersistentTemporaryDirectory
|
|||||||
from calibre.utils.filenames import ascii_filename
|
from calibre.utils.filenames import ascii_filename
|
||||||
|
|
||||||
|
|
||||||
|
def absolutize(url):
|
||||||
|
if url.startswith('/'):
|
||||||
|
url = 'http://www.gocomics.com' + url
|
||||||
|
return url
|
||||||
|
|
||||||
|
|
||||||
class GoComics(BasicNewsRecipe):
|
class GoComics(BasicNewsRecipe):
|
||||||
title = 'Go Comics'
|
title = 'Go Comics'
|
||||||
__author__ = 'Kovid Goyal'
|
__author__ = 'Kovid Goyal'
|
||||||
@ -572,6 +578,10 @@ class GoComics(BasicNewsRecipe):
|
|||||||
return {'title':'Page %d of %s' % ((num + 1), title), 'url': ('file:' if iswindows else 'file://') + path.replace(os.sep, '/')}
|
return {'title':'Page %d of %s' % ((num + 1), title), 'url': ('file:' if iswindows else 'file://') + path.replace(os.sep, '/')}
|
||||||
|
|
||||||
def make_links(self, title, url):
|
def make_links(self, title, url):
|
||||||
|
soup = self.index_to_soup(url)
|
||||||
|
div = soup.find(attrs={'class': lambda x: x and 'gc-deck' in x.split()})
|
||||||
|
a = div.find('a', href=True)
|
||||||
|
url = absolutize(a['href'])
|
||||||
current_articles = []
|
current_articles = []
|
||||||
if self.test:
|
if self.test:
|
||||||
self.num_comics_to_get = 2
|
self.num_comics_to_get = 2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user