regseb / castkodi Goto Github PK
View Code? Open in Web Editor NEWWebExtension to cast videos and music to Kodi.
License: MIT License
WebExtension to cast videos and music to Kodi.
License: MIT License
Currently, at least on my system, clicking on the Cast Kodi toolbar button in Firefox and then scrolling up and down controls volume where the up motion decreases and the down motion increases it.
It would be great to have a configuration option to reverse the scrolling direction in order to accommodate people to whom the default behavior feels unnatural and counterintuitive.
Thank you for all your time and effort and for the consideration. Cheers.
As stated in the title, cannot connect to Kodi from a Mac running MacOS 10.14.6
Works fine to same Kodi box from a Windows PC
This addon is not working for me.
My port to control kodi is 8080 and not 9090.
Is it possible to be able to manually change the port in settings?
Hi,
When you send the link of a video on the Playlist, an error on kodi would say "Playback failed".
If you set the mode to "Cast video only" it would work for single video.
Please help fix it.
Thanks
https://music.youtube.com/watch?v=eBShN8qT4lk&list=RDAMVMz5rRZdiu1UE
Theres a link that doesnt work with your addon.
I tried casting from the popup.
Works in another addon.
Loving the new update :P
Allow the user to configure multiple connections and to be able to cast to any of them. Maybe add a drop down in the button menu to allow which one to be selected and on the context menu just add another sub menu where it lists all the connections.
I have installed https://addons.mozilla.org/da/firefox/addon/castkodi/?utm_source=addons.mozilla.org&utm_medium=referral&utm_content=search
But when I cast the video link from HTML5 videos on websites nothing happens,
Twitch works fine so there is a connection, but it just cant handle
If the Kodi server has its web interface enabled, it'd be nice to have a button in the popup that lets users open this web interface in a new tab. This can e.g. be useful to queue videos/music that is stored on the Kodi server and not streamed from a website.
The stop button is disabled when Kodi is playing a PVR live stream.
https://github.com/regseb/castkodi/blob/master/src/popup/script.js#L424
This is what's causing it. Position is meant to be the position in the playlist. Not sure what you're trying to achieve by comparing it to -1 but at least for PVR, it's breaking stuff.
How can I change the quality of youtube videos that are played to kodi? Currently it plays 640x360 on a 1080p screen (HDTV) no matter how I start it from firefox.
Please, add posibility to play Facebook videos in higher quality. Currently only 360p plays while there are also 4k sources available.
Thanks
Hey,
I'm on the newest version of Raspbian 10 buster but unfortunately Kodi 19 is still not released for this Raspbian version.
Previously I used this add-on without problems with 18.7 but unfortunately that support was dropped.
Is it possible to make this add-on backwards compatible with 18.7?
Thanks!
Even though the Youtube browser interface doesn't show it, this playlist contains a deleted video right at the start:
https://www.youtube.com/playlist?list=PLcoJNfD5utb3j1YlmYFwxicotYWlFugE1
Adding this playlist to Cast Kodi results in an unknown error:
https://i.imgur.com/Vx2Dw4J.jpg
Kodi plays the playlist just fine, but I can't interact with the remote interface anymore until I remove the deleted video from the playlist via the Kodi playlist menu or Kore on Android.
Foxy Gestures is an addon that allows using mouse gestures to perform certain tasks. According to this comment by the developer of Foxy Gestures, if you add a listener using runtime.onMessageExternal (here is how Temporary Containers implemented this), it seems to me it should be possible to use gestures to interact with Cast Kodi using Foxy Gestures user scripts (here are 3 user scripts Temporary Containers made).
I feel like being able to use gestures over a link to a video to play now to kodi, play next to kodi and queue item to kodi would be amazing. And maybe if it's easy using a gesture to play/pause, go to next and go back 30 seconds as well. Please consider implementing this and creating some user scripts.
Now that I have a version of kodi supporting the feature, I was trying to update my PR adding support to send subtitle URLs to it (#43).
Since there's still no proper documentation on how to develop/test the addon (#35), I manage to find out I can test it using following command under root directory of castkodi.git:
git clean -fxd && web-ext build -s src/ && web-ext run -t firefox-desktop -s src/ --verbose
Then, firefox is started with a new profile and the addon loaded in, and I configure it against my kodi instance. Stuff seems to work in general, however, when I press the "Send text" button to open a new dialog to fill in the text, it actually fails and no dialog is open. Instead, I see this in the web console (or web-ext run --verbose output in the terminal):
[firefox/index.js][debug] Firefox stderr: JavaScript error: moz-extension://fbe06268-ceb3-4286-8737-6019d3bdff6f/popup/script.js, line 443: TypeError: dialog.showModal is not a function
The same castkodi version (6.2.0) installed from the firefox official addon download site I use in my regular firefox seems to be working fine though, so it seems to be something related to web-ext.
I tried adding the following line before the error to see what's going one:
console.log("dialog: ", dialog);
And I get:
dialog: <unavailable>
castkodi version: v6.2.0
firefox --version: Mozilla Firefox 95.0.2
Having this kind of issue when running with web-ext makes it difficult to improve castkodi, since I cannot test the feature I'm adding (which uses similar dialog as sendText like you advised).
It would be nice having a configurable extensions shortcut for showing the remote control popup.
Alt+K or Ctrl+Alt+K both seem to be unused and would make a good default hotkey.
see https://developer.mozilla.org/fr/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands
Une petite question:
Planifier-vous de rajouter d'autres sites supportés comme tf1?
why was it removed from AMO?
firefox version: 78.0.2
kodi version: 18.7 Git:20200528-2c5354e70a
linux distro of firefox: Archlinux
linux distro of kodi: raspbian
castkodi: Version=5.1.0, Last Updated="July 17, 2020"
castkodi has been working fine for a while. I usually use the top-right icon which shows a menu to send links, submit control messages to Kodi, etc.
Today, (probably after updating my laptop system and/or kodi's system), castkodi stopped working.
I didn't change any configuration since last time it as working (only system upgrade which may have changed castkodi, kodi or firefox version).
When I press the top-right icon, the menu appears but immediately aftewards changes to red background and shows text:
"Unknown error" and "Failed to execute method.", followed by a button to go to the "configure" section.
I attach a pcap file with firefox connecting to Kodi while I press the top-right icon and the error menu appears.
websocket trace Summary:
Firefox -> Kodi: {"jsonrpc":"2.0","method":"Player.GetActivePlayers","id":1}
Firefox <- Kodi: {"id":1,"jsonrpc":"2.0","result":[]}
Firefox -> Kodi: {"jsonrpc":"2.0","method":"Player.GetProperties","params":{"playerid":1,"properties":["position","repeat","shuffled","speed","time","totaltime"]},"id":2}
Firefox <- Kodi: {"error":{"code":-32100,"message":"Failed to execute method."},"id":2,"jsonrpc":"2.0"}
[Firefox closes the websocket]
So it looks like castkodi is trying to access an active player which doesn't exist.
Hi All,
This is just to share findings and workaround identified.
Problem description:
Environment:
Further investigation shown that running FF from fresh profile connects well to the same Kodi without any changes at other end.
Details investigation of the GET request sent to Kodi from original FF profile and compared to the one sent from fresh profile revealed that cookies for other service on the same IP has been sent:
[truncated]Cookie: portainer
Cookie pair: portainer
Cookie pair: portainer
Cookie pair [truncated]: portainer
Cookie pair: portainer
Cookie pair: portainer
Cookie pair: portainer
Cookie pair: PHPSESSID=123
Workaround:
Cookies were flushed and Cast Kodi was able to successfully connect to the Kodi.
Question:
Why would Firefox send some unrelated cookies to a different port even if same IP?
This is most probably Firefox issue, though exposed to me only due to problems with Cast Kodi and given that it is Cast Kodi behind the request, question is being raised here.
Merci pour le plugin génial.
Hello,
Could you add uptostream.com support
Thank you
Hi regseb,
I would like to play Facebook videos, especially live streams, on my Kodi. So I am trying out your Cast Kodi extension for Firefox, because it explicitly lists facebook as supported:
videos: direct links (avi, mkv, ...), YouTube, Twitch, Vimeo, Instagram, torrents, magnets and Ace Stream, AlloCiné, Dailymotion, DevTube, Dumpert, Facebook, Flickr, Full30, JeuxVideoCom, PeerTube, Pippa, Rutube, StormoTV, ...
However, I am not quite sure how I can do that, I can't figure it out. When right-clicking on facebook video, I do not get the "Play now to Kodi" context menu. But I do see it when right-clicking on youtube videos. What am I missing? Is there some other way of using this add-on for facebook videos and live streams? (The first ticket was also related to facebook, but unfortunately the user did not specify how exactly he tried playing the fb video)
Thanks in advance for your assistance.
Please support playing videos from play.srf.ch.
E.g. Link: https://www.srf.ch/play/tv/sendung/tschugger?id=268db462-bbbc-4f00-98f7-4dd60fa8e761
Error on kodi.log:
2021-12-01 18:38:05.796 T:957 INFO <general>: JSONRPC Server: New connection added
2021-12-01 18:38:07.492 T:913 INFO <general>: VideoPlayer::OpenFile: https://www.srf.ch/play/tv/sendung/tschugger?id=268db462-bbbc-4f00-98f7-4dd60fa8e761
2021-12-01 18:38:07.506 T:957 INFO <general>: WebSocket: connection closed by client
2021-12-01 18:38:07.506 T:1073 INFO <general>: Creating InputStream
2021-12-01 18:38:07.507 T:957 INFO <general>: JSONRPC Server: Disconnection detected
2021-12-01 18:38:07.582 T:1073 INFO <general>: Creating Demuxer
2021-12-01 18:38:07.756 T:1073 ERROR <general>: Open - error probing input format, https://www.srf.ch/play/tv/sendung/tschugger?id=268db462-bbbc-4f00-98f7-4dd60fa8e761
2021-12-01 18:38:07.757 T:1073 ERROR <general>: OpenDemuxStream - Error creating demuxer
2021-12-01 18:38:07.757 T:1073 INFO <general>: CVideoPlayer::OnExit()
2021-12-01 18:38:07.812 T:913 INFO <general>: CVideoPlayer::CloseFile()
2021-12-01 18:38:07.812 T:913 INFO <general>: VideoPlayer: waiting for threads to exit
2021-12-01 18:38:07.812 T:913 INFO <general>: VideoPlayer: finished waiting
Your plugin is really cool!!
With Kodi I use the plugin "MediathekView Kodi Addon". This plugin makes films available from many German tv channels (i.e. from many German "Mediatheken").
The code for the MediathekView server that searches the "Mediatheken" and finds the URLs of the films is here: https://github.com/mediathekview/MServer.
In the code one could probably look up how to find the film URLs from a lot of additional German "Mediatheken" and integrate them in your plugin. Could you do this? That would be great!
I'm right now tryed to cast this to my kodi setup:
https://vidlox.me/30fxi9o50b3v
The video links apparently it's correctly added to playlist but it's fail to reproduce.... it's appears a blue spin for a moment and nothings appends.
It's need problably the ResolveURL or the URLREsolver for obtain the main links for stream it correctly... you can add this feature ?
EDIT
Apparently there's a direct mirror to this files:
https://c30.vidlox.me/hls/oudvhyeh5btk2yixv6jowv3xjcuqzkaso7elzrhtqqjwsvj24kwmramrazka/index-v1-a1.m3u8
Or add a way to add a direct mirrors.... somethings to send a direct mirrors to playlist.
There's no instructions on how to build the extension and generate a file one can the load into firefox.
It would be great to have those instructions in a BUILD.md, INSTALL.md or README.md itself.
My kodi box is only reachable via IPv6 for obscure networking reasons. Anyway, the chorus web interface works fine in firefox by typing http://[the:freaking:ip:v6:address]:8080 but Cast to Kodi reports that "this address is not valid or remote control is not activated". Both are lies.
When I try to cast a YouTube video to Kodi, I get an error message saying "Unknown error: results.addons is undefined"
Steps to reproduce the behavior:
The YouTube video should play on the Kodi device
This is the error message that shows up:
It'd be great if the addon supported sending text to Kodi when Kodi is showing a text input. This is useful when searching for content in addons for example.
The official web interface does support it.
https://kodi.wiki/view/JSON-RPC_API/v10#Input.OnInputRequested
https://kodi.wiki/view/JSON-RPC_API/v10#Input.SendText
Hello,
Today I tried to test this addon with FB video and it always says " link isn't a FB video".
Could you please have test and fix it?
Thanks
Please support playing videos from 9anime.to
You can get all domain names from here: 9anime.me
Might be a silly question, but can you have an IP address with a port number? Once I add a ":" to the IP address, I get the red exclamation mark. And this mark continues even if I enter the full address with the port number.
And to confirm, this is the same IP+port that I use to access the website interface (192.168.1.15:1066)
Hi, good work. In addition with the extension window open, I would like to get more keyboard keys to remotely control Kodi. These keys would be: Arrow keys, Enter, "C" context menu, "i" info menu...
It would be great to make this extension Android Firefox compatible aswell.
Thanks.
Hi - thanks for a great addon!
Let's say, I've made a playlist, by right-clicking YouTube videos and doung Cast to Kodi/Queue item:
Now, if I by accident do a Cast to Kodi/Play now, it will - as expected - overwrite the current playlist.
I would like to propose an additional button in the addon GUI (like on the screenshot above), which saves the current Kodi playlist, as a file on the computer, (for instance, that button could have a mouseover text "Save current Kodi playlist locally".
As far as I can tell, the default playlist for Kodi ( https://kodi.wiki/view/Basic_playlists ) is an .m3u
file; and this file accepts plugin://
protocol URIs/links - for instance, from https://github.com/kodi-pvr/pvr.iptvsimple/blob/Nexus/README.md :
...
#EXTINF:-1 catchup="vod",Channel K
plugin://plugin.video.my-vod-addon/play/catalog/channels/d8659669-b964-414c-aa9c-e31d8d15696b
....
The only place I found these plugin://
protocol links to be mentioned on the Kodi wiki, is https://kodi.wiki/view/Dynamic_List_Content
So, having saved this .m3u
file with plugin://
links locally, I could then copy it to Kodi, and play it directly in Kodi (which is great!).
But, I would also like to propose one more additional button in the addon GUI (like on the screenshot above), which then loads/imports a locally saved .m3u
file as the current Kodi playlist, replacing the previously active playlist in Kodi (for instance, that button could have a mouseover text "Load/import local .m3u file as the current Kodi playlist" or similar).
Title says it all ;)
Stopped working following this recent Firefox update and this message is now displayed on Firefox's about:addons
page.
Edit: just saw that https://addons.mozilla.org/en-GB/firefox/addon/castkodi/ says
This add-on requires a newer version of Firefox (at least version 64.0). You are using Firefox 62.0.
So it looks like the problem is the other way round and I need to update my browser. Sorry for the noise!
Does fail to play the video with an error on kodi.
When you right click > Cast to Kodi on a link that has a / in its title tag ie:
<a href="example.com">link with / in it</a>
would cause the extension to send "link with / in it" to kodi instead of "example.com"
Steps to reproduce the behavior:
Kodi should play that youtube video
Kodi will error, according to the logs it's because it tries to send the title as the URL:
2022-04-03 19:19:08.671 T:1232 ERROR <general>: CCurlFile::Stat - Failed: Couldn't resolve host name(6) for http://r/Place%20Pixel%20Art%20Error,%20BUT%20IRL
It would be nice to be able to play videos from https://www.zdf.de
I it planed or possible to relase a version for chromium based browsers?
There is no such great plugin for kodi. I love Cast Kodi.
the only reason to keep Firefox - just to send videos to Kodi and manage playback. :)
It appears the existing YouTube add-on for Kodi is going to eventually phased out and replaced by Tubed (https://github.com/anxdpanic/plugin.video.tubed).
Can support be added for this plugin w/ some sort of configuration option or auto-discovery (https://kodi.wiki/view/JSON-RPC_API/v12#Addons.GetAddons) to switch between plugins to cast to?
from a privacy/anti-fingerprinting POV, i'm wondering if the add-on can be detected by a site when it's not being used - does it modify the page in any way?
i tried to determine this using the console and i'm not seeing any difference whether it's enabled or disabled, but i'd like confirmation
Lately I noticed that I have to reenter username/password in order to connect to my Kodi system. This was not required in the past.
Could there have been a change in Kodi (Matrix) perhaps?
A few days ago I was able to cast videos from YouTube to Kodi. Today I cannot. The add-on triggers the now-defunct YouTube plug-in on Kodi. This plug-in is defunct is because it requires users to acquire a developer API key but Google plugged this loophole at least a year ago because it violates the EULA.
It looks like the FireFox add-on was updated on the 2nd (three days ago), so I would surmise the version I had before that was working properly. I had assumed it was using some other medium to cast the video from YouTube to Kodi other than the YouTube plug-in because I know my YouTube Kodi plug-in hasn't worked for at least a year. But as I said, I was able to use this Firefox add-on to cast YouTube videos just a few days ago.
After latest update its not working..
castkodi version 4.17.0
firefox version 75.0
error message "Failed to execute method"
Hi,
i have the problem that only some functions are working.
If i send a url stream like SomaFM Space Station from my phone to my Kodi on a RPi4 via Yatse Kodi plays the stream.
Now if i look on my Laptop with "Cast Kodi" i see this:
So i didn't see whats playing now and some remote controls not active.
With the "Echo for Kodi" addon i see this:
All functions are working and i see what's playing now.
What i have:
RPi4 with LibreElec 9.2.8 / Kodi 18.9.0 leia
Windows 10 Pro 21H2 / Firefox 91.0.1 / Cast Kodi 5.15.0
What i did to fix this:
Start with only Cast Kodi addon active.
Cleared FF cache/cookies
Tried with 192.168.10.4 or ws://192.168.10.4:9090/jsonrpc
CastKodi fails to recognize embedded MP3, MP4, M3U links which are clearly visible in the page source. These media links could be detected automatically, and should not require a site-specific script.
CastKodi ne reconnaît pas les liens MP3, MP4, M3U incorporés qui sont clairement visibles dans le page source code. Ces liens multimédia pourraient être détectés automatiquement et ne devraient pas nécessiter de script spécifique au site.
Hi, great work on the addon!
I would like to propose a new feature. If you are interested, I would even work on it by myself and create a pull-request, as long as you do not prefer working on the addon on your own.
I encountered a problem when casting video URLs of some domains to Kodi, because the servers would refuse the connection when the user-agent of the request does not belong to a common browser (this can be easily checked with curl
). Until know, I could not find an option in Kodi to change the user-agent for every request, but Kodi allows passing a custom user-agent by adding options to the URL string as described here.
The technical implementation of patching the link would be rather simple, regarding the configuration interface two options came to my mind:
Keep up the great work and happy holidays!
please consider publishing release notes when the extension is updated (about:addons -> Cast Kido -> Release notes)
Currently, if movie's title contains color tags, e. g. [COLOR blue]Movie name[/COLOR]
they're shown as-is making the title display a bit awkward. Not sure if they can be turned into HTML easily but removing them entirely would probably be an alternative.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.