mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
fix fetching articles
This commit is contained in:
parent
9aa202d7bc
commit
ec5fea9c5e
@ -11,6 +11,7 @@ class tanuki(BasicNewsRecipe):
|
||||
language = 'pl'
|
||||
max_articles_per_feed = 100
|
||||
encoding = 'utf-8'
|
||||
autocleanup = True
|
||||
extra_css = 'ul {list-style: none; padding: 0; margin: 0;} .kadr{float: left;} .dwazdania {float: right;}'
|
||||
preprocess_regexps = [(re.compile(u'<h3><a class="screen".*?</h3>', re.DOTALL), lambda match: ''), (re.compile(
|
||||
unicode(r'<div><a href="/strony/((manga)|(anime))/[0-9]+?/oceny(\-redakcji){0,1}">Zobacz jak ocenili</a></div>'), re.DOTALL), lambda match: '')]
|
||||
@ -42,15 +43,3 @@ class tanuki(BasicNewsRecipe):
|
||||
appendtag.insert(pos, pagetext)
|
||||
for r in appendtag.findAll(attrs={'class': 'nextarrow'}):
|
||||
r.extract()
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
self.append_page(soup, soup.body)
|
||||
for a in soup('a'):
|
||||
if a.has_key('href') and 'http://' not in a['href'] and 'https://' not in a['href']: # noqa
|
||||
if 'tanuki-anime' in soup.title.string.lower():
|
||||
a['href'] = 'http://anime.tanuki.pl' + a['href']
|
||||
elif 'tanuki-manga' in soup.title.string.lower():
|
||||
a['href'] = 'http://manga.tanuki.pl' + a['href']
|
||||
elif 'tanuki-czytelnia' in soup.title.string.lower():
|
||||
a['href'] = 'http://czytelnia.tanuki.pl' + a['href']
|
||||
return soup
|
||||
|
Loading…
x
Reference in New Issue
Block a user