thwarted/ffarchive — Issue #2: external image links that can't be downloaded cause crash
Author: thwarted
Created: 2012-01-22 08:16:34+00:00
State: open

This occurred because there was a period when twitpic was serving the wrong user's content in t he RSS feed, and my feed was populated with these. Then the user who actually owned them deleted the pic, and thus the download of the thumbnail fails. But this code isn't detecting that the image download failed and is trying to get the length of the body, which is invalid on a non-200 response.
```
(store_entry) wrote entry e/7c972289a80e5d3d9fdbc5b527f03796
(download_media_file) downloading 'http://twitpic.com/show/thumb/5scayj'
(download) downloading http://twitpic.com/show/thumb/5scayj
Traceback (most recent call last):
File "./friendfeed-archive", line 571, in
download_feed_entries(feedname, options)
File "./friendfeed-archive", line 250, in download_feed_entries
updated_entries = save_entries(ffdata['entries'])
File "./friendfeed-archive", line 237, in save_entries
updated_entries += ffdb.store_entry(v2e, force=options.iterateall)
File "./friendfeed-archive", line 393, in store_entry
self.download_entrys_media(mergedentry)
File "./friendfeed-archive", line 454, in download_entrys_media
(downloaded, sizebytes) = self.download_media_file(t['url'], force)
File "./friendfeed-archive", line 498, in download_media_file
sizebytes = int(headers.getheader('content-length'))
TypeError: int() argument must be a string or a number, not 'NoneType'
```