chorus2
chorus2 copied to clipboard
Play pasted media urls (youtube, vimeo ...)
It would be great to be able to paste a media link from supported services to play / queue playing. The functionality already exists with play to kodi browser extensions, but it is quite inconvenient and platform-dependent solution. Using kodi addon directly through browser is really laggy.
Moreover it would be great to allow searching youtube / vimeo... links directly in chorus - similarly to this extension: https://github.com/Frolanta/youtube-kodi-webinterface/raw/master/webinterface.ywifk.0.2.0.zip But for this, I am just hoping. The first part of my feature request would be sufficient enough.
I second this motion, that would be brilliant. I want to get rid of PlayToKodi because it's browser-dependent.
It would also be nice if there is a way provided to directly play any URL containing media. Basically making a POST request to jsonrpc server.
Something like below should work, replacing file path with a valid url:
{"id":529,"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"file":"http://example.com/blabla/media.mp4"}}}
Agree, this is needed functionality. I did start working on it. I hope it will be easy to integrate into chorus gui.
I dusted off this windows VBS script from a few years ago. Originally I wrote this to work with FlashGot extension, but I modified it to just send the clipboard contents. That way you can copy the URL with downloadHelper etc. and then just doubleclick the script to send it to Kodi. Copy everything between ==== lines and save to text file called send2Kodi.vbs (you might have to allow the script in antivirus)
Then change the IP address number to match yours.
Send2Kodi.vbs
Dim objXmlHttpMain , KODI_URL , URLofVideo
KODI_URL = "http://192.168.XXX.XXX:8080/jsonrpc" 'KODI URL
Set objHTML = CreateObject("htmlfile") ClipboardText = objHTML.ParentWindow.ClipboardData.GetData("text") MsgBox ClipboardText
URLofVideo = ClipboardText
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
Here's a slightly updated version of my script to add a Yes/No? function in case you copied the wrong link and want to cancel sending.
Dim objXmlHttpMain , KODI_URL , URLofVideo , YesNoResult
KODI_URL = "http://192.168.xxx.xxx:8080/jsonrpc" 'KODI URL
Set objHTML = CreateObject("htmlfile") URLofVideo = objHTML.ParentWindow.ClipboardData.GetData("text") ' MsgBox URLofVideo
YesNoResult = MsgBox(URLofVideo, 4 , "Play URL?")
If YesNoResult=6 then
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