pmrowla / streamlink-plugins

custom streamlink plugins
BSD 2-Clause "Simplified" License
32 stars 7 forks source link

eplus: embedded external player #26

Open pzhlkj6612 opened 2 months ago

pzhlkj6612 commented 2 months ago

Hi.

That's a Uliza player. I don't know if this is the first time to embed an external player. See https://github.com/yt-dlp/yt-dlp/pull/10995 for a little more details.

pzhlkj6612 commented 2 months ago

The log:

[plugins.eplus][debug] delivery_status = PREPARING, archive_mode = OFF
[plugins.eplus][error] This event has not started yet
[cli][info] Waiting for streams, retrying every 120.0 second(s)
[plugins.eplus][info] Getting auth status
[plugins.eplus][debug] delivery_status = STARTED, archive_mode = OFF
[utils.l10n][debug] Language code: en_US
[stream.hls.m3u8][warning] Malformed HLS Playlist. Expected #EXTM3U, but got <!doctype html>
[cli][error] Failed to parse playlist: Missing #EXTM3U header
[plugins.eplus][info] Getting auth status
[plugins.eplus][debug] delivery_status = STARTED, archive_mode = OFF
[utils.l10n][debug] Language code: en_US
[stream.hls.m3u8][warning] Malformed HLS Playlist. Expected #EXTM3U, but got <!doctype html>
[cli][error] Failed to parse playlist: Missing #EXTM3U header

.

pmrowla commented 2 months ago

Took a quick glance at it and I don't think streamlink has an equivalent to yt-dlp's url_result() but it should be possible to just create the right plugin instance and call _get_streams() from there

Something along the lines of

class Eplus(Plugin):
    ...
    def _get_streams(self):
        ...
        if is_uliza_stream:
            self.session.http.headers.clear()  # clear eplus origin/referer (unless uliza needs the eplus origin)
            pia_plugin = PIAULIZAPortal(self.session, uliza_url)
            return pia_plugin._get_streams()
pmrowla commented 2 months ago

Actually looking at your yt-dlp PR, you can probably also just return the parsed m3u8 (without the eplus HLS stream handler) if it's just a direct link to a pia hosted m3u8.

pzhlkj6612 commented 2 months ago

you can probably also just return the parsed m3u8 (without the eplus HLS stream handler) if it's just a direct link to a pia hosted m3u8.

Hmm, I don't understand. I cannot get a pia hosted m3u8 URL.

pmrowla commented 2 months ago

I might have misunderstood your comments in the other thread, but when you asked

Am I allow to send the m3u8 URL to self.url_result()

I thought you meant in this case it was an m3u8 URL from pia and you wanted yt-dlp to reload it using the pia plugin

pzhlkj6612 commented 2 months ago

I might have misunderstood your comments in the other thread, but when you asked

Am I allow to send the m3u8 URL to self.url_result()

I thought you meant in this case it was an m3u8 URL from pia and you wanted yt-dlp to reload it using the pia plugin

OK, now I get it.

That m3u8 URL is still the one provided by eplus itself (actually, AWS CloudFront). At that time, I didn't remember if yt-dlp had the ability to handle m3u8 URLs directly, so asked the question.