|  02-27-2023, 05:54 PM | #1 | 
| Zealot  Posts: 140 Karma: 10 Join Date: Sep 2010 Device: Kindle, Android phone | 
				
				The Mainichi fails on every download
			 
			
			The Mainichi fails on every download attempt for me. Is this happening for anyone else?
		 | 
|   |   | 
|  03-03-2023, 07:33 PM | #2 | 
| Zealot  Posts: 140 Karma: 10 Join Date: Sep 2010 Device: Kindle, Android phone | 
			
			What does this error code mean? Spoiler: 
 | 
|   |   | 
| Advert | |
|  | 
|  03-03-2023, 08:07 PM | #3 | 
| creator of calibre            Posts: 45,604 Karma: 28548974 Join Date: Oct 2006 Location: Mumbai, India Device: Various | 
			
			It means the index page the recipe uses no longer exists.
		 | 
|   |   | 
|  03-04-2023, 02:57 AM | #4 | 
| Zealot  Posts: 140 Karma: 10 Join Date: Sep 2010 Device: Kindle, Android phone | |
|   |   | 
|  03-04-2023, 05:58 AM | #5 | 
| Zealot  Posts: 140 Karma: 10 Join Date: Sep 2010 Device: Kindle, Android phone | 
			
			I checked the url which is listed as the "index" page https://mainichi.jp/english/ And it does exist and is accessible. So maybe there is a different error. | 
|   |   | 
| Advert | |
|  | 
|  03-04-2023, 12:25 PM | #6 | 
| Guru            Posts: 644 Karma: 85520 Join Date: May 2021 Device: kindle | Code: """
www.mainichi.jp/english
"""
from calibre.ptempfile import PersistentTemporaryFile
from calibre.web.feeds.news import BasicNewsRecipe
class MainichiEnglishNews(BasicNewsRecipe):
    title = u"The Mainichi"
    __author__ = 'unkn0wn'
    description = "Japanese traditional newspaper Mainichi news in English"
    publisher = "Mainichi News"
    publication_type = "newspaper"
    category = "news, japan"
    language = "en_JP"
    index = "http://mainichi.jp/english/"
    masthead_url = index + "images/themainichi.png"
    no_stylesheets = True
    remove_javascript = True
    auto_cleanup = True
    
    ignore_duplicate_articles = {'title'}
    
    articles_are_obfuscated = True
    
    def get_obfuscated_article(self, url):
        br = self.get_browser()
        try:
            br.open(url)
        except Exception as e:
            url = e.hdrs.get('location')
        soup = self.index_to_soup(url)
        link = soup.find('a', href=True)
        html = br.open(link['href']).read()
        pt = PersistentTemporaryFile('.html')
        pt.write(html)
        pt.close()
        return pt.name
    
    feeds = [
        ('Articles', 'https://news.google.com/rss/search?q=when:48h+allinurl:mainichi.jp%2Fenglish%2Farticles%2F&hl=en-US&gl=US&ceid=US:en')
    ] | 
|   |   | 
|  03-04-2023, 11:12 PM | #7 | |
| Zealot  Posts: 140 Karma: 10 Join Date: Sep 2010 Device: Kindle, Android phone | Quote: 
 Is the fix to add "www"??? | |
|   |   | 
|  03-05-2023, 12:41 AM | #8 | 
| Guru            Posts: 644 Karma: 85520 Join Date: May 2021 Device: kindle | 
			
			no this is totally a new recipe of the website based on google feeds. I didn't want to spend time to figure out all the issues with the old recipe. | 
|   |   | 
|  03-10-2023, 01:11 AM | #9 | 
| Zealot  Posts: 140 Karma: 10 Join Date: Sep 2010 Device: Kindle, Android phone | 
			
			Thanks. This recipe is working again.
		 | 
|   |   | 
|  03-10-2023, 01:13 AM | #10 | 
| Zealot  Posts: 140 Karma: 10 Join Date: Sep 2010 Device: Kindle, Android phone | 
			
			Thanks. This recipe is working again. I guess I am the only one who uses it, so I should figure out how to fix these things.
		 | 
|   |   | 
|  | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Fails to download Newsweek | snailslow | Recipes | 5 | 04-08-2016 10:58 PM | 
| Update download fails at 40% | TonyToews | Kobo Tablets | 0 | 03-16-2012 02:48 PM | 
| Metadata fails to download | jadedboi | Library Management | 8 | 05-09-2011 03:55 PM | 
| download metadata fails ..... | schuster | Calibre | 1 | 02-10-2011 11:19 AM | 
| Download fails when using password | jarid | Calibre | 5 | 11-14-2010 04:38 PM |