0x776b7364 / toggle.sg-download

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

Cannot download video from toggle.sg #41

Closed ChinHuiHing closed 6 years ago

ChinHuiHing commented 6 years ago

Hi, recently the downloader show "connected party did not properly respond". Anyway to resolve? Thank you.

0x776b7364 commented 6 years ago

As usual, without any URL, and without any debug logs, I cannot work on your issue.

ChinHuiHing commented 6 years ago

URL:https://video.toggle.sg/en/series/while-we-are-young-z/ep15/550084 Error msg: [I] Selected URL(s): [I] http://cdnapi.kaltura.com/p/2082311/sp/208231100/playManifest/protocol/http/entryId/0_rh3uidba/format/applehttp/tags/tablet_hd/f/a.m3u8 Traceback (most recent call last): File "D:\toggle.sg-download-master\download_toggle_video2.py", line 498, in main() File "D:\toggle.sg-download-master\download_toggle_video2.py", line 470, in main records_to_enqueue = process_url(input_url) File "D:\toggle.sg-download-master\download_toggle_video2.py", line 169, in process_url return process_video_url(url) File "D:\toggle.sg-download-master\download_toggle_video2.py", line 300, in process_video_url subtitle_link_resp = urllib_request.urlopen(subtitle_link).read() File "C:\Python27\lib\urllib2.py", line 154, in urlopen return opener.open(url, data, timeout) File "C:\Python27\lib\urllib2.py", line 429, in open response = self._open(req, data) File "C:\Python27\lib\urllib2.py", line 447, in _open '_open', req) File "C:\Python27\lib\urllib2.py", line 407, in _call_chain result = func(*args) File "C:\Python27\lib\urllib2.py", line 1228, in http_open return self.do_open(httplib.HTTPConnection, req) File "C:\Python27\lib\urllib2.py", line 1198, in do_open raise URLError(err) urllib2.URLError: <urlopen error [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond>

Sorry for not providing the URL and debug logs. Thank you.

Kerean commented 6 years ago

I am having a similar issue as ChinHuiLing. Trying to edit the .py script using the code set out in #42 Edited ffmpeg command and link to download subtitles doesn't seem to work either.

Error before modification:

[I] Toggle video https://video.toggle.sg/en/tv-show/news/nov-2017-hello-singapor e/wed-1-nov-2017/545501 detected [I] Obtained media name = Nov2017-_HelloSingapore-_Wed_1_Nov_2017 [I] Auto-selected URL: http://cdnapi.kaltura.com/p/2082311/sp/208231100/playMani fest/protocol/http/entryId/0_4eqsigov/format/applehttp/tags/hlstv_hd/f/a.m3u8 Traceback (most recent call last): File "S:\Python27\download_toggle_video5.py", line 500, in main() File "S:\Python27\download_toggle_video5.py", line 472, in main records_to_enqueue = process_url(input_url) File "S:\Python27\download_toggle_video5.py", line 171, in process_url return process_video_url(url) File "S:\Python27\download_toggle_video5.py", line 302, in process_video_url subtitle_link_resp = urllib_request.urlopen(subtitle_link).read() File "C:\Python27\lib\urllib2.py", line 154, in urlopen return opener.open(url, data, timeout) File "C:\Python27\lib\urllib2.py", line 431, in open response = self._open(req, data) File "C:\Python27\lib\urllib2.py", line 449, in _open '_open', req) File "C:\Python27\lib\urllib2.py", line 409, in _call_chain result = func(*args) File "C:\Python27\lib\urllib2.py", line 1227, in http_open return self.do_open(httplib.HTTPConnection, req) File "C:\Python27\lib\urllib2.py", line 1197, in do_open raise URLError(err) urllib2.URLError: <urlopen error [Errno 10060] A connection attempt failed becau se the connected party did not properly respond after a period of time, or estab lished connection failed because connected host has failed to respond> ` After editing the script, this is the error:

` [I] Toggle video https://video.toggle.sg/en/tv-show/news/nov-2017-hello-singapor e/wed-1-nov-2017/545501 detected [I] Obtained media name = Nov2017-_HelloSingapore-_Wed_1_Nov_2017 [I] Auto-selected URL: http://cdnapi.kaltura.com/p/2082311/sp/208231100/playMani fest/protocol/http/entryId/0_4eqsigov/format/applehttp/tags/hlstv_hd/f/a.m3u8 [W] No subtitles found! [I] Starting download of queued URLs ... [I] Thread d84aa459: processing URL http://cdnapi.kaltura.com/p/2082311/sp/20823 1100/playManifest/protocol/http/entryId/0_4eqsigov/format/applehttp/tags/hlstv_h d/f/a.m3u8 Input #0, hls,applehttp, from 'http://cdnapi.kaltura.com/p/2082311/sp/208231100/ playManifest/protocol/http/entryId/0_4eqsigov/format/applehttp/tags/hlstv_hd/f/a .m3u8': Duration: 00:46:14.42, start: 0.101000, bitrate: 0 kb/s Program 0 Metadata: variant_bitrate : 1957888 Stream #0:0: Video: h264 (Constrained Baseline) ([27][0][0][0] / 0x001B), yu v420p, 960x540 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc Metadata: variant_bitrate : 1957888 Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, flt p, 105 kb/s Metadata: variant_bitrate : 1957888 Stream #0:2: Data: timed_id3 (ID3 / 0x20334449) Metadata: variant_bitrate : 1957888 Program 1 Metadata: variant_bitrate : 2671616 Stream #0:3: Video: h264 (Constrained Baseline) ([27][0][0][0] / 0x001B), yu v420p, 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc Metadata: variant_bitrate : 2671616 Stream #0:4: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, flt p, 130 kb/s Metadata: variant_bitrate : 2671616 Stream #0:5: Data: timed_id3 (ID3 / 0x20334449) Metadata: variant_bitrate : 2671616 Program 2 Metadata: variant_bitrate : 4150272 Stream #0:6: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc Metadata: variant_bitrate : 4150272 Stream #0:7: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, flt p, 130 kb/s Metadata: variant_bitrate : 4150272 Stream #0:8: Data: timed_id3 (ID3 / 0x20334449) Metadata: variant_bitrate : 4150272 [mp4 @ 05410520] Codec for stream 0 does not use global headers but container fo rmat requires global headers [mp4 @ 05410520] Codec for stream 1 does not use global headers but container fo rmat requires global headers Output #0, mp4, to 'Nov2017-_HelloSingapore-_Wed_1_Nov_2017_hlstv_hd.mp4': Metadata: encoder : Lavf56.30.100 Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1 :1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 90k tbn, 90k tbc Metadata: variant_bitrate : 4150272 Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, 105 kb/s

Metadata:
  variant_bitrate : 1957888

Stream mapping: Stream #0:6 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help [mp4 @ 05410520] Malformed AAC bitstream detected: use the audio bitstream filte r 'aac_adtstoasc' to fix it ('-bsf:a aac_adtstoasc' option with ffmpeg) av_interleaved_write_frame(): Operation not permitted frame= 4 fps=0.0 q=-1.0 Lsize= 218kB time=00:00:00.12 bitrate=14864.7kbit s/s video:217kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing o verhead: 0.275206% Conversion failed! [E] ffmpeg file not found, or existing file is for incorrect architecture, or do wnload was interrupted prematurely. [I] Thread d84aa459 completed [I] === Script execution complete! ===`

0x776b7364 commented 6 years ago

Patches have been committed; please test and let me know if you're still facing issues. Thanks to @JackeJR for the PR. :)

ChinHuiHing commented 6 years ago

Its work well with the new patches. Thank you very much @0x776b7364

0x776b7364 commented 6 years ago

Glad it works for you. Closed.