Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send m3u8 URL directly to Player or Queue #431

Open
infojoe opened this issue Dec 17, 2020 · 2 comments
Open

Send m3u8 URL directly to Player or Queue #431

infojoe opened this issue Dec 17, 2020 · 2 comments

Comments

@infojoe
Copy link

infojoe commented Dec 17, 2020

Feature suggestion

I would love to see the functionality of being able to send a URL directly to the player or add to queue. This is currently possible using a firefox extension called KodiControl (https://github.com/LendoK/kodi-control) but it would be great to have this functionality in the web interface so it is not browser dependent.

I know it is also possible to do this via a VBScript or CURL script via the JSON protocol, but again these are OS dependent. The ability to Remotely edit a playlist might also be a way to accomplish this. Currently a blank playlist can be created but no URL's can be added.

Context

Many playable streams can be found online and without this feature, one has to either find an addon for a specific site, or download the stream first to play on Kodi. With this capability, any stream that can be discovered, could be played directly.

Possible Implementation

I once had a VBscript working on an older version of Windows that would do this, but it no longer works on Windows 10

Dim objXmlHttpMain , KODI_URL , URLofVideo

KODI_URL = "http://192.168.1.xxx:8080/jsonrpc" 'KODI URL

URLofVideo = Wscript.Arguments.Item(0)

strJSONToSend = "{""jsonrpc"":""2.0"",""method"":""Player.Open"",""params"":{""item"":{""file"":""" & URLofVideo & """}}}"

Set objXmlHttpMain = CreateObject("Msxml2.ServerXMLHTTP")
on error resume next
objXmlHttpMain.open "POST",KODI_URL, False
objXmlHttpMain.setRequestHeader "Content-Type", "application/json"

objXmlHttpMain.send strJSONToSend

set objJSONDoc = nothing
set objResult = nothing

CURL command:
curl.exe -i -X POST -d {"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"file":"""%~1"""}}} -H "Content-Type: application/json" http://192.168.1.xxx/jsonrpc

Python code:

import urllib2,json,sys

fileURL = sys.argv[1]
KodiURL = 'http://192.168.1.xxx/jsonrpc'
postdata = {"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"file":(fileURL)}}}

req = urllib2.Request(KodiURL)
req.add_header('Content-Type','application/json')
data = json.dumps(postdata)

response = urllib2.urlopen(req,data)

Additional context, screenshots or links

Here are some relevant links or screenshots:

Note: Team Kodi will consider this item however we will not make any promises if it will be included.

@malard
Copy link
Contributor

malard commented Jan 27, 2024

I suppose you are asking for a "play url" box where you can just paste a url into and it will try to play it?

@akvadrako
Copy link

That would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants