Fix #1317635 [News fetching URL for NRC Handelsblad changes every day](https://bugs.launchpad.net/calibre/+bug/1317635)

This commit is contained in:
Kovid Goyal 2014-05-09 07:39:22 +05:30
parent 24299b12a4
commit dfe1dcedb6

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python2 #!/usr/bin/env python2
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#Based on veezh's original recipe and Kovid Goyal's New York Times recipe # Based on veezh's original recipe and Kovid Goyal's New York Times recipe
__license__ = 'GPL v3' __license__ = 'GPL v3'
__copyright__ = '2011, Snaab' __copyright__ = '2011, Snaab'
@ -42,7 +42,7 @@ class NRCHandelsblad(BasicNewsRecipe):
raise ValueError('Failed to login, check username and password') raise ValueError('Failed to login, check username and password')
epubraw = None epubraw = None
for today in (date.today(), date.today() - timedelta(days=1),): for today in (date.today(), date.today() - timedelta(days=1),):
url = 'http://digitaleeditie.nrc.nl/digitaleeditie/NH/%s/3/%s___/downloads.html' % (today.strftime('%Y'), today.strftime('%Y%m%d')) url = 'http://digitaleeditie.nrc.nl/digitaleeditie/NH/%s/%d/%s___/downloads.html' % (today.strftime('%Y'), today.month - 1, today.strftime('%Y%m%d'))
self.log('Trying to download epub from:', url) self.log('Trying to download epub from:', url)
br.start_load(url, timeout=60) br.start_load(url, timeout=60)
try: try: