Plexmusic Skill - Test and Feedback

Mycroft is learning how to read Plex media Servers. (Plex Homepage)
I would really appreciate any help to get the skill into the marketplace, feel free to give any kind of feedback to the Sourcecode on GitHub
Nobody should ever be missing features :wink:

Install via msm by typing

msm install https://github.com/colla69/plexmusic-skill.git

I am interested in testing the installation and the synchronization with the PlexMediaServer, as well as the requirements scripts. I work on KDE and have no means to test the functionalities on different devices.

After the installation the skill will try to download metadata from the server. That will only be possible by adding configuration. After you configured the skill you can refresh your library using an intent.

Hey Mycroft, refresh|reload libray

Feel free to reply in the comments or to contact me privately on a.colarietitosti@googlemail.com if you need any help.

Please take a look at the README on github as it contains further information about the configuration and usage of the skill.

I plan to extend functionalities, once i am happy with the VLC-backend. I would like to have it play radio channels as well as being able to add the song i am currently listening to i like to a playlist.

I wish you all happy testing :slight_smile:

colla

3 Likes

Very exciting, thanks colla!

Will try to find some time to give it a test run over the weekend :slight_smile:

Thanks gez :slight_smile:
I read about your AFK time

congrats :slight_smile:

1 Like

Super excited about this skill as I don’t have/want to use spotify or any other commercial music service and I have all my music on my plex instance!

I’ll test it this very evening!

It doesn’t work on my settings.

Connected to Messagebus!
17:59:24.769 - Playback Control Skill - INFO - Resolving Player for: Helevorn
17:59:25.121 - Playback Control Skill - INFO -    No matches
  ^--- NEWEST ---^ 

I configured the skill through the Account site, like this


As you can see, I used the internal IP address with the port, instead of the published IP, as I connect plex through https://app.plex.tv

I’ve also tried to edit mycroft.conf and adding the settings, it doesn’t work either.

Is like the skill isn’t properly installed, when I try to refresh library, skill.log says:

18:57:08.969 - QuestionsAnswersSkill - INFO - Searching for refresh library
18:57:10.166 - QuestionsAnswersSkill - INFO - Timeout occured check responses

Hey malevolent :slight_smile: thanks for testing.

try configuring it with the IP ( http://192.168.1.100 ).
It should load your library on startup, it will say something as it is done loading, after that the search should work.
The “refresh library” Intent should also work then, in case it doesn’t try changing the skill priorities in your mycroft.conf .

And let me know if you get it running :wink:

Sorry, I forgot to tell I also tried the URL without the port. No luck.

I don’t know how to change priorities. And that means to set higher priority for plexmusic over Pandora or spotify skills?

hey :slight_smile:

forget the priorities 
 we’ll fix that problem when and if it arises at all :slight_smile: /
My best guess at the moment is, the skill throws an exception on init and doesn’t load at all :confused:
Would you please try it this way:

-msm uninstall plexmusic-skill > wait for it to uninstall correctly.
-stop mycroft through “stop-mycroft.sh”
-clear the content of /var/log/mycroft/skills.log
-write the configuration in your mycroft.conf

“plexmusic-skill”: {
“musicsource”: “http://192.168,1,100”,
“plextoken”: “----8s6uP----abc4sRYe”,
“plexlib”: “music”,
“ducking”: true
}

-start mycroft through command “mycroft-start.sh debug”
-let the boot process finish > send to me the content of /var/log/mycroft/skills.log

Hopefully I can find out how the problem arises.
Thank you for your help :slight_smile:

Sorry for the late response
 I think we’re are on a opposite timezone :pensive:

I had to do it a bit different as you suggested, as I have a Mark I, but I think it will be valid for you:

msm remove plexmusic-skill
systemctl stop mycroft-skills.service
truncate --size=0 /var/log/mycroft/skills.log

Edited mycroft.conf and added the plexmusic-skill section, then:

systemctl start mycroft-skills.service

Here you have the skill.log after everything is up.
https://privatebin.net/?069749a8b24d0554#DPcNVYUvuEWyoz2xmUdRDRrsXHLyAjKrfeB9st1m4YGj

What I didn’t undestood is why you didn’t made me install back plexmusic-skill, so, to save 24h, I repeated the steps but now adding the skill, just in case :wink:

systemctl stop mycroft-skills.service
truncate --size=0 /var/log/mycroft/skills.log
msm install https://github.com/colla69/plexmusic-skill.git

The skill isn’t shown on home.mycroft.ai/skills

systemctl start mycroft-skills.service

And the skills.log:
https://privatebin.net/?4560a23ff2baa59b#DBWkqWTNmv6Sappx12DGgEnZbhoSWUKY2yro1s5n7SCw

Here we can clearly view there is a problem loading the skill

12:34:42.328 - mycroft.skills.core:load_skill:122 - INFO - ATTEMPTING TO LOAD SKILL: plexmusic-skill.colla69 with ID plexmusic-skill.colla69
12:34:43.553 - mycroft.skills.core:load_skill:169 - ERROR - Failed to load skill: plexmusic-skill.colla69
Traceback (most recent call last):
  File "/opt/venvs/mycroft-core/lib/python3.4/site-packages/mycroft/skills/core.py", line 135, in load_skill
    skill = skill_module.create_skill()
  File "/opt/mycroft/skills/plexmusic-skill.colla69/__init__.py", line 370, in create_skill
    return PlexMusicSkill()
  File "/opt/mycroft/skills/plexmusic-skill.colla69/__init__.py", line 168, in __init__
    self.vlc_player.get_media_player().audio_set_volume(100)
  File "/opt/venvs/mycroft-core/lib/python3.4/site-packages/vlc.py", line 2654, in get_media_player
    return libvlc_media_list_player_get_media_player(self)
  File "/opt/venvs/mycroft-core/lib/python3.4/site-packages/vlc.py", line 4926, in libvlc_media_list_player_get_media_player
    ctypes.c_void_p, MediaListPlayer)
  File "/opt/venvs/mycroft-core/lib/python3.4/site-packages/vlc.py", line 246, in _Cfunction
    raise NameError('no function %r' % (name,))
NameError: no function 'libvlc_media_list_player_get_media_player'

By the way, vlc is installed.

pi@mark_1:~ $ dpkg -l| grep vlc
ii  libvlc5                            2.2.7-1~deb8u1                              armhf        multimedia player and streamer library
ii  libvlccore8                        2.2.7-1~deb8u1                              armhf        base library for VLC and its modules
ii  vlc                                2.2.7-1~deb8u1                              armhf        multimedia player and streamer
ii  vlc-data                           2.2.7-1~deb8u1                              all          Common data for VLC
ii  vlc-nox                            2.2.7-1~deb8u1                              armhf        multimedia player and streamer (without X support)
ii  vlc-plugin-notify                  2.2.7-1~deb8u1                              armhf        LibNotify plugin for VLC
ii  vlc-plugin-samba                   2.2.7-1~deb8u1                              armhf        Samba plugin for VLC

I think you need to upload your vlc. I am currently running 3.0.7.1

╭─cola@cola-Desktop â€čsystemâ€ș 
╰─$  dpkg -l| grep vlc

ii  libvlc-bin:amd64                                3.0.7.1-0ubuntu18.04.1                              amd64        tools for VLC's base library
ii  libvlc5:amd64                                   3.0.7.1-0ubuntu18.04.1                              amd64        multimedia player and streamer library
ii  libvlccore9:amd64                               3.0.7.1-0ubuntu18.04.1                              amd64        base library for VLC and its modules
ii  phonon4qt5-backend-vlc:amd64                    0.10.1-2                                            amd64        Phonon4Qt5 VLC backend
ii  vlc                                             3.0.7.1-0ubuntu18.04.1                              amd64        multimedia player and streamer
ii  vlc-bin                                         3.0.7.1-0ubuntu18.04.1                              amd64        binaries from VLC
ii  vlc-data                                        3.0.7.1-0ubuntu18.04.1                              all          common data for VLC
ii  vlc-l10n                                        3.0.7.1-0ubuntu18.04.1                              all          translations for VLC
ii  vlc-plugin-base:amd64                           3.0.7.1-0ubuntu18.04.1                              amd64        multimedia player and streamer (base plugins)
ii  vlc-plugin-notify:amd64                         3.0.7.1-0ubuntu18.04.1                              amd64        LibNotify plugin for VLC
ii  vlc-plugin-qt:amd64                             3.0.7.1-0ubuntu18.04.1                              amd64        multimedia player and streamer (Qt plugin)
ii  vlc-plugin-samba:amd64                          3.0.7.1-0ubuntu18.04.1                              amd64        Samba plugin for VLC
ii  vlc-plugin-skins2:amd64                         3.0.7.1-0ubuntu18.04.1                              amd64        multimedia player and streamer (Skins2 plugin)
ii  vlc-plugin-video-output:amd64                   3.0.7.1-0ubuntu18.04.1                              amd64        multimedia player and streamer (video output plugins)
ii  vlc-plugin-video-splitter:amd64                 3.0.7.1-0ubuntu18.04.1                              amd64        multimedia player and streamer (video splitter plugins)
ii  vlc-plugin-visualization:amd64                  3.0.7.1-0ubuntu18.04.1                              amd64        multimedia player and streamer (visualization plugins)

I hope this fixes the problem :slight_smile: good luck

The I Heart Radio Skill was facing a similar issue with VLC, details are here:

TLDR:
from mycroft.audio.services.vlc import VlcService
https://github.com/johnbartkiw/mycroft-skill-iheartradio/blob/master/init.py

That’s exactly what i was thinking about when i wrote:
“I plan to extend functionalities, once i am happy with the VLC-backend
” :slight_smile:
I read the VlcService code and it has all the functionalities I originally had in mind :sparkler::tada:

Thank you, a lot :slight_smile:

Hey @malevolent , i just swapped my VLC service with the one suggested by @gez-mycroft.

Could please reinstall the skill, and let me know if it solves your problem?
( Just to be sure

you should be using commit a9dc40ff77ef7125e8e81046c15e05e8dca2a99c or later :wink: )

Thank you both, :slight_smile:
colla

Unfortunately, Mark I is still on Debian 8. And its VLC its frozen at version 2.2.
So no luck until Mark I will be upgraded to Debian 10 (hopefully some day)


I can try the skill on arch linux, but it would have been great to listen music directly on the Mark I.

Thanks for the note, Malevolent. I too am a Mark I user, and also very interesting in Plex capability. That would be really fun functionality to add to Mycroft, and one of those features that could be a real differentiator (with respect to the other “big” names in digital assistant/voice automaton/etc).

I tried this skill on an arch linux desktop. It doesn’t install via mycroft-msm, and git cloning the repo and pip installing the requirements, either work

Traceback (most recent call last):
  File "/home/malevolent/development/mycroft-core/mycroft/skills/skill_loader.py", line 204, in _load_skill_source
    skill_module = imp.load_module(
  File "/usr/lib/python3.8/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/usr/lib/python3.8/imp.py", line 171, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 779, in exec_module
  File "<frozen importlib._bootstrap_external>", line 916, in get_code
  File "<frozen importlib._bootstrap_external>", line 846, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/mycroft/skills/plexmusic-skill/__init__.py", line 22
    <<<<<<< Updated upstream
    ^
SyntaxError: invalid syntax
 19:31:24.538 | ERROR    | 217249 | mycroft.skills.skill_loader:_communicate_load_status:287 | Skill plexmusic-skill failed to load

Looks like an unresolved git merge conflict.

@malevolent @j1nx
Hey guys 
 sorry for taking so long


I corrected the errors 
 that is kind of embarassing i should have foreseen that happening.
I also had to install a new Mycroft device and set it up from scratch, it had some problems loading the configuration.
It eventually loaded the values after a couple restarts.
You can see that the configuration hasn’t loaded right when it logs:

 connecting to:

Without any content.

If you still have the motivation to do so you should be able to test it now.

I broke it as i was implementing a set of new features that are still missing documentation, they should be working now.

  • by search -> “Hey Mycroft, play {Title} by {Author}”
    If you had the skill running before you should reload the config to get the new search keys built. Call “Hey Mycroft, reload library” and wait for it to confirm completition.
  • random music -> “Hey Mycroft, play [some] random music”
    it will shuffle all the titles from your library
  • add to playlist -> “Hey Mycroft, add to playlist {playlistName}”
    will add the title you are listening to to the named playlist. The playlist needs to exist and be loaded in your local config. so if you add a playlist after downloading your track list. you should “Hey Mycroft, reload library” before you can add anything to it.

Let me know how it goes :slight_smile: I am happy to get any kind of contribuition.
Have a Nice Weekend and Happy Testing!

EDIT: added explanation for reloading config to init by search on an existing installation

Humm, I cannot see Plexmusic skill on home.mycroft.ai to configure it now.
and mycroft says configuration is missing, configure plexskill

I’ve rm -rf the skill and msm installed again, but it still doesn’t appears on home.mycroft.ai
 can I be able to configure it via configuration file?