Thanks to visit codestin.com
Credit goes to github.com

Skip to content

plugins.btv: fix #5701

Closed
SMNn1 wants to merge 2 commits into
streamlink:masterfrom
SMNn1:master
Closed

plugins.btv: fix #5701
SMNn1 wants to merge 2 commits into
streamlink:masterfrom
SMNn1:master

Conversation

@SMNn1

@SMNn1 SMNn1 commented Dec 4, 2023

Copy link
Copy Markdown

Fix to plugin btv.tv which was broken though changes on stream provider.
Plugin is now parsing the hls URL and starting it directly, instead of only throwing error.


return HLSStream.parse_variant_playlist(self.session, stream_url)

hls_url = update_scheme("hls://https://", stream_url, force=False)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update_scheme() doesn't make any sense here and needs to be removed:

  1. hls:// is the explicit scheme of Streamlink's HLS plugin, so that direct HLS playlist URL inputs can be handled whose path don't end with .m3u8.
    See https://github.com/streamlink/streamlink/blob/6.4.2/src/streamlink/plugins/hls.py#L13-L15
  2. update_scheme() does only apply the scheme to the stream URL if it's missing, which is not the case here, hence the reason why you didn't notice any issues with hls://. If you'd actually add hls:// to the stream URL, then requests couldn't find a matching adapter for this URL.

Comment on lines +66 to +67
streams = HLSStream.parse_variant_playlist(self.session, hls_url)
return streams or {"live": HLSStream(self.session, hls_url)}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you can see in #5698, the site started returning HLS multivariant playlists instead of HLS media playlists, so a fix was committed accordingly. The URL test cases returned valid streams (./script/test-plugin-urls.py btv), and they still do that now, I just checked it again.

Does your PR mean that this is not the case 100% of the time, and they return both kinds? You're saying that Streamlink is throwing errors. That shouldn't happen when trying to parse a multivariant playlist on a media playlist. The result should be an empty stream list.

@bastimeyer

Copy link
Copy Markdown
Member

Closing, since there hasn't been any response to my comments from two weeks ago.

The plugin is still working fine and I don't see any reason why an HLS media playlist fallback should be added when the site has switched to multivariant playlists

$ ./script/test-plugin-urls.py btv
:: Finding streams for URL: https://btvplus.bg/live
:: Found streams: 720p, 1080p, worst, best
:: Finding streams for URL: https://btvplus.bg/live/
:: Found streams: 720p, 1080p, worst, best
:: Finding streams for URL: https://www.btvplus.bg/live/
:: Found streams: 720p, 1080p, worst, best

@bastimeyer bastimeyer closed this Dec 17, 2023
@bastimeyer bastimeyer added unconfirmed plugin issue A Plugin does not work correctly labels Dec 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin issue A Plugin does not work correctly unconfirmed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants