0x776b7364 / toggle.sg-download

Python script to automate Toggle.sg video downloads
MIT License
26 stars 18 forks source link

403 Forbidden? #36

Closed NGPriest closed 7 years ago

NGPriest commented 7 years ago

Tried this as well as using #35

C:\toggle.sg-download>download_toggle_video2.py -d http://tv.toggle.sg/en/tv/shows/housewives-holiday/episodes

=====================================
Toggle video and episodes downloader
by 0x776b7364
=====================================

================================
[*] Processing input 1 of 1 ...
================================
[I] Toggle episodes http://tv.toggle.sg/en/tv/shows/housewives-holiday/episodes detected
[D] Performing HTTP GET request on Toggle episodes URL ...
Traceback (most recent call last):
  File "C:\toggle.sg-download\download_toggle_video2.py", line 469, in <module>
    main()
  File "C:\toggle.sg-download\download_toggle_video2.py", line 441, in main
    records_to_enqueue = process_url(input_url)
  File "C:\toggle.sg-download\download_toggle_video2.py", line 169, in process_url
    return process_episodes_url(url)
  File "C:\toggle.sg-download\download_toggle_video2.py", line 316, in process_episodes_url
    t_episodes_url_resp = urllib_request.urlopen(t_episodes_url).read()
  File "C:\Python27\lib\urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Python27\lib\urllib2.py", line 437, in open
    response = meth(req, response)
  File "C:\Python27\lib\urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Python27\lib\urllib2.py", line 475, in error
    return self._call_chain(*args)
  File "C:\Python27\lib\urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "C:\Python27\lib\urllib2.py", line 558, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden
0x776b7364 commented 7 years ago

It's probably to do with User-Agent settings. I'll see if I can implement a fix.

NGPriest commented 7 years ago

Weird that noone else is experiencing this...

Also weird that download_toggle_video2.py https://video.toggle.sg/en/series/housewives-holiday/ep1/284791 https://video.toggle.sg/en/series/housewives-holiday/ep2/284793 https://video.toggle.sg/en/series/housewives-holiday/ep3/284794 https://video.toggle.sg/en/series/housewives-holiday/ep4/284795 https://video.toggle.sg/en/series/housewives-holiday/ep5/284796 https://video.toggle.sg/en/series/housewives-holiday/ep6/284797 https://video.toggle.sg/en/series/housewives-holiday/ep7/284798 https://video.toggle.sg/en/series/housewives-holiday/ep8/284799 https://video.toggle.sg/en/series/housewives-holiday/ep9/284800 https://video.toggle.sg/en/series/housewives-holiday/ep10/284801 https://video.toggle.sg/en/series/housewives-holiday/ep11/284802 https://video.toggle.sg/en/series/housewives-holiday/ep12/284803 https://video.toggle.sg/en/series/housewives-holiday/ep13/284804 https://video.toggle.sg/en/series/housewives-holiday/ep14/284805 https://video.toggle.sg/en/series/housewives-holiday/ep15/284806 https://video.toggle.sg/en/series/housewives-holiday/ep16/284807 https://video.toggle.sg/en/series/housewives-holiday/ep17/284808 https://video.toggle.sg/en/series/housewives-holiday/ep18/284809 https://video.toggle.sg/en/series/housewives-holiday/ep19/284810 https://video.toggle.sg/en/series/housewives-holiday/ep20/284811 still works...?

0x776b7364 commented 7 years ago

Yeah, weird eh? My guess is that there are user-agent checks in tv.toggle.sg URLs and not in video.toggle.sg URLs.