Skip to content

Conversation

@somini
Copy link

@somini somini commented Oct 17, 2021

This is really only the first pass, but it works.

I couldn't fully understand the schema stuff, so I did it in the oldschool imperative way below.

There are no tests yet, here is an example:

URL: https://tviplayer.iol.pt/programa/o-bairro/53c6b3b73004dc006243db2b/video/5ba580900cf282952f047ac9

Output (
example1.txt
):

jsonData = {"duration":2653,"cover":"https://www.iol.pt/multimedia/oratvi/multimedia/imagem/id/5bbe3c700cf2be35e247d2db/","videoUrl":"https://streaming-vod3.iol.pt/vod/_definst_/7/a/c/9/smil:5ba580900cf282952f047ac9-L/playlist.m3u8","videoType":"Clip","liveType":"VOD","description":"","id":"5ba580900cf282952f047ac9","program":{"name":"O Bairro","epNum":"Sem Episódio","season":"5be06fc00cf2223b6a7aec23","id":"53c6b3b73004dc006243db2b","ep":"Sem Episódio","seasonNum":1},"title":"Episódio 1"};
                                    head.ready(function () {
                                        var pub = '/130294768/tviplayer/web/bairro/video/VIDEO';
                                        var pub_patrocinado = false ? "" : pub;
                                        $('#player').iolplayer({
                                            video: [jsonData],
                                            pub: pub_patrocinado,
                                            smartToken: "A12FFAZ7B226964436F6E746575646F223A2022354241353830393030434632383239353246303437414339222C227469706F436F6E746575646F223A2022766964656F222C22706C617461666F726D61223A2022776562222C226F726967656D223A2022747669706C61796572222C2270726F6772616D61223A202262616972726F222C22696455736572223A2022227D",
                                            autostart: false,
                                            project: "tviplayer",
                                            pageContentType: "VIDEO",
                                            videoRedirect: true,
                                            "skin": {
                                                "timeslider": {
                                                    "progress": "#fab432"
                                                }
                                            }
                                        });
                                    });

"videoUrl" has the important stuff, but we also require a token to append to that URL as query string.

This is really only the first pass, but it works.
@bastimeyer
Copy link
Member

Thanks for the PR. Before submitting a PR for a new plugin, you should ideally open a plugin request first, so the site can be reviewed according to the plugin request guidelines, otherwise you might waste your time with your PR.
https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#plugin-requests

This is a Portuguese TV site with live streams and VODs, right? The content is geo-blocked for me.

I'm not going top review the diff just yet, but I can already tell you that the validation schemas will need to get changed and that the HTTP session header updates are unnecessary. JSON data should be read as a whole and then properly validated and the data extracted from the schema. Streamlink also has utility methods for updating query strings.

@somini
Copy link
Author

somini commented Oct 24, 2021

Hi, sorry about the delay in responding to this.

That's understandable, I'll go through proper channels. I'll close this for now, and open a new issue to formally request it.

This is a Portuguese TV site with live streams and VODs, right? The content is geo-blocked for me.

This is correct, it's geo-blocked just as I feared.

@somini somini closed this Oct 24, 2021
@somini somini mentioned this pull request Oct 24, 2021
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants