Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 09-25-2014, 04:00 AM   #1
timoy_kindle
Junior Member
timoy_kindle began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Aug 2013
Device: kindle paperwhite
build-in scmp recipe didn't download images

i am a subscriber of this scmp and i am using this recipe to get the news.

however, i didn't get any images.

can advise on this?

and why i always get 20 news per each category?

thanks!

__license__ = 'GPL v3'
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
'''
scmp.com
'''

from calibre.web.feeds.news import BasicNewsRecipe

class SCMP(BasicNewsRecipe):
title = 'South China Morning Post'
__author__ = 'llam'
description = "SCMP.com, Hong Kong's premier online English daily provides exclusive up-to-date news, audio video news, podcasts, RSS Feeds, Blogs, breaking news, top stories, award winning news and analysis on Hong Kong and China."
publisher = 'South China Morning Post Publishers Ltd.'
category = 'SCMP, Online news, Hong Kong News, China news, Business news, English newspaper, daily newspaper, Lifestyle news, Sport news, Audio Video news, Asia news, World news, economy news, investor relations news, RSS Feeds'
oldest_article = 2
delay = 1
max_articles_per_feed = 200
no_stylesheets = True
encoding = 'utf-8'
auto_cleanup = True
use_embedded_content = False
language = 'en_CN'
remove_empty_feeds = True
needs_subscription = 'optional'
publication_type = 'newspaper'
masthead_url = 'http://www.scmp.com/images/logo_scmp_home.gif'
extra_css = ' body{font-family: Arial,Helvetica,sans-serif } '

conversion_options = {
'comment' : description
, 'tags' : category
, 'publisher' : publisher
, 'language' : language
}

def get_browser(self):
br = BasicNewsRecipe.get_browser(self)
#br.set_debug_http(True)
#br.set_debug_responses(True)
#br.set_debug_redirects(True)
if self.username is not None and self.password is not None:
br.open('https://www.scmp.com/user/login')
br.select_form(nr=0)
br['name'] = self.username
br['pass'] = self.password
br.submit()
return br

#remove_attributes=['width','height','border']

#keep_only_tags = [
#dict(attrs={'id':['ART','photoBox']})
#,dict(attrs={'class':['article_label','article_byline','article_body']})
#]

#preprocess_regexps = [
#(re.compile(r'<P><table((?!<table).)*class="embsc reen"((?!</table>).)*</table>', re.DOTALL|re.IGNORECASE),
#lambda match: ''),
#]

feeds = [
(u'Business' , u'http://www.scmp.com/rss/business.xml' )
,(u'Hong Kong' , u'http://www.scmp.com/rss/hong_kong.xml' )
,(u'China' , u'http://www.scmp.com/rss/china.xml' )
,(u'Asia & World' , u'http://www.scmp.com/rss/news_asia_world.xml')
,(u'Opinion' , u'http://www.scmp.com/rss/opinion.xml' )
,(u'LifeSTYLE' , u'http://www.scmp.com/rss/lifestyle.xml' )
,(u'Sport' , u'http://www.scmp.com/rss/sport.xml' )
]

#def print_version(self, url):
#rpart, sep, rest = url.rpartition('&')
#return rpart #+ sep + urllib.quote_plus(rest)

#def preprocess_html(self, soup):
#for item in soup.findAll(style=True):
#del item['style']
#items = soup.findAll(src="/images/label_icon.gif")
#[item.extract() for item in items]
#return self.adeify_images(soup)
timoy_kindle is offline   Reply With Quote
Old 09-27-2014, 07:40 AM   #2
Krittika Goyal
Vox calibre
Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.
 
Krittika Goyal's Avatar
 
Posts: 412
Karma: 1175230
Join Date: Jan 2009
Device: Sony reader prs700, kobo
I will be happy to help if you give me login details. You can pm them to me and change them to dummy values. If you don't want to do that try using auto_cleanup_keep code mentioned in http://blog.calibre-ebook.com/2011/1...-fetching.html to fix it yourself.
Krittika Goyal is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Newspaper download didn't happen yet Martyd Amazon Kindle 4 10-28-2012 09:48 PM
how to build toc when chapter headers are just images cybmole Sigil 17 04-02-2012 05:03 AM
South China Morning Post (SCMP) - Hong Kong - Fixed llam Recipes 0 07-02-2011 10:48 PM
Recipe produces no Images - Please help. Onecanuck Recipes 6 12-16-2010 08:29 PM
Images don't show up after build angbrown Kindle Formats 3 09-25-2009 09:06 AM


All times are GMT -4. The time now is 12:29 PM.


MobileRead.com is a privately owned, operated and funded community.