mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix EPUB output of Speigel Online
This commit is contained in:
parent
923671d402
commit
5c5cc6d1a2
@ -8,7 +8,7 @@ Fetch Spiegel Online.
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
||||||
|
|
||||||
class SpeigelOnline(BasicNewsRecipe):
|
class SpeigelOnline(BasicNewsRecipe):
|
||||||
|
|
||||||
@ -36,3 +36,13 @@ class SpeigelOnline(BasicNewsRecipe):
|
|||||||
tokens = url.split(',')
|
tokens = url.split(',')
|
||||||
tokens[-2:-2] = ['druck|']
|
tokens[-2:-2] = ['druck|']
|
||||||
return ','.join(tokens).replace('|,','-')
|
return ','.join(tokens).replace('|,','-')
|
||||||
|
|
||||||
|
def postprocess_html(self, soup, first_fetch):
|
||||||
|
if soup.contents[0].name == 'head':
|
||||||
|
x = BeautifulSoup('<html></html>')
|
||||||
|
for y in reversed(soup.contents):
|
||||||
|
x.contents[0].insert(0, y)
|
||||||
|
soup = x
|
||||||
|
print 1111111
|
||||||
|
|
||||||
|
return soup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user