Skip to content

Conversation

@back-to
Copy link
Collaborator

@back-to back-to commented Aug 6, 2021

Streamlink can crash with streamlink.exceptions.StreamError since
193c5c6


Test URL

https://gist.githubusercontent.com/back-to/514946aad6ce17586d992d05ee42673c/raw/521fe8dd25200042c71f1756b3f61cdd66093a8d/hlsva.m3u8


streamlink 2.2.0

[cli][debug] Streamlink: 2.2.0
[cli][info] Found matching plugin hls for URL hlsva.m3u8
[cli][info] Available streams: 180p (worst, best)
[cli][info] Opening stream: 180p (hls)
[cli][error] Try 1/1: Could not open stream <HLSStream('test_1.m3u8', 'hlsva.m3u8')>
(Could not open stream: Attempted to play a variant playlist, use 'hls://test_1.m3u8' instead)
error: Could not open stream <HLSStream('test_1.m3u8', 'hlsva.m3u8')>, tried 1 times, exiting

streamlink 2.3.0

Ref #3895

[cli][debug] Streamlink: 2.3.0
[cli][info] Found matching plugin hls for URL hlsva.m3u8
[cli][info] Available streams: 180p (worst, best)
[cli][info] Opening stream: 180p (hls)
[stream.hls][debug] Reloading playlist
[cli][debug] Pre-buffering 8192 bytes
Exception in thread Thread-HLSStreamWorker:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "src/streamlink/stream/segmented.py", line 84, in run
    for segment in self.iter_segments():
  File "src/streamlink/stream/hls.py", line 325, in iter_segments
    self.reload_playlist()
  File "src/streamlink/stream/hls.py", line 253, in reload_playlist
    raise StreamError("Attempted to play a variant playlist, use "
streamlink.exceptions.StreamError: Attempted to play a variant playlist, use 'hls://test_1.m3u8' instead
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[cli][error] Try 1/1: Could not open stream <HLSStream('test_1.m3u8', 'hlsva.m3u8')>
(Failed to read data from stream: Read timeout)
error: Could not open stream <HLSStream('test_1.m3u8', 'hlsva.m3u8')>, tried 1 times, exiting
[cli][info] Closing currently open stream...

After PR

[cli][debug] Streamlink: 2.3.0+4.gc3f390a.dirty
[cli][info] Found matching plugin hls for URL hlsva.m3u8
[cli][info] Available streams: 180p (worst, best)
[cli][info] Opening stream: 180p (hls)
[stream.hls][debug] Reloading playlist
[cli][debug] Pre-buffering 8192 bytes
[stream.hls][error] Attempted to play a variant playlist, use 'hls://test_1.m3u8' instead
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[cli][error] Try 1/1: Could not open stream <HLSStream('test_1.m3u8', 'hlsva.m3u8')> (No data returned from stream)
error: Could not open stream <HLSStream('test_1.m3u8', 'hlsva.m3u8')>, tried 1 times, exiting
[cli][info] Closing currently open stream...
streamlink https://www.raiplay.it/dirette/raiyoyo

[cli][debug] Streamlink: 2.3.0+4.gc3f390a.dirty
[cli][info] Found matching plugin raiplay for URL https://www.raiplay.it/dirette/raiyoyo
[plugins.raiplay][debug] Found JSON URL: https://www.raiplay.it/dirette/raiyoyo.json
[plugins.raiplay][debug] Found stream URL: https://mediapolis.rai.it/relinker/relinkerServlet.htm?cont=746899
[utils.l10n][debug] Language code: en_US
[cli][info] Available streams: 396p (worst), 504p, 576p (best)
[cli][info] Opening stream: 576p (hls)
[stream.hls][debug] Reloading playlist
[cli][debug] Pre-buffering 8192 bytes
[stream.hls][error] Unable to open URL: ... (403 Client Error: Forbidden for url: ...)
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[cli][error] Try 1/1: Could not open stream <HLSStream('...', '...')> (No data returned from stream)
error: Could not open stream <HLSStream('...', '...')>, tried 1 times, exiting
[cli][info] Closing currently open stream...

Ref #3895 (comment) for error 1

…iter_segments

Streamlink can crash with `streamlink.exceptions.StreamError` since
streamlink@193c5c6

---

Test URL

https://gist.githubusercontent.com/back-to/514946aad6ce17586d992d05ee42673c/raw/521fe8dd25200042c71f1756b3f61cdd66093a8d/hlsva.m3u8

---

streamlink 2.2.0

```
[cli][debug] Streamlink: 2.2.0
[cli][info] Found matching plugin hls for URL hlsva.m3u8
[cli][info] Available streams: 180p (worst, best)
[cli][info] Opening stream: 180p (hls)
[cli][error] Try 1/1: Could not open stream <HLSStream('test_1.m3u8', 'hlsva.m3u8')>
(Could not open stream: Attempted to play a variant playlist, use 'hls://test_1.m3u8' instead)
error: Could not open stream <HLSStream('test_1.m3u8', 'hlsva.m3u8')>, tried 1 times, exiting
```

streamlink 2.3.0

```
[cli][debug] Streamlink: 2.3.0
[cli][info] Found matching plugin hls for URL hlsva.m3u8
[cli][info] Available streams: 180p (worst, best)
[cli][info] Opening stream: 180p (hls)
[stream.hls][debug] Reloading playlist
[cli][debug] Pre-buffering 8192 bytes
Exception in thread Thread-HLSStreamWorker:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "src/streamlink/stream/segmented.py", line 84, in run
    for segment in self.iter_segments():
  File "src/streamlink/stream/hls.py", line 325, in iter_segments
    self.reload_playlist()
  File "src/streamlink/stream/hls.py", line 253, in reload_playlist
    raise StreamError("Attempted to play a variant playlist, use "
streamlink.exceptions.StreamError: Attempted to play a variant playlist, use 'hls://test_1.m3u8' instead
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[cli][error] Try 1/1: Could not open stream <HLSStream('test_1.m3u8', 'hlsva.m3u8')>
(Failed to read data from stream: Read timeout)
error: Could not open stream <HLSStream('test_1.m3u8', 'hlsva.m3u8')>, tried 1 times, exiting
[cli][info] Closing currently open stream...
```

After PR

```
[cli][debug] Streamlink: 2.3.0+4.gc3f390a.dirty
[cli][info] Found matching plugin hls for URL hlsva.m3u8
[cli][info] Available streams: 180p (worst, best)
[cli][info] Opening stream: 180p (hls)
[stream.hls][debug] Reloading playlist
[cli][debug] Pre-buffering 8192 bytes
[stream.hls][error] Attempted to play a variant playlist, use 'hls://test_1.m3u8' instead
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[cli][error] Try 1/1: Could not open stream <HLSStream('test_1.m3u8', 'hlsva.m3u8')> (No data returned from stream)
error: Could not open stream <HLSStream('test_1.m3u8', 'hlsva.m3u8')>, tried 1 times, exiting
[cli][info] Closing currently open stream...
```

```
streamlink https://www.raiplay.it/dirette/raiyoyo

[cli][debug] Streamlink: 2.3.0+4.gc3f390a.dirty
[cli][info] Found matching plugin raiplay for URL https://www.raiplay.it/dirette/raiyoyo
[plugins.raiplay][debug] Found JSON URL: https://www.raiplay.it/dirette/raiyoyo.json
[plugins.raiplay][debug] Found stream URL: https://mediapolis.rai.it/relinker/relinkerServlet.htm?cont=746899
[utils.l10n][debug] Language code: en_US
[cli][info] Available streams: 396p (worst), 504p, 576p (best)
[cli][info] Opening stream: 576p (hls)
[stream.hls][debug] Reloading playlist
[cli][debug] Pre-buffering 8192 bytes
[stream.hls][error] Unable to open URL: ... (403 Client Error: Forbidden for url: ...)
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[cli][error] Try 1/1: Could not open stream <HLSStream('...', '...')> (No data returned from stream)
error: Could not open stream <HLSStream('...', '...')>, tried 1 times, exiting
[cli][info] Closing currently open stream...
```
@bastimeyer bastimeyer merged commit fae030f into streamlink:master Aug 6, 2021
@back-to back-to deleted the HLS_StreamError branch August 7, 2021 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants