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 12-21-2022, 03:31 AM   #1
rasteps
Zealot
rasteps began at the beginning.
 
Posts: 119
Karma: 10
Join Date: Sep 2010
Device: Kindle, Android phone
NHK News in Japanese recipe inconsistent

There are very few recipes in Japanese so I wrote a recipe which scrapes the NHK news site. But it sometimes downloads and sometimes hang and I'm not sure why it's so inconsistent. Does anyone have any advice?



Code:
from calibre.web.feeds.news import BasicNewsRecipe


class ReutersJa(BasicNewsRecipe):

# feed source: https://www.nhk.or.jp/toppage/rss/index.html

    title = 'NHK News'
    description = 'NHK News in Japanese'
    __author__ = 'Richard A. Steps'
    use_embedded_content = False
    language = 'ja'
    max_articles_per_feed = 30
    remove_javascript = True
    auto_cleanup = True

    feeds = [(
        '主要ニュース', 'https://www.nhk.or.jp/rss/news/cat0.xml?format=xml'),
         ('社会', 'https://www.nhk.or.jp/rss/news/cat1.xml?format=xml'),
         ('科学・医療', 'https://www.nhk.or.jp/rss/news/cat3.xml?format=xml'),
         ('政治', 'https://www.nhk.or.jp/rss/news/cat4.xml?format=xml'),
         ('経済', 'https://www.nhk.or.jp/rss/news/cat5.xml?format=xml'),
         ('国際', 'https://www.nhk.or.jp/rss/news/cat6.xml?format=xml'),
         ('スポーツ', 'https://www.nhk.or.jp/rss/news/cat7.xml?format=xml'),
         ('文化・エンタメ', 'https://www.nhk.or.jp/rss/news/cat2.xml?format=xml')
    ]

Last edited by rasteps; 01-01-2023 at 09:07 PM.
rasteps is offline   Reply With Quote
Old 12-21-2022, 06:22 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Post the log when it hangs, it will most likely be some anti bot tech on the servers.
kovidgoyal is offline   Reply With Quote
Old 12-22-2022, 01:04 AM   #3
rasteps
Zealot
rasteps began at the beginning.
 
Posts: 119
Karma: 10
Join Date: Sep 2010
Device: Kindle, Android phone
It doesn't generate a log when it hangs. It just sits in the queue until it is canceled.
rasteps is offline   Reply With Quote
Old 12-22-2022, 01:13 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
click the rotating jobs button in the bottom right corner to find the log
kovidgoyal is offline   Reply With Quote
Old 12-23-2022, 08:51 AM   #5
rasteps
Zealot
rasteps began at the beginning.
 
Posts: 119
Karma: 10
Join Date: Sep 2010
Device: Kindle, Android phone
Quote:
Originally Posted by kovidgoyal View Post
click the rotating jobs button in the bottom right corner to find the log
I just realized that I could just click on the stopped job to get the log. The following in a truncated version of the original recipe that only gets the Main News section. This had been in the queue for over 17 minutes. It usually takes less than a minute to complete.

--------------------------------START OF LOG -------------------------------------

Spoiler:
Fetch news from NHK News: Main News
Conversion options changed from defaults:
verbose: 2
output_profile: 'generic_eink'
Resolved conversion options
calibre version: 6.10.0
{'asciiize': False,
'author_sort': None,
'authors': None,
'base_font_size': 0,
'book_producer': None,
'change_justification': 'original',
'chapter': None,
'chapter_mark': 'pagebreak',
'comments': None,
'cover': None,
'debug_pipeline': None,
'dehyphenate': True,
'delete_blank_paragraphs': True,
'disable_font_rescaling': False,
'dont_download_recipe': False,
'dont_split_on_page_breaks': True,
'duplicate_links_in_toc': False,
'embed_all_fonts': False,
'embed_font_family': None,
'enable_heuristics': False,
'epub_flatten': False,
'epub_inline_toc': False,
'epub_toc_at_end': False,
'epub_version': '2',
'expand_css': False,
'extra_css': None,
'extract_to': None,
'filter_css': None,
'fix_indents': True,
'flow_size': 260,
'font_size_mapping': None,
'format_scene_breaks': True,
'html_unwrap_factor': 0.4,
'input_encoding': None,
'input_profile': <calibre.customize.profiles.InputProfile object at 0x0000023ECECB8E80>,
'insert_blank_line': False,
'insert_blank_line_size': 0.5,
'insert_metadata': False,
'isbn': None,
'italicize_common_cases': True,
'keep_ligatures': False,
'language': None,
'level1_toc': None,
'level2_toc': None,
'level3_toc': None,
'line_height': 0,
'linearize_tables': False,
'lrf': False,
'margin_bottom': 5.0,
'margin_left': 5.0,
'margin_right': 5.0,
'margin_top': 5.0,
'markup_chapter_headings': True,
'max_toc_links': 50,
'minimum_line_height': 120.0,
'no_chapters_in_toc': False,
'no_default_epub_cover': False,
'no_inline_navbars': False,
'no_svg_cover': False,
'output_profile': <calibre.customize.profiles.GenericEink object at 0x0000023ECECB8B80>,
'page_breaks_before': None,
'prefer_metadata_cover': False,
'preserve_cover_aspect_ratio': False,
'pretty_print': True,
'pubdate': None,
'publisher': None,
'rating': None,
'read_metadata_from_opf': None,
'remove_fake_margins': True,
'remove_first_image': False,
'remove_paragraph_spacing': False,
'remove_paragraph_spacing_indent_size': 1.5,
'renumber_headings': True,
'replace_scene_breaks': '',
'search_replace': None,
'series': None,
'series_index': None,
'smarten_punctuation': False,
'sr1_replace': '',
'sr1_search': '',
'sr2_replace': '',
'sr2_search': '',
'sr3_replace': '',
'sr3_search': '',
'start_reading_at': None,
'subset_embedded_fonts': False,
'tags': None,
'test': False,
'timestamp': None,
'title': None,
'title_sort': None,
'toc_filter': None,
'toc_threshold': 6,
'toc_title': None,
'transform_css_rules': None,
'transform_html_rules': None,
'unsmarten_punctuation': False,
'unwrap_lines': True,
'use_auto_toc': False,
'verbose': 2}
InputFormatPlugin: Recipe Input running
Downloading recipe urn: custom:1002
Using user agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36
Synthesizing mastheadImage
Fetching http://www3.nhk.or.jp/news/html/2022...931861000.html
Fetching http://www3.nhk.or.jp/news/html/2022...933421000.html
Fetching http://www3.nhk.or.jp/news/html/2022...933571000.html
Fetching http://www3.nhk.or.jp/news/html/2022...932011000.html
Fetching http://www3.nhk.or.jp/news/html/2022...932281000.html
Fetched http://www3.nhk.or.jp/news/html/2022...933571000.html in 0.093000 seconds
Fetched http://www3.nhk.or.jp/news/html/2022...933421000.html in 0.109000 seconds
Fetched http://www3.nhk.or.jp/news/html/2022...932281000.html in 0.094000 seconds
Fetched http://www3.nhk.or.jp/news/html/2022...932011000.html in 0.109000 seconds
Fetched http://www3.nhk.or.jp/news/html/2022...931861000.html in 0.140000 seconds
Removing unlikely candidate - aside#nhkheader - body#readabilityBody.detail.news-weather
Removing unlikely candidate - header#header - #wrapper
Removing unlikely candidate - header.content--detail-header - section.module--detail-content
Candid: 32.580 .content--detail-body - section.content--detail-main link density 0.000 -> 32.580
Candid: 26.290 section.content--detail-main - section.module--detail-content link density 0.000 -> 26.290
Top 5 : 32.580 .content--detail-body - section.content--detail-main
Top 5 : 26.290 section.content--detail-main - section.module--detail-content
Removing unlikely candidate - aside#nhkheader - body#readabilityBody.detail.news-social
Removing unlikely candidate - header#header - #wrapper
Removing unlikely candidate - header.content--detail-header - section.module--detail-content
Candid: 35.830 .content--detail-body - section.content--detail-main link density 0.000 -> 35.830
Candid: 26.665 section.content--detail-main - section.module--detail-content link density 0.000 -> 26.665
Candid: 35.000 .content--detail-more.none-mobile - .content--detail-body link density 0.000 -> 35.000
Top 5 : 35.830 .content--detail-body - section.content--detail-main
Top 5 : 35.000 .content--detail-more.none-mobile - .content--detail-body
Top 5 : 26.665 section.content--detail-main - section.module--detail-content
Removing unlikely candidate - aside#nhkheader - body#readabilityBody.detail.news-social
Removing unlikely candidate - header#header - #wrapper
Removing unlikely candidate - header.content--detail-header - section.module--detail-content
Candid: 34.420 .content--detail-body - section.content--detail-main link density 0.000 -> 34.420
Candid: 27.210 section.content--detail-main - section.module--detail-content link density 0.000 -> 27.210
Candid: 28.900 section.content--body.type-bottom - .content--detail-more.none-mobile link density 0.000 -> 28.900
Candid: 48.740 .content--detail-more.none-mobile - .content--detail-body link density 0.000 -> 48.740
Candid: 28.250 section.content--body.type-bottom - .content--detail-more.none-mobile link density 0.000 -> 28.250
Candid: 29.370 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 29.370
Candid: 30.000 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 30.000
Candid: 28.400 section.content--body.type-bottom - .content--detail-more.none-mobile link density 0.000 -> 28.400
Candid: 30.000 section.content--body.type-bottom - .content--detail-more.none-mobile link density 0.000 -> 30.000
Candid: 28.710 section.content--body.type-bottom - .content--detail-more.none-mobile link density 0.000 -> 28.710
Candid: 29.400 section.content--body.type-bottom - .content--detail-more.none-mobile link density 0.000 -> 29.400
Candid: 29.450 section.content--body.type-bottom - .content--detail-more.none-mobile link density 0.000 -> 29.450
Top 5 : 48.740 .content--detail-more.none-mobile - .content--detail-body
Top 5 : 34.420 .content--detail-body - section.content--detail-main
Top 5 : 30.000 section.content--body - .content--detail-more.none-mobile
Top 5 : 30.000 section.content--body.type-bottom - .content--detail-more.none-mobile
Top 5 : 29.450 section.content--body.type-bottom - .content--detail-more.none-mobile
Removing unlikely candidate - aside#nhkheader - body#readabilityBody.detail.news-weather
Removing unlikely candidate - header#header - #wrapper
Removing unlikely candidate - header.content--detail-header - section.module--detail-content
Removing unlikely candidate - aside#nhkheader - body#readabilityBody.detail.news-weather
Removing unlikely candidate - header#header - #wrapper
Removing unlikely candidate - header.content--detail-header - section.module--detail-content
Candid: 33.270 .content--detail-body - section.content--detail-main link density 0.024 -> 32.481
Candid: 26.635 section.content--detail-main - section.module--detail-content link density 0.024 -> 26.003
Candid: 29.090 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 29.090
Candid: 42.815 .content--detail-more.none-mobile - .content--detail-body link density 0.026 -> 41.694
Candid: 28.740 section.content--body.type-bottom - .content--detail-more.none-mobile link density 0.000 -> 28.740
Candid: 27.740 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 27.740
Candid: 27.790 section.content--body.type-bottom - .content--detail-more.none-mobile link density 0.000 -> 27.790
Candid: 28.240 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 28.240
Candid: 30.000 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 30.000
Candid: 29.030 section.content--body.type-bottom - .content--detail-more.none-mobile link density 0.000 -> 29.030
Top 5 : 41.694 .content--detail-more.none-mobile - .content--detail-body
Top 5 : 32.481 .content--detail-body - section.content--detail-main
Top 5 : 30.000 section.content--body - .content--detail-more.none-mobile
Top 5 : 29.090 section.content--body - .content--detail-more.none-mobile
Top 5 : 29.030 section.content--body.type-bottom - .content--detail-more.none-mobile
Candid: 32.580 .content--detail-body - section.content--detail-main link density 0.000 -> 32.580
Candid: 26.290 section.content--detail-main - section.module--detail-content link density 0.000 -> 26.290
Top 5 : 32.580 .content--detail-body - section.content--detail-main
Top 5 : 26.290 section.content--detail-main - section.module--detail-content
Candid: 33.190 .content--detail-body - section.content--detail-main link density 0.001 -> 33.147
Candid: 26.595 section.content--detail-main - section.module--detail-content link density 0.001 -> 26.560
Candid: 27.580 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 27.580
Candid: 123.120 .content--detail-more.none-mobile - .content--detail-body link density 0.001 -> 122.958
Candid: 28.960 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 28.960
Candid: 28.990 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 28.990
Candid: 30.000 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 30.000
Candid: 30.000 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 30.000
Candid: 30.000 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 30.000
Candid: 30.000 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 30.000
Candid: 29.490 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 29.490
Candid: 30.000 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 30.000
Candid: 28.330 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 28.330
Candid: 28.750 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 28.750
Candid: 28.420 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 28.420
Candid: 29.080 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 29.080
Parsed http://www3.nhk.or.jp/news/html/2022...933421000.html in 0.2 seconds
Candid: 30.000 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 30.000
Processing images...
Candid: 30.000 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 30.000
Candid: 30.000 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 30.000
Candid: 28.000 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 28.000
Candid: 30.000 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 30.000
Candid: 29.670 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 29.670
Recursion limit reached. Skipping links in http://www3.nhk.or.jp/news/html/2022...933421000.html
Candid: 28.800 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 28.800
Candid: 30.000 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 30.000
Candid: 29.570 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 29.570
Candid: 28.450 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 28.450
Candid: 30.000 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 30.000
Candid: 29.360 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 29.360
Candid: 29.690 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 29.690
http://www3.nhk.or.jp/news/html/2022...933421000.html saved to C:\Users\xxxusername\AppData\Local\Temp\calibre_6g k0yror\ro891dj5_plumber\feed_0\article_3\k10013933 421000.xhtml
Candid: 29.040 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 29.040
Candid: 28.720 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 28.720
Candid: 28.390 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 28.390
Candid: 29.720 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 29.720
Candid: 29.630 section.content--body.type-bottom - .content--detail-more.none-mobile link density 0.000 -> 29.630
Downloaded article: 税務署勤務の女性職員 風俗店で兼業 税務申告もせず 懲戒免職 from http://www3.nhk.or.jp/news/html/2022...933421000.html
Candid: 30.000 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 30.000
Fetching http://www3.nhk.or.jp/news/html/2022...933551000.html
Candid: 29.260 section.content--body.type-bottom - .content--detail-more.none-mobile link density 0.000 -> 29.260
Candid: 30.000 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 30.000
Candid: 28.760 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 28.760
Candid: 28.640 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 28.640
Candid: 28.490 section.content--body.type-bottom - .content--detail-more.none-mobile link density 0.000 -> 28.490
Candid: 29.130 section.content--body.type-bottom - .content--detail-more.none-mobile link density 0.000 -> 29.130
Candid: 29.090 section.content--body.type-bottom - .content--detail-more.none-mobile link density 0.000 -> 29.090
Candid: 29.030 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 29.030
Candid: 28.720 section.content--body.type-bottom - .content--detail-more.none-mobile link density 0.000 -> 28.720
Candid: 28.730 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 28.730
Candid: 28.250 section.content--body.type-bottom - .content--detail-more.none-mobile link density 0.000 -> 28.250
Candid: 29.500 section.content--body - .content--detail-more.none-mobile link density 0.000 -> 29.500
Top 5 : 122.958 .content--detail-more.none-mobile - .content--detail-body
Top 5 : 33.147 .content--detail-body - section.content--detail-main
Top 5 : 30.000 section.content--body - .content--detail-more.none-mobile
Top 5 : 30.000 section.content--body - .content--detail-more.none-mobile
Top 5 : 30.000 section.content--body - .content--detail-more.none-mobile
Parsed http://www3.nhk.or.jp/news/html/2022...932281000.html in 0.3 seconds
Processing images...
Fetching http://www3.nhk.or.jp/news/parts16/i...mg_default.gif
Parsed http://www3.nhk.or.jp/news/html/2022...933571000.html in 0.4 seconds
Processing images...
Recursion limit reached. Skipping links in http://www3.nhk.or.jp/news/html/2022...933571000.html
Parsed http://www3.nhk.or.jp/news/html/2022...931861000.html in 0.3 seconds
Processing images...
http://www3.nhk.or.jp/news/html/2022...933571000.html saved to C:\Users\xxxusername\AppData\Local\Temp\calibre_6g k0yror\ro891dj5_plumber\feed_0\article_2\k10013933 571000.xhtml
Fetching http://www3.nhk.or.jp/news/parts16/i...mg_default.gif
Downloaded article: 北海道 紋別市 市内全域で停電 自衛隊に災害派遣要請 from http://www3.nhk.or.jp/news/html/2022...933571000.html
Fetching http://www3.nhk.or.jp/news/html/2022...932121000.html
Fetched http://www3.nhk.or.jp/news/html/2022...933551000.html in 0.172000 seconds
Removing unlikely candidate - aside#nhkheader - body#readabilityBody.detail.news-international
Removing unlikely candidate - header#header - #wrapper
Removing unlikely candidate - header.content--detail-header - section.module--detail-content
Candid: 34.675 .content--detail-body - section.content--detail-main link density 0.000 -> 34.675
Candid: 26.440 section.content--detail-main - section.module--detail-content link density 0.000 -> 26.440
Candid: 33.590 .content--detail-more.none-mobile - .content--detail-body link density 0.000 -> 33.590
Top 5 : 34.675 .content--detail-body - section.content--detail-main
Top 5 : 33.590 .content--detail-more.none-mobile - .content--detail-body
Top 5 : 26.440 section.content--detail-main - section.module--detail-content
Fetched http://www3.nhk.or.jp/news/parts16/i...mg_default.gif in 0.187000 seconds
Fetched http://www3.nhk.or.jp/news/parts16/i...mg_default.gif in 0.172000 seconds

Last edited by rasteps; 12-28-2022 at 05:55 PM.
rasteps is offline   Reply With Quote
Old 12-23-2022, 10:28 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yeah it looks like bot protection. Sometimes websites will send one byte at a time with intervals when they think a bot is scraping them to prevent timeout errors and keep the bot hanging.
kovidgoyal is offline   Reply With Quote
Old 12-25-2022, 09:15 AM   #7
rasteps
Zealot
rasteps began at the beginning.
 
Posts: 119
Karma: 10
Join Date: Sep 2010
Device: Kindle, Android phone
Sounds like there's no workaround for this. Thanks for looking into it for me.

Can I submit this recipe as it stands then?
rasteps is offline   Reply With Quote
Old 12-25-2022, 10:42 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You could try using

Code:
    def get_browser(self):
        return BasicNewsRecipe.get_browser(self, user_agent='common_words/based')
that might make a difference. And sure you can submit the recipe.
kovidgoyal is offline   Reply With Quote
Old 12-28-2022, 05:53 PM   #9
rasteps
Zealot
rasteps began at the beginning.
 
Posts: 119
Karma: 10
Join Date: Sep 2010
Device: Kindle, Android phone
I added it just above the Feeds section and got the following error:

Code:
calibre, version 6.10.0
ERROR: Invalid recipe: Failed to compile the recipe, with syntax error: unexpected indent (<string>, line 18)

Where is the best place to put those lines? And so I know what I'm looking for, what are they supposed to do?


Quote:
Originally Posted by kovidgoyal View Post
You could try using

Code:
    def get_browser(self):
        return BasicNewsRecipe.get_browser(self, user_agent='common_words/based')
that might make a difference. And sure you can submit the recipe.

Last edited by rasteps; 12-28-2022 at 06:02 PM.
rasteps is offline   Reply With Quote
Old 12-28-2022, 10:09 PM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Where you put them is fine, just make sure they are indented properly to line up with the rest of the things inside the recipe class.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Japanese recipe broken - MainichiDailyNews duluoz Recipes 2 02-27-2020 06:57 PM
NHK Easy News (Japanese News site) beemanfunk Recipes 1 12-25-2014 03:44 AM
Recipe for Foresight(Japanese) tmizukami Recipes 0 10-10-2013 10:57 PM
Fairbanks Daily News-miner News Recipe Submission rogerx Recipes 2 08-25-2011 07:30 PM
New Fairbanks Daily News-miner News Recipe -- Need Date inclusion only rogerx Recipes 5 08-24-2011 09:12 AM


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


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