pcwii / kodi-skill Goto Github PK
View Code? Open in Web Editor NEWA Kodi search and playback skill for Mycroft AI
License: GNU General Public License v3.0
A Kodi search and playback skill for Mycroft AI
License: GNU General Public License v3.0
Trying to get this plugin working, installed it, rebooted picroft and on startup it says "communicate_load_status:286" "failed to load". It's also not showing in my account settings online. I think it was working on picroft 19 but can't seem to go back to that and it just keeps auto updating me. I'm guessing the new update broke something?
I just created this account so I could post this. First off, thanks for writing the skill, it seems to really work well except for the strange problem I'm experiencing. I have Mycroft (the Picroft image) running on a 4G Raspberry Pi4 with Kodi on the same device. I have my movie and music libraries loaded into Kodi, and I can call up any movie that's a single word title. I can call up any song or any album whether it's single word or multiple word. But when I try to call up a movie with a multiple word title, it seems as though it never tries to search the movie database, instead it searches the music, and then eventually errors out. When it does search for a single title movie, it seems to list every movie in the movie database in the mycroft-cli-client window, and eventually selects the movie and starts playing.
Here's some info from the mycroft-cli-client window:
00:28:08.211 | INFO | 800 | mesh-skill_pcwii:send_MQTT:226 | address: 172.19.100.2, Port: 1883
00:28:08.874 | INFO | 800 | kodi-skill_pcwii:handle_play_local_intent:823 | Called Play Film Intent
00:28:08.992 | INFO | 800 | kodi-skill_pcwii:handle_play_local_intent:829 | Continue with Play Music intent
~~~~-skill_pcwii:parse_music_utterance:339 | Parse Music Received: order kodi to play the movie dances with wolves
00:28:09.279 | INFO | 800 | kodi-skill_pcwii:parse_music_utterance:361 | Primary Regex Key Not Found
00:28:09.438 | INFO | 800 | kodi-skill_pcwii:parse_music_utterance:364 | Secondary Regex Key Found
~~~~i-skill_pcwii:continue_play_music_intent:834 | Parse Routine Returned: ('the movie dances with wolves', 'any')
~~~~kodi-skill_pcwii:search_music_library:308 | searching the music library for: the movie dances with wolves, any
00:28:09.915 | INFO | 800 | kodi-skill_pcwii:list_all_music:232 | Refreshing Music List!...
~~~~l_pcwii:search_music_item:303 | Searching and preparing the requested music list took: 0:00:00.733629, seconds
~~~~INFO | 800 | kodi-skill_pcwii:search_music_library:313 | Label: the movie dances with wolves, Not Found!
~~~~l_pcwii:search_music_item:303 | Searching and preparing the requested music list took: 0:00:00.486093, seconds
~~~~NFO | 800 | kodi-skill_pcwii:search_music_library:317 | Artist: the movie dances with wolves, Not Found!
~~~~l_pcwii:search_music_item:303 | Searching and preparing the requested music list took: 0:00:00.533887, seconds
~~~~INFO | 800 | kodi-skill_pcwii:search_music_library:320 | Album: the movie dances with wolves, Not Found!
00:29:48.444 | INFO | 800 | kodi-skill_pcwii:clear_playlist:409 | {"id":1,"jsonrpc":"2.0","result":"OK"}
~~~~Devices/dca6329bd0f5/response, "ready to play the music, the movie dances with wolves, from the any, category"
00:29:48.484 | INFO | 800 | mesh-skill_pcwii:send_MQTT:226 | address: 172.19.100.2, Port: 1883
00:29:48.787 | INFO | 800 | mesh-skill_pcwii:handle_speak:206 | Response Location Length: 0
~~~~QTT: Mycroft/RemoteDevices/dca6329bd0f5/response, "An error occurred while processing a request in Kodi Skill"
00:29:49.012 | INFO | 800 | mesh-skill_pcwii:send_MQTT:226 | address: 172.19.100.2, Port: 1883
~~~~t.skills.mycroft_skill.mycroft_skill:on_error:835 | An error occurred while processing a request in Kodi Skill
Traceback (most recent call last):
File "/home/pi/mycroft-core/mycroft/skills/mycroft_skill/event_container.py", line 66, in wrapper
handler(message)
File "/opt/mycroft/skills/kodi-skill.pcwii/__init__.py", line 830, in handle_play_local_intent
self.continue_play_music_intent(message)
File "/opt/mycroft/skills/kodi-skill.pcwii/__init__.py", line 838, in continue_play_music_intent
self.queue_and_play_music(music_playlist)
File "/opt/mycroft/skills/kodi-skill.pcwii/__init__.py", line 330, in queue_and_play_music
for each_song in music_playlist:
TypeError: 'NoneType' object is not iterable
00:31:22.508 | INFO | 800 | mesh-skill_pcwii:send_MQTT:226 | address: 172.19.100.2, Port: 1883
00:31:22.537 | INFO | 800 | mesh-skill_pcwii:handle_speak:206 | Response Location Length: 0
00:31:22.561 | INFO | 800 | mesh-skill_pcwii:handle_speak:206 | Response Location Length: 0
The movie is indeed in the database, as are the other movies I've tested. I just don't know where else to look to solve this.
thanks a lot!
It might not be loading correctly. I'm using a Mark I and I believe it is up to date. Looking in the skills log I see some messages about deprecated settings functions or something. I will past the log entries when I get to my computer later.
I'm liking the potential of this skill and I do see that you are going to be working on integrating the Common play framework.
While you work on that is there a possibility of changing the intent to play a movie? Perhaps 'Start a movie'?
Stop, Pause, Resume, all work as advertised, Thanks for this skill!
Hi pcwii
Would it be possible to implement the feature for play favorites from kodi ?
I was hoping you could copy paste most of the code from other parts of your skill as it could just be the list of favorites via Favourites.GetFavourites on Kodi site and then Player.open...
Thx for considering.
i use Kodi and Mycroft in my carpc mainly for audio when i say skip kodi forward or others i get i do not understand is this only for video and can it work with audio?
Hi there @pcwii, firstly we’d like to say a huge well done on the Kodi Skill.
We’ve now moved mycroft-skills
to the 18.08 branch, and we’d really love to have the Kodi Skill available on this branch. If your Skill was already accepted into the 18.02 branch, getting it on to the 18.08 branch is likely to be really simple and easy - simply a case of submitting it to the mycroft-skills
repo again.
To make this easier, we now have the Mycroft Skills Kit - msk
- available.
To open a PR on mycroft-skills, all your have to do is:
cd <skill folder>
mycroft-msk upload .
First, activate the virtual environment.
kathyreid@kathyreid-Oryx-Pro:~/mycroft-core$ source venv-activate.sh
Entering Mycroft virtual environment. Run 'mycroft-venv-deactivate' to exit
Next, run msk upload with the path of where your Skill directory is locally.
(.venv) kathyreid@kathyreid-Oryx-Pro:~/mycroft-core$ msk upload /path/to/where/your/skill/is/your-skill-name.username
For 18.08 we have a brand new Skill README editor, available at;
https://raw.githack.com/MycroftAI/mycroft-skills/18.08/meta_editor.html
If your Skill is a straightforward resubmission, and just a README change, then we won’t put it through the full Skill Acceptance Process - we’ll just do a quick check to make sure everything’s shiny.
More information:
We're also very happy to help assist with your Skill - find us in the Skills Chatroom at Mycroft Chat.
Kind regards,
Kathy
Mycroft AI
Very happy to see some work being done on this skill. I like playing with Mycroft but it is still pretty much a toy, but a solid Kodi integration would make it really useful to me.
Most of the examples work, except for the one where I ask it to play a specific movie. I own Guardians of the Galaxy and all three Iron Man movies, but those example don't work.
Here's the output I see:
ask cody to play guardians of the galaxy
Sorry, I don't know how to play guardians of the galaxy
ask cody to play ironman
Just one moment while I look for that >> Sorry, I don't know how to play ironman
ask cody to play joker
Just a second >> Sorry, I don't know how to play joker
I can get it to recognize "kodi" if I say "kay-oh-dee-eye" quickly, but same dealio:
ask kodi to play guardians of the galaxy
Just a second
I'm not sure how to play guardians of the galaxy
But
ask kodi to play a random movie
Spider-Man: Homecoming, will start momentarily
Works.
Am I missing something? Do I need to enable something to get the Movie titles to be recognized properly?
Kodi v18.5 via Libreelec
Hi! thanks for this, very nice indeed. How can I help to get Italian up and running? unfortunately it seems that simple adding it-it vocab and dialog is not sufficient :(
I asked mycroft "zeige filme sortiert nach titel"
Which should translate to "show movies sorted by title",
Got an error. Message below:
Traceback (most recent call last):
File "/home/pi/mycroft-core/mycroft/skills/core.py", line 865, in wrapper
handler(message)
File "/opt/mycroft/skills/kodi-skill.pcwii/__init__.py", line 535, in handle_play_film_intent
movie_name = self.movie_regex(message.data.get('utterance'))
File "/opt/mycroft/skills/kodi-skill.pcwii/__init__.py", line 366, in movie_regex
my_movie = re.sub('\W', ' ', my_movie)
UnboundLocalError: local variable 'my_movie' referenced before assignment
Why do you set the kodi_ip, kodi_port, etc after checking that it has valid entries?
I don't really get it.
def on_websettings_changed(self): # called when updating mycroft home page
if not self._is_setup:
kodi_ip = self.settings.get("kodi_ip", "127.0.0.1")
kodi_port = self.settings.get("kodi_port", "8080")
kodi_user = self.settings.get("kodi_user", "")
kodi_pass = self.settings.get("kodi_pass", "")
try:
if kodi_ip and kodi_port:
kodi_ip = self.settings["kodi_ip" ]
kodi_port = self.settings["kodi_port"]
kodi_user = self.settings["kodi_user"]
kodi_pass = self.settings["kodi_pass"]
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.