prevent exception if unable to resolve final link
This commit is contained in:
parent
ec565eda7d
commit
7e6c660b0c
@ -79,9 +79,12 @@ class Entry(Base):
|
||||
print ' fetching final link <%s>' % entry.link
|
||||
request = urllib2.Request(entry.link)
|
||||
opener = urllib2.build_opener()
|
||||
result = opener.open(request)
|
||||
self.resolvedlink = result.url
|
||||
print ' final link: <%s>' % result.url
|
||||
try:
|
||||
result = opener.open(request)
|
||||
self.resolvedlink = result.url
|
||||
print ' final link: <%s>' % result.url
|
||||
except:
|
||||
print ' FAILED opening URL'
|
||||
if feed.fullpage:
|
||||
print ' fetching full page <%s>' % entry.link
|
||||
self.fullpage = fetch_full_page(entry.link)
|
||||
|
Loading…
Reference in New Issue
Block a user