danielfett/advancedcaching

N900: 0.9.1.2 downloader: problem with php returning gif: 406 Not Acceptable

Closed this issue · 0 comments

aapo commented

E.g this cache http://www.geocaching.com/seek/cache_details.aspx?wp=GCY2GZ has link http://www.geocoins.ca/images/beenseen.php which returns gif-file. E.g. wget get it.

28619       INFO cachedownloader      Downloading http://www.geocoins.ca/images/beenseen.php to /media/mmc1//geocaches/GCY2GZ-image0.php // cachedownloader.py:606
 28631       INFO downloader           Sending request to http://www.geocoins.ca/images/beenseen.php // downloader.py:122
 29282      ERROR cachedownloader      HTTP Error 406: Not Acceptable // cachedownloader.py:620
Traceback (most recent call last):
  File "/opt/agtl-maemo/cachedownloader.py", line 617, in _parse_cache_page
f.write(self.downloader.get_reader(url, login = False).read())
  File "/opt/agtl-maemo/downloader.py", line 129, in get_reader
resp = urlopen(req)
  File "/usr/lib/python2.5/urllib2.py", line 124, in urlopen
return _opener.open(url, data)
  File "/usr/lib/python2.5/urllib2.py", line 387, in open
response = meth(req, response)
  File "/usr/lib/python2.5/urllib2.py", line 498, in http_response
'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.5/urllib2.py", line 425, in error
return self._call_chain(*args)
  File "/usr/lib/python2.5/urllib2.py", line 360, in _call_chain
result = func(*args)
  File "/usr/lib/python2.5/urllib2.py", line 506, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 406: Not Acceptable
 29357      ERROR cachedownloader      Failed to download image from URL http://www.geocoins.ca/images/beenseen.php // cachedownloader.py:621
 29413      DEBUG cachedownloader      End parsing. // cachedownloader.py:647

Seems "Accept" (in HTTP-request) is set to not allow it, but it is not defined on code, so it should allow everything.