Streamlinkproxy Python3 Only!

There are 266 replies in this Thread which was already clicked 27,918 times. The last Post () by pepsik.

  • bc is installed on my box

    Happy for you =). But your box is not decisive and I have to rely on the worst case, namely that it does not exist

    bc is a nice tool, however not on every image. I experience that recently. So to rely on bc is not a good solution, especially because there is no package in feed, so adding dependencies to install will not work.



    Streamlinkproxy in standalone usage looks like an alternative to streamlinksrv so I will be comparing those two. Default port is the same 8088.


    Zapping works the same, no noticeable speed difference. Unfortunately it doesn’t read streamlink configuration files and that very much limits functionality and rules out its use as an replacement at the moment. Nice error video. Some minor things like loglevel cannot be changed and playback with 4097 don’t work in cases when streamlinksrv works (youtube live is an example). I tried different boxes and result the same. 5002 is best to use here. Anyway didn’t found any advantages, maybe some specific host that I didn’t tried. I don't use E2m3u2bouquet so I can say nothing about that.

    Edited once, last by rpl ().

  • Unfortunately it doesn’t read streamlink configuration files

    It's not hard to add. In principle, I thought to make the main styreamlink settings (session options) in the form of a GUI accessible from the plugins menu ... But the parameters for specific add-on plugins can be passed element-wise to url.fragment and this does not require streamlink configuration files


    Example for https://streamlink.github.io/plugins.html#bbciplayer add-on

    Code
    http://localhost:port/https://www.bbc.co.uk/iplayer/episodes/p0frq6zd/champion?seriesId=p0frq798?&bbciplayer-username=xxxx&bbciplayer-password=xxxxx&bbciplayer-hd=1

    parameters passed to url.query are simply parsed and can be passed in proxy "HandleRequest" to the streamlink add-on plugin used to get a link to the video ... It's not difficult at all...

    Some minor things like loglevel cannot be changed

    The server code is so simple that I can't even imagine what to log there =)


    an alternative to streamlinksrv

    The difference is in more concise code =) and more or less correct implementation of chunked HTTP streaming - https://www.rfc-editor.org/rfc…2#field.transfer-encoding compare with how it is completely wrong implemented in streamlinksrv :upside down face:

  • UPDATE


    Added the ability to use parameters and their values for streamlink add-on plugins ... Download the plugin from the first post and reinstall using the --force-reinstall option


    A small instruction with examples on how to pass parameters and their values has been added to the first post

  • Unfortunately it doesn’t read streamlink configuration files

    It's not hard to add. In principle, I thought to make the main styreamlink settings (session options) in the form of a GUI accessible from the plugins menu ... But the parameters for specific add-on plugins can be passed element-wise to url.fragment and this does not require streamlink configuration files


    Example for https://streamlink.github.io/plugins.html#bbciplayer add-on

    Code
    http://localhost:port/https://www.bbc.co.uk/iplayer/episodes/p0frq6zd/champion?seriesId=p0frq798#bbciplayer-username=xxxx&bbciplayer-password=xxxxx&bbciplayer-hd=1

    parameters passed to url.fragment are simply parsed and can be passed in proxy "HandleRequest" to the streamlink add-on plugin used to get a link to the video ... It's not difficult at all...

    It is not about GUI and anything related to that. You missing the crucial info. Streamlink by design supports cli commands and configuration files and that is described in documentation. I will direct you to documentation as well https://streamlink.github.io/cli/config.html, but to the page where is described what I’m talking about. You don't need to pass parameters separately to each stream individual, that’s why streamlink supports configuration file for each plugin individual , or globally for all.



    An example
    In case of example e2 when you have root user boxes path looks like this
    /home/root/.config/streamlink/config.bbciplayer
    This path is home directory, and that why is included in settings backup in basically every image.

    That just works with streamlinksrv since many years with accordance to documentation. I actually created my configuration files five years ago and they still works, because this format didn’t changed. Adding login, password and for example proxy to each link is unnecessary, when you can do that collectivity in a file.

    Passing parameters also works with streamlinsrv and that can be used when specific streams need individual parameters becouse cli command can be handled by http HTTPServer. So those two methods were implemented. Don't see iprovment here as streamlinkproxy only one of those cases, but both are equqly important.


    Practical Example.


    You have 5 boxes, and want to use on them the same channel list prepared on PC editor. But due to device/streams limitations on service provider side you have to use separate account in each box. Then with passing parameters with url, you have to prepare 5 separate lists on PC editor, or create a script that will replace credentials each time the channel list is updated. With configuration files, no extra steps are necessary, you just sending list to those 5 boxes in the same time, and everything works because box have credentials stored seperatly.

    Quote

    I checked on OpenPli dev it works without problems .. it’s not at all clear why it wouldn’t work ...

    I also don’t know, only if I had more detailed log, but

    Quote

    The server code is so simple that I can't even imagine what to log there =)

    Maybe you see now the problem.

    Quote

    The difference is in more concise code =) and more or less correct implementation of chunked HTTP streaming -

    Less correct, more correct, the jury is always on. Debate never ends, ultimately whats matter is if it works or if it doesn’t work. Anyway could you post any practical example when improvements can be observed ?

  • Maybe you see now the problem.

    In general, there are no problems if you are at least at the minimum level able to read the python code from 30-40 lines .. what is there to debug? Judging by your comments about streamllink CLI - you are far from fluently Python ... I do not want to argue with you if you superficially own the subject of the dispute


    As for everything else - I posted an update where you can fully (at 100%) use any of the plugins offered by the "library" stramlink ... When I wrote about the GUI menu, I talked about the possibility of changing the GLOBAL settings for the streamlink session, which have NOTHING to do with the specific local parameters of this or that of the stramlink project plugins add-on.


    By the way ... I modified the code a little more, limiting the selection to stream types that do not require ffmpeg "processing" and now VOD broadcasts from youtube work fine and without any "gags" + threw out the extra request-files library from the streamlink/plugon/api/http_session.py code ... it's not at all clear why we need so much extra text from external library, if class FileAdapter can be easily implemented by overriding the BaseAdapter class of the requests library in the 40 lines

    Compare (provided you are able to understand python code) with requests_file.py code - https://github.com/streamlink/…packages/requests_file.py :exploding head:


    I will update streamlinkproxy tomorrow ... at the same time I will commit the solution to the steamlink branch on GitHub

  • How to know which plugins are installed. Alle the ones available here Plugins - Streamlink 5.5.1 documentation ? or do have I to add some in a specific directory ?

    I don't understand your question. The installation package of the plugin includes the latest "library" streamlink from GitHub ... It includes all add-on plugins described on the official web page - https://streamlink.github.io/plugins.html

  • Less correct, more correct, the jury is always on. Debate never ends, ultimately whats matter is if it works or if it doesn’t work. Anyway could you post any practical example when improvements can be observed ?

    The quality of the code is in its conciseness ... it is fashionable to write code that does the same thing in 140 and 40 lines ... From the compiler's point of view, 40 lines will always be executed faster than 140 ... an example a few posts above ... but you "measure" - "by eye" by clicking on the channels ... and do not use a disassembler to compare the speed of the code ... It's like putting your hand to your forehead instead of using a thermometer to take your temperature...


    p.s. "Less correct, more correct,...." - RFC 9112 written and approved as mandatory in order to adhere to it just like that if only it were? :beaming face with smiling eyes:

  • export PYTHON_VERSION=`python -c 'import sys; print(".".join(map(str, sys.version_info[0:2])))'`

    export PYTHON_VERSION_FULL=`python -c 'import sys; print(".".join(map(str, sys.version_info[0:3])))'`

  • export PYTHON_VERSION=`python -c 'import sys; print(".".join(map(str, sys.version_info[0:2])))'`

    export PYTHON_VERSION_FULL=`python -c 'import sys; print(".".join(map(str, sys.version_info[0:3])))'`

    With all due respect ... I understand these two lines ))) but I don't understand what they have to do with streamlinkporxy or streamlink "library"? :nerd face:

  • How to know which plugins are installed. Alle the ones available here Plugins - Streamlink 5.5.1 documentation ? or do have I to add some in a specific directory ?

    I don't understand your question. The installation package of the plugin includes the latest "library" streamlink from GitHub ... It includes all add-on plugins described on the official web page - https://streamlink.github.io/plugins.html

    Ok sorry I didn't understand that. I will ask the community for a new plugin for french channels from sfr provider if possible to exploit.

  • that was only because of python recognition in ipk script,

    anyway I call python binary in bash script .. what to parse python version from stdout, what to run python script .... in terms of hardware costs - comparable ... although 'import sys;' and executing a python script ... I think it "eats" more resources than awk


    p.s. I'm just a "perfectionist" and this is my problem :rolling on the floor laughing: I used to be an assembler programmer for the Motorola 68000 platform a very long time ago :face with tears of joy: And everything that is object-oriented is horror, in my "understanding"



    p.s.s. Yes! I'm oldskool, but not useless! (C) Terminator: Genesys

  • After a fresh OATV 7.3 installation, just installed streamlinkproxy and e2m3u2b latest versions. But I have problems with youtube urls.


    example:

    "http://localhost:8088/https://www.youtube.com/watch?v=gxG3pdKvlIs"


    a second streamlinkproxy python process is created but no ffmpeg process so no video is displayed


    Test with another url:

    "http://localhost:8088/https://www.france.tv/france-2/direct.html"


    the second python process is there and ffmpeg too, so I have the video.


    So for YT videos , had to install streamlinkwrapper and modify the url to replace http://localhost:8088/ by streamlink:// and videos are ok but streamlinkproxy is not used in this case, obviously.


    I have to test dailymotion videos to see the result.



    Edit:


    By chance, detected the case when I have black screen on a stream. I seems that the python process fall


    before the blackscreen

    Code
    root      2581     1  0 00:47 ?        00:00:00 python /etc/rc3.d/S99streamlinkproxy start
    root      2582     2  0 00:47 ?        00:00:00 [kworker/3:1H]
    root      2583     1  0 00:47 ?        00:00:00 /bin/sh /usr/bin/enigma2.sh
    root      2599  2555  0 00:47 pts/0    00:00:00 /bin/login
    root      2619  2583 17 00:47 ?        00:01:22 /usr/bin/enigma2
    root      2700  2599  0 00:47 pts/0    00:00:00 -bash
    root      2748  2529  0 00:48 ?        00:00:00 /usr/sbin/smbd
    root      3018  2529  0 00:54 ?        00:00:00 /usr/sbin/smbd
    root      3021  2581 54 00:55 ?        00:00:08 python /etc/rc3.d/S99streamlinkproxy start
    root      3030  3021  4 00:55 ?        00:00:00 /usr/bin/ffmpeg -nostats -y -i /tmp/streamlinkpipe-3021-1-9615 -i /tmp/streamlinkpipe-3021-2-4442 -c:v copy -c:a copy -map 0:v? -map 0:a? -map 1

    during the blackscreen (no ffmpeg process) and just one python process

    Code
    root      2581     1  0 00:47 ?        00:00:00 python /etc/rc3.d/S99streamlinkproxy start
    root      2582     2  0 00:47 ?        00:00:00 [kworker/3:1H]
    root      2583     1  0 00:47 ?        00:00:00 /bin/sh /usr/bin/enigma2.sh
    root      2599  2555  0 00:47 pts/0    00:00:00 /bin/login
    root      2619  2583  9 00:47 ?        00:02:50 /usr/bin/enigma2
    root      2700  2599  0 00:47 pts/0    00:00:00 -bash
    root      2748  2529  0 00:48 ?        00:00:00 /usr/sbin/smbd
    root      3046     2  0 00:55 ?        00:00:00 [kworker/u8:0]
    root      3058  2529  0 01:04 ?        00:00:00 /usr/sbin/smbd
    root      3162  2700 99 01:16 pts/0    00:00:00 ps -wwef

    and after the automatic action of relaunch by quarterpounder, the processes are back

    But who is responsible of the fall, the stream itself or streamlinkproxy...?

    Edited 6 times, last by jeepcook ().

  • example:

    "http://localhost:8088/https://www.youtube.com/watch?v=gxG3pdKvlIs"

    Снимок экрана 2023-07-03 в 07.19.29.pngСнимок экрана 2023-07-03 в 07.19.43.png

    Снимок экрана 2023-07-03 в 07.19.58.png

    What am I doing wrong and why does the same link work for me? Use exteplayer3 with streamproxy, I also wrote to you about this, but not on this forum thread ...

    So for YT videos , had to install streamlinkwrapper and modify the url

    streamwrapper is not a proxy, it is a code that returns a link to the player and the player is engaged in HLS parsing,

    streamproxy - gives the player a ready "stream of bytes" and uses for it streamlink library which "rakes" HLS, reads chunks, has its own "ring buffer", etc.



    By the way ... I modified the code a little more, limiting the selection to stream types that do not require ffmpeg "processing" and now VOD broadcasts from youtube work fine and without any "gags"

    I wrote this yesterday, did you read it? But this applies to VOD broadcasts youtube, live - as it worked, it still works

  • root 3173 3164 5 01:16 ? 00:00:00 /usr/bin/ffmpeg -nostats -y -i /tmp/streamlinkpipe-3164-1-5710 -i /tmp/streamlinkpipe-3164-2-6910 -c:v copy -c:a copy -map 0:v? -map 0:a? -map 1:a -f mpegts pipe:1

    In this case, with a probability of 90%, there was an hls-multi stream with several audio tracks ... There is nothing wrong with this. You simply have access to the choice of audio tracks by the "yellow" button on the RC ...

  • example:

    "http://localhost:8088/https://www.youtube.com/watch?v=gxG3pdKvlIs"

    What am I doing wrong and why does the same link work for me? Use exteplayer3 with streamproxy, I also wrote to you about this, but not on this forum thread ...

    OK, using gstreamer the stream is ko but using exteplayer3 i's now ok, I should do this test before writing here !

    (where did you write me about this , which forum?)


    By the way ... I modified the code a little more, limiting the selection to stream types that do not require ffmpeg "processing" and now VOD broadcasts from youtube work fine and without any "gags"

    I wrote this yesterday, did you read it? But this applies to VOD broadcasts youtube, live - as it worked, it still works

    I read that but you say "live - as it worked, it still works", but we don't have ffmpeg process anymore for live tv, not just for VOD broadcasts (A misunderstood of your sentence from my part?)



    Test with another url:

    "http://localhost:8088/https://www.france.tv/france-2/direct.html"


    ???

    This was just to show you a case where the proxy was ok with another url than a youtube one, to show you that my image setup is OK.

    But if you read the edit part of the post you can see I have recurring blackscreens for this stream (and all from france.tv). I don't know if it's a reader bug, streamlinkproxy fail or a stream bug. Btw If I watch the channel directly with their website, there are no blackscreen.

    A way to log these errors perhaps?

    Edited once, last by jeepcook ().

  • Today streamlinkproxy is unable to start, I have this error. Is this due to a bad update of streamlink?



    streamlink - 5.5.1-git4744+20c8b6b_0.0-git11+9d95a02-r0

    Edited once, last by jeepcook ().

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!