SBS attempted DL crashes with Invalid range, status failed

Issue #90 invalid
Former user created an issue

DEBUG urlopen('http://www.sbs.com.au/api/video_search/v2/?filters=%7Bsection%7D%7BPrograms%7D&m=1&range=1-501', 3600) DEBUG downloading: http://www.sbs.com.au/api/video_search/v2/?filters=%7Bsection%7D%7BPrograms%7D&m=1&range=1-501 -> /home/craigl/.cache/webdl/7f301f87040135cf93dff99ab6a1a7aa Traceback (most recent call last): File "./grabber.py", line 66, in <module> main() File "./grabber.py", line 45, in main for n in node.get_children(): File "/data/MyDocuments/webdl_old/common.py", line 51, in get_children self.fill_children() File "/data/MyDocuments/webdl_old/sbs.py", line 65, in fill_children for category_path, entry_data in category_and_entry_data: File "/data/MyDocuments/webdl_old/sbs.py", line 83, in explode_videos_to_unique_categories for entry_data in all_video_entries: File "/data/MyDocuments/webdl_old/sbs.py", line 74, in load_all_video_entries data = grab_json(url, 3600) File "/data/MyDocuments/webdl_old/common.py", line 151, in grab_json f = urlopen(url, max_age) File "/data/MyDocuments/webdl_old/common.py", line 117, in urlopen src = _urlopen(url) File "/data/MyDocuments/webdl_old/common.py", line 97, in _urlopen return urlopener.open(req) File "/usr/lib/python2.7/urllib2.py", line 435, in open response = meth(req, response) File "/usr/lib/python2.7/urllib2.py", line 548, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python2.7/urllib2.py", line 473, in error return self._call_chain(args) File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain result = func(args) File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 400: Bad Request

Comments (3)

  1. Craig Lister

    This patch to sbs.py seems to let some data thru but not all but i don't know why??

    def load_all_video_entries(self):
        offset = 0
        amount = 500
        while True:
            #url = append_to_qs(FULL_VIDEO_LIST, {"range": "%s-%s" % (offset, offset+amount)})
            #url = append_to_qs(FULL_VIDEO_LIST)
            data = grab_json(FULL_VIDEO_LIST, 3600)
            entries = data["entries"]
            #if len(entries) == 0:
            #    break
            for entry in entries:
                yield entry
            #offset += amount
            break
    
  2. Log in to comment