einstein95 / crunchy-xml-decoder

GNU General Public License v2.0
35 stars 14 forks source link

[SOLVED] In the middle of downloading the script errors out #111

Closed jaw20 closed 7 years ago

jaw20 commented 7 years ago

When I start downloading a show, the script runs fine, but about half way through the script errors out saying, ssl.SSLError: ('The read operation timed out',) . This is after the most recent update to the script. (also is it possible to make it so that if hls fails it automatically rolls over to rtmp, and redownloads the video? maybe try/except code where if an error is returned it immediately switches to code that runs only rtmp, sort of like #84 )

Full Trace Back

File "C:\crunchy-xml-decoder-master\crunchy-xml-decoder.py", line 369, in makechoise() File "C:\crunchy-xml-decoder-master\crunchy-xml-decoder.py", line 317, in makechoise queueu('.\queue.txt') File "C:\crunchy-xml-decoder-master\crunchy-xml-decoder.py", line 106, in queueu ultimate.ultimate(line.rstrip('\n'), '', '') File "crunchy-xml-decoder\ultimate.py", line 283, in ultimate video_hls(filen, video_input) File "crunchy-xml-decoder\hls.py", line 112, in video_hls fetch_streams(output, video) File "crunchy-xml-decoder\hls.py", line 79, in fetch_streams raw = resumable_fetch(seg.uri, n+1, len(video.segments)) File "crunchy-xml-decoder\hls.py", line 18, in init self._restart() File "crunchy-xml-decoder\hls.py", line 34, in _restart self.stream = urllib2.urlopen(req, timeout = 30) 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 1240, in https_open context=self._context) File "C:\Python27\lib\urllib2.py", line 1200, in do_open r = h.getresponse(buffering=True) File "C:\Python27\lib\httplib.py", line 1074, in getresponse response.begin() File "C:\Python27\lib\httplib.py", line 415, in begin version, status, reason = self._read_status() File "C:\Python27\lib\httplib.py", line 371, in _read_status line = self.fp.readline(_MAXLINE + 1) File "C:\Python27\lib\socket.py", line 476, in readline data = self._sock.recv(self._rbufsize) File "C:\Python27\lib\ssl.py", line 714, in recv return self.read(buflen) File "C:\Python27\lib\ssl.py", line 608, in read v = self._sslobj.read(len or 1024) ssl.SSLError: ('The read operation timed out',)'>

tbx34 commented 7 years ago

Same with me. I also got this problem after downloading video with hls.

jsonn commented 7 years ago

The problem is that the streaming server sometimes just likes to random kill connections, which is why the existing restart logic exists in first place. There is just no logic to retry connects as well.

tbx34 commented 7 years ago

I try download again and compare with the old download, the video stop at same time and have same size.

jsonn commented 7 years ago

Can you give me an URL to try to reproduce this?

jaw20 commented 7 years ago

Yea sure, Try the script with this link: http://www.crunchyroll.com/rezero-starting-life-in-another-world-/episode-12-return-to-the-capital-702423

tbx34 commented 7 years ago

http://www.crunchyroll.com/yu-gi-oh-arc-v/episode-10-knight-of-the-secret-stone-fusion-user-masumi-koutsu-724001

jsonn commented 7 years ago

@jaw20 works fine here.

jaw20 commented 7 years ago

Hmm... Is it possible that it only occurs after downloading episodes for a period of time @jsonn ? I know that for when it stops downloading, it stops in different places every single time, but the error effects all downloads. (as in trying to download a different episode doesn't help)

jaw20 commented 7 years ago

Additionally you could just increase the time it takes to Timeout in the restart script. (I'll test some possible solutions later today)

jaw20 commented 7 years ago

This is solved by increasing the time to time out from 30 seconds to 180 seconds. See here for more updates