View Single Post
Old 10-06-2012, 06:20 AM   #1
penguin
Junior Member
penguin began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2012
Device: Kindle Touch
Der Spiegel, Recipe Error Code:1

Hey,

I'm using the "Der Spiegel" recipe the last weeks without problems. But now I got the following error:

Spoiler:
Code:
...
InputFormatPlugin: Recipe Input running
Using custom recipe
Found section  Hausmitteilung
Found article  
Python function terminated unexpectedly
  'href' (Error Code: 1)
Traceback (most recent call last):
  File "site.py", line 132, in main
  File "site.py", line 109, in run_entry_point
  File "site-packages\calibre\utils\ipc\worker.py", line 186, in main
  File "site-packages\calibre\gui2\convert\gui_conversion.py", line 25, in gui_convert
  File "site-packages\calibre\ebooks\conversion\plumber.py", line 989, in run
  File "site-packages\calibre\customize\conversion.py", line 239, in __call__
  File "site-packages\calibre\ebooks\conversion\plugins\recipe_input.py", line 109, in convert
  File "site-packages\calibre\web\feeds\news.py", line 881, in download
  File "site-packages\calibre\web\feeds\news.py", line 1026, in build_index
  File "<string>", line 81, in parse_index
  File "site-packages\calibre\ebooks\BeautifulSoup.py", line 518, in __getitem__
KeyError: 'href'


I only customize the recipe to add the date to the title (works fine the last weeks), but now also the original recipe stops with the same error.
I already do some google research and try to change the recipe, but without success. I'm not a pro so its maybe just a simple change.
The problem seems to be the highlighted part:

Spoiler:
Code:
...
feeds = []
         for section in index.findAll('dt'):
            section_title = self.tag_to_string(section).strip()
            self.log('Found section ', section_title)

            articles = []
            for article in section.findNextSiblings(['dd','dt']):
                if article.name == 'dt':
                    break
                link = article.find('a')
                title = self.tag_to_string(link).strip()
                if title in self.empty_articles:
                    continue
                self.log('Found article ', title)
                url = self.PREFIX + link['href']
                articles.append({'title' : title, 'date' : strftime(self.timefmt), 'url' : url})
            feeds.append((section_title,articles))
        return feeds;


If i set the URL manually to a single article the recipe download / convert this article without any errors.

I hope anyone have an idea to get the recipe work again! (Btw I update to calibre 0.9.1 but no changes)

Thx Matthias

Last edited by penguin; 10-07-2012 at 07:06 PM.
penguin is offline   Reply With Quote