{"action":"created","issue":{"url":"https://api.github.com/repos/streamlink/streamlink/issues/332","repository_url":"https://api.github.com/repos/streamlink/streamlink","labels_url":"https://api.github.com/repos/streamlink/streamlink/issues/332/labels{/name}","comments_url":"https://api.github.com/repos/streamlink/streamlink/issues/332/comments","events_url":"https://api.github.com/repos/streamlink/streamlink/issues/332/events","html_url":"https://github.com/streamlink/streamlink/issues/332","id":197790389,"number":332,"title":"'Read timed out' appears to not be handled properly as of 0.2.0","user":{"login":"CyberBotX","id":1874739,"avatar_url":"https://avatars.githubusercontent.com/u/1874739?v=3","gravatar_id":"","url":"https://api.github.com/users/CyberBotX","html_url":"https://github.com/CyberBotX","followers_url":"https://api.github.com/users/CyberBotX/followers","following_url":"https://api.github.com/users/CyberBotX/following{/other_user}","gists_url":"https://api.github.com/users/CyberBotX/gists{/gist_id}","starred_url":"https://api.github.com/users/CyberBotX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CyberBotX/subscriptions","organizations_url":"https://api.github.com/users/CyberBotX/orgs","repos_url":"https://api.github.com/users/CyberBotX/repos","events_url":"https://api.github.com/users/CyberBotX/events{/privacy}","received_events_url":"https://api.github.com/users/CyberBotX/received_events","type":"User","site_admin":false},"labels":[{"id":443888408,"url":"https://api.github.com/repos/streamlink/streamlink/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-28T03:30:43Z","updated_at":"2016-12-28T11:27:29Z","closed_at":null,"body":"I use streamlink under FreeBSD (I've made a port for it and submitted it, but I need to update it for the latest version) to watch streams on Twitch. With 0.1.0 and earlier, whenever a read timeout seemed to occur, I'd get a message such as this:\r\n\r\n`[stream.hls][error] Failed to open segment 4370: Unable to open URL: https://video-edge-835ef0.ord02.hls.ttvnw.net/transcode-x2-835b70/sinister1_24051668848_571899805/chunked/index-0000004371-tN3E.ts (HTTPSConnectionPool(host='video-edge-835ef0.ord02.hls.ttvnw.net', port=443): Read timed out.)`\r\n\r\nWith 0.2.0, though, I instead see an exception occurring, like so:\r\n\r\n```\r\nException in thread Thread-1:\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.5/site-packages/requests/packages/urllib3/response.py\", line 232, in _error_catcher\r\n    yield\r\n  File \"/usr/local/lib/python3.5/site-packages/requests/packages/urllib3/response.py\", line 314, in read\r\n    data = self._fp.read(amt)\r\n  File \"/usr/local/lib/python3.5/http/client.py\", line 448, in read\r\n    n = self.readinto(b)\r\n  File \"/usr/local/lib/python3.5/http/client.py\", line 488, in readinto\r\n    n = self.fp.readinto(b)\r\n  File \"/usr/local/lib/python3.5/socket.py\", line 575, in readinto\r\n    return self._sock.recv_into(b)\r\n  File \"/usr/local/lib/python3.5/ssl.py\", line 929, in recv_into\r\n    return self.read(nbytes, buffer)\r\n  File \"/usr/local/lib/python3.5/ssl.py\", line 791, in read\r\n    return self._sslobj.read(len, buffer)\r\n  File \"/usr/local/lib/python3.5/ssl.py\", line 575, in read\r\n    v = self._sslobj.read(len, buffer)\r\nsocket.timeout: The read operation timed out\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.5/site-packages/requests/models.py\", line 676, in generate\r\n    for chunk in self.raw.stream(chunk_size, decode_content=True):\r\n  File \"/usr/local/lib/python3.5/site-packages/requests/packages/urllib3/response.py\", line 357, in stream\r\n    data = self.read(amt=amt, decode_content=decode_content)\r\n  File \"/usr/local/lib/python3.5/site-packages/requests/packages/urllib3/response.py\", line 324, in read\r\n    flush_decoder = True\r\n  File \"/usr/local/lib/python3.5/contextlib.py\", line 77, in __exit__\r\n    self.gen.throw(type, value, traceback)\r\n  File \"/usr/local/lib/python3.5/site-packages/requests/packages/urllib3/response.py\", line 237, in _error_catcher\r\n    raise ReadTimeoutError(self._pool, None, 'Read timed out.')\r\nrequests.packages.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='video-edge-835ef0.ord02.hls.ttvnw.net', port=443): Read timed out.\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.5/threading.py\", line 914, in _bootstrap_inner\r\n    self.run()\r\n  File \"/usr/local/lib/python3.5/site-packages/streamlink/stream/segmented.py\", line 160, in run\r\n    self.write(segment, result)\r\n  File \"/usr/local/lib/python3.5/site-packages/streamlink/stream/hls.py\", line 111, in write\r\n    for chunk in res.iter_content(chunk_size):\r\n  File \"/usr/local/lib/python3.5/site-packages/requests/models.py\", line 683, in generate\r\n    raise ConnectionError(e)\r\nrequests.exceptions.ConnectionError: HTTPSConnectionPool(host='video-edge-835ef0.ord02.hls.ttvnw.net', port=443): Read timed out.\r\n```\r\n\r\nThis was happening regardless of python 2.7 or python 3.5 being used.\r\n\r\nThe following is in my $HOME/.streamlinkrc file:\r\n\r\n```\r\nplayer-continuous-http\r\ndefault-stream=best\r\nhls-segment-threads=10\r\n```\r\n\r\n(Also my twitch-oauth-token that I am not going to include here.)"},"comment":{"url":"https://api.github.com/repos/streamlink/streamlink/issues/comments/269464583","html_url":"https://github.com/streamlink/streamlink/issues/332#issuecomment-269464583","issue_url":"https://api.github.com/repos/streamlink/streamlink/issues/332","id":269464583,"user":{"login":"beardypig","id":16033421,"avatar_url":"https://avatars.githubusercontent.com/u/16033421?v=3","gravatar_id":"","url":"https://api.github.com/users/beardypig","html_url":"https://github.com/beardypig","followers_url":"https://api.github.com/users/beardypig/followers","following_url":"https://api.github.com/users/beardypig/following{/other_user}","gists_url":"https://api.github.com/users/beardypig/gists{/gist_id}","starred_url":"https://api.github.com/users/beardypig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beardypig/subscriptions","organizations_url":"https://api.github.com/users/beardypig/orgs","repos_url":"https://api.github.com/users/beardypig/repos","events_url":"https://api.github.com/users/beardypig/events{/privacy}","received_events_url":"https://api.github.com/users/beardypig/received_events","type":"User","site_admin":false},"created_at":"2016-12-28T11:27:29Z","updated_at":"2016-12-28T11:27:29Z","body":"Good points. That's an oversight on my part, I'll get a patch together for proper retry and resume support in the next week or so. It's relatively straightforward to do :-)"}}
{"actor":{"display_login":"beardypig"}}