mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-10-31 10:37:00 -04:00 
			
		
		
		
	ifzm by rty. Fixes #6043 (Wrong Chinese Category in News)
This commit is contained in:
		
							parent
							
								
									3a16d7770a
								
							
						
					
					
						commit
						e05dedfa0f
					
				| @ -7,7 +7,7 @@ class AdvancedUserRecipe1277228948(BasicNewsRecipe): | ||||
| 
 | ||||
|     __author__            = 'rty' | ||||
|     __version__            = '1.0' | ||||
|     language = 'zh_CN' | ||||
|     language = 'zh' | ||||
|     pubisher  = 'www.chinapressusa.com' | ||||
|     description           = 'Overseas Chinese Network Newspaper in the USA' | ||||
|     category              = 'News in Chinese, USA' | ||||
|  | ||||
							
								
								
									
										50
									
								
								resources/recipes/ifzm.recipe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								resources/recipes/ifzm.recipe
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,50 @@ | ||||
| from calibre.web.feeds.news import BasicNewsRecipe | ||||
| 
 | ||||
| class AdvancedUserRecipe1277305250(BasicNewsRecipe): | ||||
|     title          = u'infzm - China Southern Weekly' | ||||
|     oldest_article = 14 | ||||
|     max_articles_per_feed = 100 | ||||
| 
 | ||||
|     feeds          = [(u'\u5357\u65b9\u5468\u672b-\u70ed\u70b9\u65b0\u95fb', u'http://www.infzm.com/rss/home/rss2.0.xml'), | ||||
| 	(u'\u5357\u65b9\u5468\u672b-\u7ecf\u6d4e\u65b0\u95fb', u'http://www.infzm.com/rss/economic.xml'), | ||||
| 	(u'\u5357\u65b9\u5468\u672b-\u6587\u5316\u65b0\u95fb', u'http://www.infzm.com/rss/culture.xml'), | ||||
| 	(u'\u5357\u65b9\u5468\u672b-\u751f\u6d3b\u65f6\u5c1a', u'http://www.infzm.com/rss/lifestyle.xml'), | ||||
| 	(u'\u5357\u65b9\u5468\u672b-\u89c2\u70b9', u'http://www.infzm.com/rss/opinion.xml') | ||||
| 	] | ||||
|     __author__            = 'rty' | ||||
|     __version__            = '1.0' | ||||
|     language = 'zh' | ||||
|     pubisher  = 'http://www.infzm.com' | ||||
|     description           = 'Chinese Weekly Tabloid' | ||||
|     category              = 'News, China' | ||||
|     remove_javascript = True | ||||
|     use_embedded_content   = False | ||||
|     no_stylesheets = True | ||||
|     #encoding               = 'GB2312' | ||||
|     encoding               = 'UTF-8' | ||||
|     conversion_options = {'linearize_tables':True} | ||||
|     masthead_url = 'http://i50.tinypic.com/2qmfb7l.jpg' | ||||
| 
 | ||||
|     extra_css = ''' | ||||
|              @font-face { font-family: "DroidFont", serif, sans-serif;  src: url(res:///system/fonts/DroidSansFallback.ttf); }\n | ||||
|              body { | ||||
|                   margin-right: 8pt; | ||||
|                   font-family: 'DroidFont', serif;} | ||||
|              .detailContent {font-family: 'DroidFont', serif, sans-serif} | ||||
|             ''' | ||||
| 
 | ||||
|     keep_only_tags = [ | ||||
|                               dict(name='div', attrs={'id':'detailContent'}), | ||||
|                                ] | ||||
|     remove_tags = [ | ||||
|                     dict(name='div', attrs={'id':['detailTools', 'detailSideL', 'pageNum']}), | ||||
|                          ] | ||||
|     remove_tags_after = [ | ||||
|                   dict(name='div', attrs={'id':'pageNum'}), | ||||
|                          ] | ||||
|     def preprocess_html(self, soup): | ||||
|         for item in soup.findAll(color=True): | ||||
|             del item['font'] | ||||
|         for item in soup.findAll(style=True): | ||||
|             del item['style'] | ||||
|         return soup | ||||
| @ -20,7 +20,7 @@ from calibre.utils.config import config_dir | ||||
| from calibre.utils.date import isoformat, now, parse_date | ||||
| from calibre.utils.localization import get_lang | ||||
| from calibre.utils.logging import Log | ||||
| from calibre.utils.zipfile import ZipFile, safe_replace | ||||
| from calibre.utils.zipfile import ZipFile | ||||
| 
 | ||||
| from PIL import Image as PILImage | ||||
| 
 | ||||
| @ -1727,7 +1727,6 @@ class ITUNES(DriverBase): | ||||
|             return thumb_data | ||||
| 
 | ||||
|         thumb_path = book_path.rpartition('.')[0] + '.jpg' | ||||
|         format = book_path.rpartition('.')[2].lower() | ||||
|         if isosx: | ||||
|             title = book.name() | ||||
|         elif iswindows: | ||||
|  | ||||
							
								
								
									
										15
									
								
								src/calibre/ebooks/metadata/covers.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								src/calibre/ebooks/metadata/covers.py
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,15 @@ | ||||
| #!/usr/bin/env python | ||||
| # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai | ||||
| 
 | ||||
| __license__   = 'GPL v3' | ||||
| __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>' | ||||
| __docformat__ = 'restructuredtext en' | ||||
| 
 | ||||
| 
 | ||||
| from calibre.customize import Plugin | ||||
| 
 | ||||
| class CoverDownload(Plugin): | ||||
| 
 | ||||
|     supported_platforms = ['windows', 'osx', 'linux'] | ||||
|     author = 'Kovid Goyal' | ||||
|     type = _('Cover download') | ||||
| @ -8,7 +8,7 @@ import copy | ||||
| 
 | ||||
| from lxml import html, etree | ||||
| from lxml.html.builder import HTML, HEAD, TITLE, STYLE, DIV, BODY, \ | ||||
|         STRONG, EM, BR, SPAN, A, HR, UL, LI, H2, H3, IMG, P as PT, \ | ||||
|         STRONG, BR, SPAN, A, HR, UL, LI, H2, H3, IMG, P as PT, \ | ||||
|         TABLE, TD, TR | ||||
| 
 | ||||
| from calibre import preferred_encoding, strftime, isbytestring | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user