mrkipling / maraschino

A front-end for HTPCs
MIT License
424 stars 125 forks source link

Fix CloudFlare 1010 error in TraktPlus module #320

Closed taeram closed 11 years ago

taeram commented 11 years ago

The Trakt Plus module has recently begun returning "broken" thumbnails for all shows and movies. Looking at the contents of the actual .jpg files in the cache/trakt/shows/ and cache/trakt/movies/ directories, they're full of HTML.

The HTML was generated by CloudFlare, and is an Access Denied: Error 1010 error.

This PR fixes the CloudFlare 1010 error by faking a User-Agent header when making the request for thumbnail images from Trakt.tv. I've switched to urllib2 for downloading the thumbnail images, as urllib doesn't support headers (as far as I can tell).

N3MIS15 commented 11 years ago

Thanks for the fix. I had noticed I was getting some dud thumbnails.