GithubHelp home page GithubHelp logo

liveproxy's Introduction

LiveProxy

LiveProxy can redirect Livestreams to your favorite player on a lot of devices.

INSTALLATION

pip as user

# Latest pip version:
python3 -m pip install --upgrade liveproxy

# Latest dev version:
python3 -m pip install --upgrade git+https://github.com/back-to/liveproxy.git

pip as root

# Latest pip version:
sudo -H python3 -m pip install --upgrade liveproxy

# Latest dev version:
sudo -H python3 -m pip install --upgrade git+https://github.com/back-to/liveproxy.git

URL-GUIDE

Tutorial

First, start LiveProxy on your system.

$ liveproxy
[main][INFO] For LiveProxy support visit https://github.com/back-to/liveproxy
[main][INFO] Starting server: 127.0.0.1 on port 53422

host and port can be changed with --host / --port

$ liveproxy --host 0.0.0.0 --port 12345
[main][INFO] For LiveProxy support visit https://github.com/back-to/liveproxy
[main][INFO] Starting server: 0.0.0.0 on port 12345

Now that LiveProxy is running, you will have to create a valid URL.

For the examples here, 53422 is used as default port.

CMD

If needed, you can use quote for special characters https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote

http://127.0.0.1:53422/cmd/COMMANDS/

Example for streamlink https://www.youtube.com/user/france24/live best

http://127.0.0.1:53422/cmd/streamlink https://www.youtube.com/user/france24/live best/

Example for yt-dlp https://www.youtube.com/user/france24/live

http://127.0.0.1:53422/cmd/yt-dlp https://www.youtube.com/user/france24/live/

Base64

You will need to base64 encode your used commands.

Streamlink

http://127.0.0.1:53422/base64/STREAMLINK-COMMANDS/

Example for streamlink https://www.youtube.com/user/france24/live best

http://127.0.0.1:53422/base64/c3RyZWFtbGluayBodHRwczovL3d3dy55b3V0dWJlLmNvbS91c2VyL2ZyYW5jZTI0L2xpdmUgYmVzdA==/

Youtube-DL

http://127.0.0.1:53422/base64/YOUTUBE-DL-COMMANDS/

Example for youtube-dl https://www.youtube.com/user/france24/live

http://127.0.0.1:53422/base64/eW91dHViZS1kbCBodHRwczovL3d3dy55b3V0dWJlLmNvbS91c2VyL2ZyYW5jZTI0L2xpdmU=/

YT-DLP

http://127.0.0.1:53422/base64/YT-DLP-COMMANDS/

Example for yt-dlp https://www.youtube.com/user/france24/live

http://127.0.0.1:53422/base64/eXQtZGxwIGh0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3VzZXIvZnJhbmNlMjQvbGl2ZQ==/

liveproxy's People

Contributors

back-to avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

liveproxy's Issues

Allowed IP

Hi,

Thanks i have been using this to restream some stuff from twitch and Dailymotion.

Now i notice some streams that i have not started are running in background.

Anyone who has my port and IP can start pulling streams.
Can we implement option like.
Allowed US : Only allowed user-agents allowed.
Allowed IP: Only allow client to play if clients ip is in allowed list.

Also i have a custom made yt-dlp i.e yt-pro
now liveproxy doesn't understand yt-pro and solutions.

Simple Web UI with URL drop field for headless server?

Hi, FOA, thanks a lot for this amazing complement to streamlink.
The addition of the CMD interface is amazing as it simplifies liveproxy a lot for using it remotely (ie browsing for sites on a client, and then launching liveproxy/streamlink without having to convert to base64).

Going one step further in simplify this use case, would it be possible to implement a mini/simple web UI with a drop field to just paste the desired URL for liveproxy to launch it with some predetermined params? (ie. in my headless case --player-external-http params)

Thanks again.

base64 TypeError: Incorrect padding

liveproxy version 0.3.0

base64 encoded command

c3RyZWFtbGluayAtLWh0dHBzLXByb3h5ICJzb2NrczVoOi8vMTkyLjE2OC4yLjE6MTA4MCIgaHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj15azJDVWpieXlRWSBiZXN0

will cause error

Exception happened during processing of request from ('192.168.2.185', 8770)
Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 596, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/local/lib/python2.7/dist-packages/liveproxy/server.py", line 589, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.7/SocketServer.py", line 652, in __init__
    self.handle()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
    self.handle_one_request()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
    method()
  File "/usr/local/lib/python2.7/dist-packages/liveproxy/server.py", line 574, in do_GET
    arglist = shlex.split(base64.b64decode(base64_path[2]).decode('UTF-8'))
  File "/usr/lib/python2.7/base64.py", line 78, in b64decode
    raise TypeError(msg)
TypeError: Incorrect padding
----------------------------------------
----------------------------------------
Exception happened during processing of request from ('192.168.2.185', 8771)
Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 596, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/local/lib/python2.7/dist-packages/liveproxy/server.py", line 589, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.7/SocketServer.py", line 652, in __init__
    self.handle()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
    self.handle_one_request()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
    method()
  File "/usr/local/lib/python2.7/dist-packages/liveproxy/server.py", line 574, in do_GET
    arglist = shlex.split(base64.b64decode(base64_path[2]).decode('UTF-8'))
  File "/usr/lib/python2.7/base64.py", line 78, in b64decode
    raise TypeError(msg)
TypeError: Incorrect padding
----------------------------------------

Liveproxy 1.0.0

hello dear @back-to

i use LiveProxy 1.0.0 on enigma2 system

What do you think could be the source of the following problem?

Traceback (most recent call last): File "/usr/bin/liveproxy", line 10, in <module> sys.exit(main()) File "/usr/lib/python2.7/site-packages/liveproxy/main.py", line 117, in main httpd = ThreadedHTTPServer((HOST, PORT), HTTPRequest) File "/usr/lib/python2.7/SocketServer.py", line 420, in __init__ File "/usr/lib/python2.7/BaseHTTPServer.py", line 108, in server_bind File "/usr/lib/python2.7/SocketServer.py", line 434, in server_bind File "/usr/lib/python2.7/socket.py", line 228, in meth socket.error: [Errno 125] Address already in use

CElementTree causes exception when used in plugin

Hi @back-to, this is the same bug I was trying to explain here streamlink/streamlink#2366.

I am able to reproduce the behaviour on a clean Leia 18.1 install and with your script.module.streamlink v 1.0.0 installed from your repo. When trying to call a plugin that parses XML with ElementTree, it breaks when calling the compiled version CElelementTree in utils_init_.py.

The detailed error with url http://www.rtve.es/directo/canal-24h is:

DEBUG: Traceback (most recent call last):
DEBUG:   File "\plugin.video.sltester\test.py", line 51, in PLAY
DEBUG:     streams = plugin.streams()
DEBUG:   File "\script.module.streamlink\resources\lib\streamlink\plugin\plugin.py", line 323, in streams
DEBUG:     ostreams = list(ostreams)
DEBUG:   File "\script.module.streamlink\resources\lib\streamlink\plugins\rtve.py", line 142, in _get_streams
DEBUG:     stream_data = self.zclient.get_cdn_list(content_id, schema=self.cdn_schema)
DEBUG:   File "\script.module.streamlink\resources\lib\streamlink\plugins\rtve.py", line 50, in get_cdn_list
DEBUG:     return schema.validate(data)
DEBUG:   File "\script.module.streamlink\resources\lib\streamlink\plugin\api\validate.py", line 482, in validate
DEBUG:     return validate(self.schema, value)
DEBUG:   File "\script.module.singledispatch\lib\singledispatch.py", line 210, in wrapper
DEBUG:     return dispatch(args[0].__class__)(*args, **kw)
DEBUG:   File "\script.module.streamlink\resources\lib\streamlink\plugin\api\validate.py", line 334, in validate_all
DEBUG:     value = validate(schema, value)
DEBUG:   File "\script.module.singledispatch\lib\singledispatch.py", line 210, in wrapper
DEBUG:     return dispatch(args[0].__class__)(*args, **kw)
DEBUG:   File "\script.module.streamlink\resources\lib\streamlink\plugin\api\validate.py", line 342, in validate_transform
DEBUG:     return schema.func(value)
DEBUG:   File "\script.module.streamlink\resources\lib\streamlink\utils\__init__.py", line 100, in parse_xml
DEBUG:     raise exception("Unable to parse {0}: {1} ({2})".format(name, err, snippet))
DEBUG: PluginError: Unable to parse XML: 'NoneType' object is not callable ("<?xml version='1.0'?><quality><pre ...)
DEBUG: [StreamLink] An error occured: Unable to parse XML: 'NoneType' object is not callable ("<?xml version='1.0'?><quality><pre ...)

When commenting out the compiled library all is fine. And it seems this problem has been around for some time: https://forum.kodi.tv/showthread.php?tid=185315.

I made a small addon for testing: SL RTVE Plugin tester

Thanks in advance for checking.

Jx-

streams stops and restarts automatically if the useragent is User-Agent: Lavf/60.16.100

I have a video player that uses User-Agent: Lavf/60.16.100. The stream restarts every two minutes and the portal also starts and stops streams

[server.ba648][INFO] User-Agent: Lavf/60.16.100
[server.ba648][INFO] Client: ('192.168.0.118', 50621)
[server.ba648][INFO] Address: 192.168.0.118
[server.ba648][DEBUG] Video-Software: C:\Program Files\Streamlink\bin\streamlink.EXE
[server.ba648][DEBUG] ['streamlink', 'http://example.com/playlist.m3u8', 'best', '--ffmpeg-fout', 'mpegts', '--stdout', '--loglevel', 'none']
[server.ba648][INFO] Stream started ba648
[server.ba664][INFO] User-Agent: Lavf/60.16.100
[server.ba664][INFO] Client: ('192.168.0.118', 50622)
[server.ba664][INFO] Address: 192.168.0.118
[server.ba664][DEBUG] Video-Software: C:\Program Files\Streamlink\bin\streamlink.EXE
[server.ba664][DEBUG] ['streamlink', 'http://example.com/playlist.m3u8', 'best', '--ffmpeg-fout', 'mpegts', '--stdout', '--loglevel', 'none']
[server.ba664][INFO] Stream started ba664
[server.ba648][INFO] Stream ended ba648
[server.ba664][INFO] Stream ended ba664

Liveproxy does not work with yt-dlp on the latest version of Python 3.11.7.

  $ liveproxy --port 4444 --loglevel "DEBUG"
  [main][INFO] For LiveProxy support visit https://github.com/back-to/liveproxy
  [main][DEBUG] OS:         Linux-6.5.13-7-MANJARO-x86_64-with-glibc2.39
  [main][DEBUG] Python:     3.11.7
  [main][DEBUG] LiveProxy:  2.1.0.dev4
  [main][INFO] Starting server: 127.0.0.1 on port 4444
  [server.94316][INFO] User-Agent: libmpv
  [server.94316][INFO] Client: ('127.0.0.1', 35346)
  [server.94316][INFO] Address: 127.0.0.1
  [server.94316][DEBUG] Video-Software: /home/junio/streamlink/venv/bin/yt-dlp
  [server.94316][DEBUG] ['yt-dlp', 'https://www.youtube.com/watch?v=318-eZUSK8Y', '--stdout', '--loglevel', 'none']
  [server.94316][INFO] Stream started 94316
  [server.94316][INFO] Stream ended 94316
  [server.94317][INFO] User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36
  [server.94317][INFO] Client: ('127.0.0.1', 35362)
  [server.94317][INFO] Address: 127.0.0.1
  [server.94317][DEBUG] Video-Software: /home/junio/streamlink/venv/bin/yt-dlp
  [server.94317][DEBUG] ['yt-dlp', 'https://www.youtube.com/watch?v=318-eZUSK8Y', '--stdout', '--loglevel', 'none']
  [server.94317][INFO] Stream started 94317
  [server.94317][INFO] Stream ended 94317
  
  $ mpv --hwdec=auto 'http://127.0.0.1:4444/base64/eXQtZGxwIGh0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9MzE4LWVaVVNLOFkK/'
  [ffmpeg] http: Stream ends prematurely at 0, should be 18446744073709551615
  Failed to recognize file format.
  Exiting... (Errors when loading file)

System information:

$ lsb_release -a
LSB Version:    n/a
Distributor ID: ManjaroLinux
Description:    Manjaro Linux
Release:        23.1.3
Codename:       Vulcan

> but when i open it using streamlink it returns content from the past because segments are cached for 24 hours

but when i open it using streamlink it returns content from the past because segments are cached for 24 hours

if it is an issue with streamlink, report it there
https://github.com/streamlink/streamlink/issues/new/choose

i know vlc via command line allows for output to stdout

share an example

Originally posted by @back-to in #32 (comment)

I know for sure its an issue with streamlink but its more todo with the way the mpd is is layed out

what i would like to know is would it be possible to add vlc as a program for usage by this software as i assume it may take streamlink sometime to fix the issue if even ever but i know for sure vlc works perfect so if possible to use that then it fixies the issue right away and expands the script to work with more systems and provides more options

standard vlc output is just like streamlink and youtube-dl

vlc {INPUT} --sout="#std{mux=mp4,access=file,dst=-}"

Seek in video

Hi @back-to,
Is it possible to add support for seek in video?
When I open YouTube video in mpv+youtube-dl (actually SMPlayer but it doesn't matter) I can jump to arbitrary timestamp and video starts to play on that timestamp almost immediately.
When I open the very same video using LiveProxy's url and jump to the same timestamp video hangs. It made sense when there was only live streaming using streamlink. But with youtube-dl support it's natural to select timestamp in video.

More details in logs

Hello,

Is that possible to get more details in liveproxy's logs (when using "service liveproxy status" command for example) ? I would need to know which URLs have been opened using liveproxy.

Currently, we only have these infos :

fรฉvr. 22 05:56:12 SERVER IP liveproxy.sh[484]: [server.5a06c][INFO] User-Agent: CLIENT_USERAGENT
fรฉvr. 22 05:56:12 SERVER IP liveproxy.sh[484]: [server.5a06c][INFO] Client: ('CLIENT_IP', 38294)
fรฉvr. 22 05:56:12 SERVER IP liveproxy.sh[484]: [server.5a06c][INFO] Address: CLIENT_IP
fรฉvr. 22 05:56:12 SERVER IP liveproxy.sh[484]: [server.5a06c][INFO] Stream started xxxx
fรฉvr. 22 05:56:14 SERVER IP liveproxy.sh[484]: [server.5a06c][INFO] Stream ended xxxx

Is it possible to know which URL was opened by the client (http://SERVER_IP:53422/cmd/streamlink%20__URL__%20__PARAMETERS__) ?

Thanks!

Any plans to make this an Android App?

Would it be possible to convert this to an android application, where you can use the androids built in Share system to send video links to streamlink?

Streams stop instantly

Ok so i am using this on a custom project to convert my signals from a few of my recivers into stream supported for web streaming via my own custom web player

I have a cheap pc converted into a ubuntu server that has live proxy on it when i open ssh i can start liveproxy and everything runs as normal but the moment i close the ssh session the proxy stops

to save my self constantly having to login to ssh to start and stop the proxy i have decided to add a buttoninto my web player using jquery and php to handel starting the proxy using exec in php the proxy seems to start fine shows as active in terminal and outputs fine to the log file i have set

but when i start a stream it says its starting then instantly stops and thats the end of that as its a local server i do have streamproxy running as root so i dont see it being a permissions issue.

when i enable debug loggin it dosent really print out much more information than

[server.8b82f][INFO] User-Agent: VLC/3.0.16 LibVLC/3.0.16 [server.8b82f][INFO] Client: ('00.00.000.000', 55836) [server.8b82f][INFO] Address: 00.00.000.000 [server.8b82f][DEBUG] Video-Software: /usr/local/bin/streamlink [server.8b82f][DEBUG] ['streamlink', 'http://localhost/device/tbsocta/1f7b8a15201545c6a10d5b50db', 'best', '--stdout', '--loglevel', 'none'] [server.8b82f][INFO] Stream started 8b82f [server.8b82f][DEBUG] Traceback (most recent call last): [server.8b82f][DEBUG] File "/usr/local/bin/streamlink", line 7, in <module> [server.8b82f][INFO] Stream ended 8b82f

as it works fine in ssh i am guessing its because it starting in php using exec so would it be possible to demon this project so itall ways runs in the background and then i dont need to try enable it this way

Kodi support, mpv for m3u8 link changes resolution?

Hey back-to !

Stumbled here googling...

  1. My main concern is converting video sources, e.g. youtube, to run on VLC and Kodi via .m3u/8 conversion or other. And then avoiding link changes if possible !

I read on Reddit that streamlink set to mpv will handle any m3u8 link changes on the fly:
https://www.reddit.com/r/commandline/comments/g4y0uv/create_m3u_from_permanent_youtube_streaming_link/fo0yprf/

  1. So how can I set this up using liveproxy on Kodi 18/19, and for VLC on Windows PC?
  2. Is there a way to reduce (youtube/ other site?) streaming delays?

Cheers,
Shippy.

youtube-dl failing invocation

Hi, FOA, thanks for this excellent complement to streaming programs.
I'm having an issue with playing any stream via youtube-dl, as it fails right away (same url plays ok with streamlink).

#EXTM3U
#EXTINF:-1,Arte FR STLK
streamlink https://www.arte.tv/fr/direct/ 720p,720p_alt,best
#EXTINF:-1,France24 STLK
streamlink https://www.youtube.com/user/france24/live best
#EXTINF:-1 tvg-id="EuroNews" tvg-name="EuroNews",Euronews STLK
streamlink https://www.euronews.com/live best
#EXTINF:-1,France24 YTDL
youtube-dl https://www.youtube.com/user/france24/live
#EXTINF:-1,Starbase live YTDL
youtube-dl https://www.youtube.com/watch?v=mhJRzQsLZGg
#EXTINF:-1,Starbase live STLK
streamlink https://www.youtube.com/watch?v=mhJRzQsLZGg best

Converted via liveproxy:

#EXTM3U
#EXTINF:-1,Arte FR STLK
http://192.168.1.149:53422/base64/c3RyZWFtbGluayBodHRwczovL3d3dy5hcnRlLnR2L2ZyL2RpcmVjdC8gNzIwcCw3MjBwX2FsdCxiZXN0/
#EXTINF:-1,France24 STLK
http://192.168.1.149:53422/base64/c3RyZWFtbGluayBodHRwczovL3d3dy55b3V0dWJlLmNvbS91c2VyL2ZyYW5jZTI0L2xpdmUgYmVzdA==/
#EXTINF:-1 tvg-id="EuroNews" tvg-name="EuroNews",Euronews STLK
http://192.168.1.149:53422/base64/c3RyZWFtbGluayBodHRwczovL3d3dy5ldXJvbmV3cy5jb20vbGl2ZSBiZXN0/
#EXTINF:-1,France24 YTDL
http://192.168.1.149:53422/base64/eW91dHViZS1kbCBodHRwczovL3d3dy55b3V0dWJlLmNvbS91c2VyL2ZyYW5jZTI0L2xpdmU=/
#EXTINF:-1,Starbase live YTDL
http://192.168.1.149:53422/base64/eW91dHViZS1kbCBodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PW1oSlJ6UXNMWkdn/
#EXTINF:-1,Starbase live STLK
http://192.168.1.149:53422/base64/c3RyZWFtbGluayBodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PW1oSlJ6UXNMWkdnIGJlc3Q=/

Pgm output for the Starbase Live entries (just the streamlink one works) and then France24 YTDL:

$ liveproxy --host 0.0.0.0 --loglevel DEBUG            
[main][INFO] For LiveProxy support visit https://github.com/back-to/liveproxy
[main][DEBUG] OS:         Linux-5.4.72-v7+-armv7l-with-debian-10.10
[main][DEBUG] Python:     3.7.3
[main][DEBUG] LiveProxy:  2.0.0
[main][INFO] Starting server: 0.0.0.0 on port 53422
[server.7fb19][INFO] User-Agent: VLC/3.0.16 LibVLC/3.0.16
[server.7fb19][INFO] Client: ('192.168.1.100', 53161)
[server.7fb19][INFO] Address: 192.168.1.100
[server.7fb19][DEBUG] Video-Software: /home/pi/.local/bin/streamlink
[server.7fb19][INFO] Stream started 7fb19
[server.7fb4f][INFO] User-Agent: VLC/3.0.16 LibVLC/3.0.16
[server.7fb4f][INFO] Client: ('192.168.1.100', 53162)
[server.7fb4f][INFO] Address: 192.168.1.100
[server.7fb4f][DEBUG] Video-Software: /home/pi/.local/bin/youtube-dl
[server.7fb4f][INFO] Stream started 7fb4f
[server.7fb19][INFO] Detected remote disconnect
[server.7fb19][INFO] Stream ended 7fb19
[server.7fb4f][DEBUG] Usage: youtube-dl [OPTIONS] URL [URL...]
[server.7fb4f][DEBUG]
[server.7fb4f][INFO] Stream ended 7fb4f
[server.7fce8][INFO] User-Agent: VLC/3.0.16 LibVLC/3.0.16
[server.7fce8][INFO] Client: ('192.168.1.100', 53174)
[server.7fce8][INFO] Address: 192.168.1.100
[server.7fce8][DEBUG] Video-Software: /home/pi/.local/bin/youtube-dl
[server.7fce8][INFO] Stream started 7fce8
[server.7fce8][DEBUG] Usage: youtube-dl [OPTIONS] URL [URL...]
[server.7fce8][DEBUG]
[server.7fce8][INFO] Stream ended 7fce8

I can't see liveproxy full invocation of youtube-dl line, but the generic log entry Usage: youtube-dl [OPTIONS] URL [URL...] makes me suspect of an argument out of place or missing.
Thanks in advance!

Create links for youtube-dl commands

Hi!
LiveProxy can convert m3u files encoding streamlink <url> commands to LiveProxy base64 urls. Some time ago was added support for base64 generated from youtube-dl commands.
How do I create these urls? Is it possible to add support for encoding youtube-dl commands using liveproxy --file FILE?

Stream not working

Hey!

i can't get the stream to work. I try to open a stream in VLC and get this result.

$ liveproxy --loglevel DEBUG --host 0.0.0.0
[main][INFO] For LiveProxy support visit https://github.com/back-to/liveproxy
[main][DEBUG] OS:         Linux-4.9.59-v7+-armv7l-with-glibc2.17
[main][DEBUG] Python:     3.8.4
[main][DEBUG] LiveProxy:  2.1.0.dev2
[main][INFO] Starting server: 0.0.0.0 on port 53422
[server.301a4][INFO] User-Agent: VLC/3.0.12 LibVLC/3.0.12
[server.301a4][INFO] Client: ('192.168.1.2', 55985)
[server.301a4][INFO] Address: 192.168.1.2
[server.301a4][DEBUG] Video-Software: /usr/local/bin/youtube-dl
[server.301a4][DEBUG] ['youtube-dl', 'https://www.youtube.com/user/france24/live', '-o', '-', '--quiet', '--no-playlist', '--no-warnings', '--no-progress']
[server.301a4][INFO] Stream started 301a4
[server.301a4][DEBUG] ERROR: ffmpeg exited with code -8
[server.301a4][INFO] Stream ended 301a4

Any ideas?

.m3u8.new as playlist input for WordPress embedded video players

Hi again,

This time I wonder about various WordPress embedded video players that all use hls.js as backend for their m3u8 playlists URLs:
https://wpneon.com/best-wordpress-video-player-plugins/
For example, #5,7,9, and also Presto player.
Many players can only stream YouTube in iframes, and not as part of mixed playlist.

I don't think we can use a playlist as input that has streamlink or pipe commands to convert the YouTube URLs etc.

  1. So can we use liveproxy .m3u8.new output file as playlist for above video players ?

Of course you will have to install WordPress+ embedded player plugins and Streamlink + liveproxy on the Linux server.

  1. Will streamlink then automatically return the HLS streams to the embedded video player and update the YouTube URL/m3u8 link changes periodically ( one hour)?

Cheers ๐Ÿ˜ธ,
Shippy.

Redirect Streamlink to VLC for Android on local network

Hello, I'm trying to redirect the stream from Streamlink on my PC (Windows/Linux, dual boot) to watch it on VLC on my Android phone.

My first problem is that it seems like liveproxy's stream it's not accessible from my local network.

My second problem is that VLC on Windows can't play liveproxy's stream, so I'm curious if VLC for Android can.

[server.4dac8][INFO] User-Agent: VLC/3.0.16 LibVLC/3.0.16
[server.4dac8][INFO] Client: ('127.0.0.1', 1658)
[server.4dac8][INFO] Address: 127.0.0.1
[server.4dac8][ERROR] Video-Software is not supported.

I use Streamlink with VLC on my PC, and I just want to watch the stream from my phone without needing to install Termux or something similar.

It's seems like an easy task, but I can't get it to work.

Thanks.

Suggestion: Server the m3u from liveproxy

Hello, this is a suggestion.

In addition to the creation of the m3u file by passing the option --file why not add the option to serve the list from the liveproxy itself.

Example:
Current behaviour: liveproxy --file example.m3u
This generates a example.m3u.new with all the magic :) But I have to manually copy this file somewhere

Desired behaviour. Appart from the default, something like:
liveproxy --file example.m3u --output http
So you can have the list in a endpoint like:
http://0.0.0.0:12345/example.m3u

You can use liveproxy either acting as a proxy aswell as serving the m3u file.

Maybe a clean way to organise that:
liveproxy --file example.m3u --output example.m3u.new (writes to disk, like it does now)
liveproxy --file example.m3u --output http (serves the list from liveproxy)

Regards!

xbmc.translatePath returns unicode string in Kodi 19

encode('utf-8') of xbmc.translatePath results in bytes and causes streamlink code to fail as it expects string

CONFIG_FILES.extend([xbmc.translatePath('special://profile/addon_data/service.liveproxy/config').encode('utf-8')])
PLUGINS_DIR.extend([
xbmc.translatePath('special://profile/addon_data/service.liveproxy/plugins/').encode('utf-8'),
xbmc.translatePath('special://home/addons/script.module.back-to-plugins/lib/data/').encode('utf-8'),
xbmc.translatePath('special://home/addons/script.module.streamlink-plugins/lib/data/').encode('utf-8'),

"Video-Software is not supported" in Alpine container

Trying to create a Docker container that can handle requests with all tools (yt-dlp, streamlink, youtube-dl) supported by liveproxy

FROM python:alpine3.18 AS release

WORKDIR /

RUN apk update
RUN apk upgrade
RUN apk add --no-cache ffmpeg

RUN python3 -m pip install --upgrade liveproxy
RUN python3 -m pip install -U yt-dlp
RUN python3 -m pip install -U streamlink

EXPOSE 53422

CMD ["liveproxy", "--host", "0.0.0.0", "--loglevel", "DEBUG"]

performing the request http://127.0.0.1:53422/base64/eXQtZGxwIGh0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3VzZXIvZnJhbmNlMjQvbGl2ZQ==/ as stated in the README.md i am getting:

2023-05-18 23:00:23 [server.683d7][INFO] User-Agent: VLC/3.0.18 LibVLC/3.0.18
2023-05-18 23:00:23 [server.683d7][INFO] Client: ('172.20.0.1', 38844)
2023-05-18 23:00:23 [server.683d7][INFO] Address: 172.20.0.1
2023-05-18 23:00:23 [server.683d7][DEBUG] Video-Software: /usr/local/bin/yt-dlp
2023-05-18 23:00:23 [server.683d7][ERROR] Video-Software is not supported.

Traced the error to this line which should be caused if you provide invalid command encoded in base64 where the regex checks if yt-dlp, streamlink, youtube-dl is contained in the command fails.

Python is not part of my toolbox to trace/debug further, but checked the regex online if its caused by my Dockerfile setup. It seems to be working on the online regex site

Generating a new file

Hello,
First thank you for thisd piece of software, very helpful.

I'm having an issue while creating a new file using the command
liveproxy --file filename.m3u

The new generated file contains the default URL http://127.0.0.1:53422/ while in my case liveproxy listens on an external interface:port so I have to modify the m3u manually each time.
Any way to specify the URL within the command itself?

Thanks.

"Stream ended" right away

I've installed the dev version of liveproxy and have tried to run the stream in the tutorial, but it just immediately fails.

liveproxy --host 0.0.0.0
[main][INFO] For LiveProxy support visit https://github.com/back-to/liveproxy
[main][INFO] Starting server: 0.0.0.0 on port 53422
[server.643cc][INFO] User-Agent: VLC/3.0.15 LibVLC/3.0.15
[server.643cc][INFO] Client: ('127.0.0.1', 52350)
[server.643cc][INFO] Address: 127.0.0.1
[server.643cc][INFO] Stream started 643cc
[server.643cc][INFO] Stream ended 643cc

Smart TV LG WebOS SSIPTV incompatible

I am trying to play from a LG Smart TV using the SS IPTV application with no results. This is the log generated by liveproxy when the connection occurs:

[liveproxy-main][info] For LiveProxy support visit https://github.com/back-to/liveproxy
[liveproxy-main][debug] OS:            macOS 10.14
[liveproxy-main][debug] Python:        2.7.15
[liveproxy-main][debug] LiveProxy:     0.0.4.dev0
[liveproxy-main][debug] Streamlink:    0.14.2+102.g0599dc66
[liveproxy-main][debug] Requests(2.19.1), Websocket(0.53.0)
[liveproxy-main][info] Starting server: 0.0.0.0 on port 53422
[liveproxy-server][info] User-Agent: Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.122 Safari/537.36 WebAppManager
[liveproxy-server][info] Client: ('192.168.0.16', 40634)
[liveproxy-server][info] Address: 192.168.0.16
[liveproxy-server][info] Plugin path /Users/user/.config/streamlink/plugins does not exist or is not a directory!
[liveproxy-server][info] Found matching plugin hls for URL https://server/playlist.m3u8
[plugin.hls][debug] URL=https://server/playlist.m3u8; params={}
[utils.l10n][debug] Language code: en_US
[liveproxy-server][info] User-Agent: Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.122 Safari/537.36 WebAppManager
[liveproxy-server][info] Client: ('192.168.0.16', 40636)
[liveproxy-server][info] Address: 192.168.0.16
[liveproxy-server][info] Plugin path /Users/user/.config/streamlink/plugins does not exist or is not a directory!
[liveproxy-server][info] Found matching plugin hls for URL https://server/playlist.m3u8
[plugin.hls][debug] URL=https://server/playlist.m3u8; params={}
[utils.l10n][debug] Language code: en_US
[liveproxy-server][info] Available streams: 478k (worst), 1091k, 1397k, 2010k, 2726k, 3747k (best)
[liveproxy-server][info] Opening stream: 3747k (hls)
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] First Sequence: 153772477; Last Sequence: 153772488
[stream.hls][debug] Start offset: 0; Duration: None; Start Sequence: 153772479; End Sequence: None
[stream.hls][debug] Adding segment 153772479 to queue
[liveproxy-server][debug] 192.168.0.16 - "GET /play/?url=https%3A%2F%2Fserver%2Fplaylist.m3u8&hls-segment-attempts=20&hls-segment-timeout=20&hls-live-edge=10&hls-segment-thread=3&loglevel=debug&?.ts HTTP/1.1" 200 -
[stream.hls][debug] Adding segment 153772480 to queue
[stream.hls][debug] Adding segment 153772481 to queue
[liveproxy-server][debug] Pre-buffering 4096 bytes
[stream.hls][debug] Adding segment 153772482 to queue
[stream.hls][debug] Adding segment 153772483 to queue
[stream.hls][debug] Adding segment 153772484 to queue
[stream.hls][debug] Adding segment 153772485 to queue
[stream.hls][debug] Adding segment 153772486 to queue
[stream.hls][debug] Adding segment 153772487 to queue
[stream.hls][debug] Adding segment 153772488 to queue
[liveproxy-server][info] Available streams: 478k (worst), 1091k, 1397k, 2010k, 2726k, 3747k (best)
[liveproxy-server][info] Opening stream: 3747k (hls)
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] First Sequence: 153772477; Last Sequence: 153772488
[stream.hls][debug] Start offset: 0; Duration: None; Start Sequence: 153772479; End Sequence: None
[stream.hls][debug] Adding segment 153772479 to queue
[stream.hls][debug] Adding segment 153772480 to queue
[liveproxy-server][debug] 192.168.0.16 - "GET /play/?url=https%3A%2F%2Fserver%2Fplaylist.m3u8&hls-segment-attempts=20&hls-segment-timeout=20&hls-live-edge=10&hls-segment-thread=3&loglevel=debug&?.ts HTTP/1.1" 200 -
[stream.hls][debug] Adding segment 153772481 to queue
[stream.hls][debug] Adding segment 153772482 to queue
[stream.hls][debug] Adding segment 153772483 to queue
[liveproxy-server][debug] Pre-buffering 4096 bytes
[stream.hls][debug] Adding segment 153772484 to queue
[stream.hls][debug] Adding segment 153772485 to queue
[stream.hls][debug] Adding segment 153772486 to queue
[stream.hls][debug] Adding segment 153772487 to queue
[stream.hls][debug] Adding segment 153772488 to queue
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Download of segment 153772479 complete
[stream.hls][debug] Download of segment 153772480 complete
[liveproxy-server][info] Detected remote disconnect
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[liveproxy-server][info] Stream ended
----------------------------------------
Exception happened during processing of request from ('192.168.0.16', 40634)
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 596, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 331, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 654, in __init__
    self.finish()
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 713, in finish
    self.wfile.close()
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 283, in close
    self.flush()
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 307, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
----------------------------------------
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] Download of segment 153772481 complete
[stream.hls][debug] Download of segment 153772479 complete
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Download of segment 153772480 complete
[stream.hls][debug] Download of segment 153772481 complete
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] Adding segment 153772489 to queue
[stream.hls][debug] Download of segment 153772482 complete
[stream.hls][debug] Download of segment 153772483 complete
[stream.hls][debug] Download of segment 153772484 complete
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] Adding segment 153772490 to queue
[stream.hls][debug] Download of segment 153772485 complete
[stream.hls][debug] Download of segment 153772486 complete
[stream.hls][debug] Download of segment 153772487 complete
[liveproxy-server][info] Detected remote disconnect
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[liveproxy-server][info] Stream ended
----------------------------------------
Exception happened during processing of request from ('192.168.0.16', 40636)
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 596, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 331, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 654, in __init__
    self.finish()
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 713, in finish
    self.wfile.close()
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 283, in close
    self.flush()
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 307, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
----------------------------------------

I tried playing a link "http://topchantv.net:3456/live/911TV_TEST/911tv.info/6.ts" using SS IPTV with no problems (this is the http header that shows ffmpeg, maybe it gives us a clue):

[http @ 0x7fbc39506340] header='HTTP/1.1 200 OK'
[http @ 0x7fbc39506340] http_code=200
[http @ 0x7fbc39506340] header='Server: nginx'
[http @ 0x7fbc39506340] header='Date: Sun, 23 Sep 2018 12:29:18 GMT'
[http @ 0x7fbc39506340] header='Content-Type: video/mp2t'
[http @ 0x7fbc39506340] header='Connection: close'
[http @ 0x7fbc39506340] header='Access-Control-Allow-Origin: *'

liveproxy port

howto change liveproxy port after install where i find the config file

[liveproxy-server][error] No playable streams found on this URL [NEW ERROR/ISSUE]

Hi, everyone.

Hi have some issue on my liveproxy Server on my local network, well it has worked fine for month maybe for a entire year,
But now i'm getting this error

[liveproxy-server][info] Plugin path /root/.config/streamlink/plugins does not exist or is not a directory!
[liveproxy-server][info] Found matching plugin twitch for URL https://www.twitch.tv/gotaga
[liveproxy-server][error] No playable streams found on this URL: https://www.twitch.tv/gotaga

the streamer was live at that moment and not able to grab the m3u the same for ESL_CSGO and all the others i have.

so now this is all my data liveproxy data info

[liveproxy-main][info] For LiveProxy support visit https://github.com/back-to/liveproxy
[liveproxy-main][debug] OS:         Linux-4.15.0-121-generic-x86_64-with-Ubuntu-18.04-bionic
[liveproxy-main][debug] Python:     2.7.17
[liveproxy-main][debug] LiveProxy:  1.0.0
[liveproxy-main][debug] Streamlink: 1.4.1
[liveproxy-main][debug] Requests:   2.23.0
[liveproxy-main][info] Starting server: 0.0.0.0 on port 53422

pip 20.3.3 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6)

not sure how, but if there is a way to update the streamlink package using this method it will be nice to tell us how.

My installation method.

git clone --depth 1 --branch 1.0.0  git://github.com/back-to/liveproxy.git liveproxy
 cd liveproxy
 python setup.py install

using this method it uses the 2.7 path of python but with pip install . it install on the 3.6 path i guess the 2.7 is deprecated i read some message when i deployed a other app btw.

if i install using pip i get this.

  File "/usr/local/bin/liveproxy", line 5, in <module>
    from liveproxy.main import main
  File "/usr/local/lib/python3.6/dist-packages/liveproxy/main.py", line 15, in <module>
    from .argparser import parser
  File "/usr/local/lib/python3.6/dist-packages/liveproxy/argparser.py", line 8, in <module>
    from .constants import FILE_OUTPUT_LIST
  File "/usr/local/lib/python3.6/dist-packages/liveproxy/constants.py", line 3, in <module>
    from streamlink.compat import is_py2, is_win32
ImportError: cannot import name 'is_py2'

because i guess this is using python3.6 and your project only works on 2.7

the actual master branch is not working because it talks about MacOS things and etc... so i don't used this one.

Resuming: if you tell me how can i update the Streamlink it will be nice "using the installation above git......", and also how i can unintall the allready installed package using the method above, and how can i set the env to use python2.7 when installing pip packages btw i will not use pip i will install install it by python setup.py install

Kind Regards

[Question] There is a way to do some temp cache before streaming through the liveproxy ?

Hi, @back-to there is some way to do a little of cache before streaming the content, i ask this because my tv get some freezes when i use liveproxy from twitch content, so i use a player that allow me to cache a bit before playing the live from twitch, so instead of using the cache i really would like to do cache from the rapberry pi to prevent freezes and doing it from my rapberry pi instead of my player, maybe a command from streamlink but i didn't find nothing.

Can you help me with this ?
I just need a little cache so maybe 10 - 20 seconds of caching the content to be ready for use at any moment, i have tested it and looks like the live proxy grab the m3u8 links great without issues, i just need some way to do caching of the content. 10-20 seconds will be good.

Kind Regards

Using vlc instead of streamlink ?

Hi i have an mpd that is number based when i open the mpd directly in vls it plays perfectly fine but when i open it using streamlink it returns content from the past because segments are cached for 24 hours i can only assume streamlink is calculating the number wrong for the mpd representation

i know vlc via command line allows for output to stdout so would it be possible to update this application to use vlc as a play option as well as streamlink and yt-dl ?

Broadcast same live stream to multiple clients

Hi @back-to,
First of all, thank you for liveproxy, been using it recently, quite a clever approach to the problem!

Since liveproxy targets live streams, I thought it would be a good enhancement to re-use the same command output for multiple clients, instead of opening multiple connections to the same upstream. Although I understand it might make the implementation a little bit more complex, I think it might make sense for use cases where you don't have something like TVHeadend consuming liveproxy's stream (and broadcasting it).

What do you think?

Again, thank you for this project and idea!

authorization issue with website mjunoon

[liveproxy-server][info] User-Agent: VLC/3.0.3 LibVLC/3.0.3
[liveproxy-server][info] Client: ('86.3.77.209', 28616)
[liveproxy-server][info] Address: cpc124700-birk9-2-0-cust464.1-3.cable.virginm.net
[liveproxy-server][info] Plugin path /root/.config/streamlink/plugins does not exist or is not a directory!
[liveproxy-server][info] Found matching plugin mjunoon for URL https://www.mjunoon.tv/a-plus-live
[liveproxy-server][info] Available streams: 270p (worst), 480p (best)
[liveproxy-server][info] Opening stream: 480p (hls)
[liveproxy-server][error] Could not open stream: Unable to open URL: https://cdn2.mjunoon.tv:25463/streaming/clients_live.php?username=9R04xsGMh7&password=QqPWRGcLj7&stream=129&extension=m3u8&id=1 (401 Client Error: Unauthorized for url: https://cdn2.mjunoon.tv:25463/streaming/clients_live.php?username=9R04xsGMh7&password=QqPWRGcLj7&stream=129&extension=m3u8&id=1&id=1)

wrong streamlink version

While installing liveproxy replaces streamlink-1.0.0 with streamlink-0.14.2. This is wrong - it doesn't work, issuing "[liveproxy-server][error] No playable streams found on this URL:" Removing 0.14.2 and re-installing streamlink-1.0.0 back after installing of liveproxy gets it working right way.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.