-
assigned issue to
SBS throwing urllib2 503 error
Issue #31
closed
Here's the traceback:
goonbag:webdl goonbag$ ./grabber.py
1) ABC iView
2) Nine
3) SBS
4) Ten
0) Back
Choose> 3
Traceback (most recent call last):
File "./grabber.py", line 61, in <module>
main()
File "./grabber.py", line 41, in main
for n in node.get_children():
File "/Users/goonbag/webdl/common.py", line 50, in get_children
self.fill_children()
File "/Users/goonbag/webdl/sbs.py", line 65, in fill_children
for category_path, entry_data in category_and_entry_data:
File "/Users/goonbag/webdl/sbs.py", line 83, in explode_videos_to_unique_categories
for entry_data in all_video_entries:
File "/Users/goonbag/webdl/sbs.py", line 74, in load_all_video_entries
data = grab_json(url, 3600)
File "/Users/goonbag/webdl/common.py", line 150, in grab_json
f = urlopen(url, max_age)
File "/Users/goonbag/webdl/common.py", line 116, in urlopen
src = _urlopen(url)
File "/Users/goonbag/webdl/common.py", line 96, in _urlopen
return urlopener.open(req)
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 437, in open
response = meth(req, response)
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 475, in error
return self._call_chain(*args)
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 503: Service Unavailable
A quick google leads me to believe this may be to do with how urllib2 is reporting the user agent - perhaps SBS has implemented a rudimentary block on bots etc? Other channels not affected and SBS still works in-browser.
Comments (4)
-
repo owner -
repo owner - changed status to on hold
-
reporter My bad. Yep, must have just been a genuine connection issue at my end at the time. Working now.
-
repo owner - changed status to closed
np :)
- Log in to comment
Sorry but I can't reproduce this. WebDL configures urllib to use the Firefox/OSX user agent. This seems to work fine for me.
Have you tried this again? A 503 Service Unavailable indicates that the SBS servers were down at that time. Maybe it'll work now :)