Update Asian review of Books

Fixes #1695655 [news download asian review of books](https://bugs.launchpad.net/calibre/+bug/1695655)
This commit is contained in:
Kovid Goyal 2017-08-21 00:38:08 +05:30
parent e25426ad5a
commit 808e1351ea
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1,8 +1,11 @@
#!/usr/bin/env python2
# -*- mode: python -*-
# -*- coding: utf-8 -*-
__license__ = 'GPL v3' __license__ = 'GPL v3'
__copyright__ = '2012, Darko Miletic <darko.miletic at gmail.com>' __copyright__ = '2012-2017, Darko Miletic <darko.miletic at gmail.com>'
''' '''
www.asianreviewofbooks.com asianreviewofbooks.com
''' '''
from calibre.web.feeds.news import BasicNewsRecipe from calibre.web.feeds.news import BasicNewsRecipe
@ -18,30 +21,22 @@ class AsianReviewOfBooks(BasicNewsRecipe):
max_articles_per_feed = 100 max_articles_per_feed = 100
no_stylesheets = True no_stylesheets = True
use_embedded_content = False use_embedded_content = False
encoding = 'cp1252' encoding = 'utf8'
language = 'en_CN' language = 'en_CN'
publication_type = 'magazine' publication_type = 'magazine'
masthead_url = 'http://www.asianreviewofbooks.com/new/images/mob_arb.png' auto_cleanup = True
masthead_url = 'https://i2.wp.com/asianreviewofbooks.com/content/wp-content/uploads/2016/09/ARBwidelogo.png'
extra_css = """ extra_css = """
body{font-family: serif} body{font-family: "Droid Serif", serif}
.big {font-size: xx-large} .entry-title {font-family: "Playfair Display", serif}
.bold {font-weight: bold}
.italic {font-style: italic}
.small {font-size: small}
img {display: block} img {display: block}
""" """
conversion_options = { conversion_options = {
'comment': description, 'tags': category, 'publisher': publisher, 'language': language 'comment': description,
'tags': category,
'publisher': publisher,
'language': language
} }
remove_tags = [dict(name=['object', 'script', 'iframe', 'embed'])] feeds = [(u'Articles', u'http://asianreviewofbooks.com/content/feed/')]
remove_attributes = ['style', 'onclick']
feeds = [(u'Articles', u'http://www.asianreviewofbooks.com/new/rss.php')]
def print_version(self, url):
root, sep, artid = url.rpartition('?ID=')
return root + 'getarticle.php?articleID=' + artid + '&stats=web'
def preprocess_raw_html(self, raw, url):
return '<html><head><title>title</title></head><body>' + raw + '</body></html>'