YouTube Audio Skill - testing and feedback

@t_ho the youtube-skill utilizes the CommonPlay framework, so the play/stop/pause intents are handled indirectly by the playback control skill

Hi there.
Thanks for cool skill!

Installed on Picroft (clean flash) on Raspberry Pi 3 b+ (3.5 jack audio out, usb mic in)
note for those who (same as me) got silence instead youtube stream:
Seems pulseaudio have some troubles with config, so you need just do:

  1. pactl set-default-sink alsa_output.platform-soc_audio.analog-mono (use tabs to find exact name in your case, in case it says no such device)
  2. pactl set-sink-volume @DEFAULT_SINK@ +100% - to set non zero value.

Sorry if duplicating info from middle of thread but I spend hour to finding this.

3 Likes

Hi @mcdruid

This skill is absolutely fantastic - thanks!
Just reporting a bug - the skill crashes if the first result is a live stream.

Example: Hey Mycroft, play relaxing jazz.
First Result on Youtube: https://www.youtube.com/results?search_query=relaxing+jazz

CLI Output:

Traceback (most recent call last):
File “/home/pi/mycroft-core/mycroft/skills/mycroft_skill/event_container.py”, line 66, in wrapper
handler(message)
File “/home/pi/mycroft-core/mycroft/skills/common_play_skill.py”, line 153, in __handle_play_start
self.CPS_start(phrase, data)
File “/opt/mycroft/skills/mycroft-youtube-audio.mcdruid/init.py”, line 67, in CPS_start
self.search_youtube(data)
File “/opt/mycroft/skills/mycroft-youtube-audio.mcdruid/init.py”, line 85, in search_youtube
self.stream_url = self.get_stream_url(self.vid_url)
File “/opt/mycroft/skills/mycroft-youtube-audio.mcdruid/init.py”, line 108, in get_stream_url
return bestaudio.url
AttributeError: ‘NoneType’ object has no attribute ‘url’


Terry

Any way to get it to play video files every time… sometimes it plays the video file, but 95% it plays audio only

I use kde neon and vlc

Thanks for amazing skill :slight_smile:

This skill uses the Pafy library to get the best audio URL. Have a look at line 101;

def get_stream_url(self, youtube_url):
        abs_url = base_url + youtube_url
        LOG.debug('pafy processing: ' + abs_url)
        streams = pafy.new(abs_url)
        LOG.debug('audiostreams found: ' + str(streams.audiostreams));
        bestaudio = streams.getbestaudio()
        LOG.debug('audiostream selected: ' + str(bestaudio));
        return bestaudio.url

Perhaps you can change it to this (untested) to always return the best video url instead of the best audio url, which if not found returns the video url (that 5%)

def get_stream_url(self, youtube_url):
        abs_url = base_url + youtube_url
        LOG.debug('pafy processing: ' + abs_url)
        streams = pafy.new(abs_url)
        LOG.debug('videostreams found: ' + str(streams.videostreams));
        bestvideo = streams.getbestvideo()
        LOG.debug('videostream selected: ' + str(bestvideo));
        return bestvideo.url

Give it a test run and let us know :slight_smile:

the video starts, but there is no sound… and if I close the video the skill crash’es

1 Like

Right! Then we have to wait for the dev. Was just shooting from the hip. Perhaps AIX his skill might give some pointers as it is a GUI skil.

I’ve just installed again mark1 and the skills seems no longer working. Am I wrong and I need to do something special?
I try to install manually VLC and requirements.txt with pip3, but no luck either. I’m afraid the skill doesn’t work with debian jessie, as it cannot install neither vlc-bin nor vlc-plugin-base and installing full vlc doesn’t do the trick

Hi guys,
i am new to mycroft and trying to learn and understand stuff :wink:

I installed the skill through ssh, and it’s telling me it’s installed. But whenever i tell mycroft to play smth on YouTube, it would tell me what it doesn’t know what to do.
Did I miss anything?
I would appreciate a hint.

I am on the latest mycroft stable on a RPi 4 + ReSpeaker Mic Array v2

I ran into an error while trying to use the skill, it had worked correctly before hand. I believe this is due to the fact that search result returns live now videos.

Error: https://pastebin.com/tDbWuPAy

Also the “play song/artist” function conflicts with Mycroft’s own NPR news skill and starts playing foreign news. Would it be better to use Youtube as the verb? “Hey mycroft, youtube Led Zeppelin”

Hi guy, awesome work, I’ve tried it yesterday It seem to be working be today I just saying that no result bad been found. It connect well to youtube, I think maybe it’s from the Soup FindAll function but can’t be sure.

Can you have a look ? :slight_smile:

1 Like

ran into same issue… skill was awesome yesterday… something tells me youtube made changes. i tried updating the youtube dl… no luck

i already posted this in another thread, but you might want to look at

there is very minimal bs4 parsing, i only extract a json_blob, everything else is a dictionary lookup, so it is faster and less likely to break

1 Like

I have been playing with your youtube_searcher and am trying to figure out your query parameters.
I am surprised by some of the results i get or don’t get.
If I search “captain marvel” i get a result.
if I search “captain marvel trailer” i don’t get any results.
if I search “official captain marvel trailer” I get results.
is there a format I should use to get the best results then search the title from the returned json to filter my searches further?

As someone who wrote a very similar skill, I think the dream is dead. It seems that the search page is now dependent on JavaScript to actually render the results into something meaningful. The content coming back from the python requests library doesn’t actually contain the search results as parsable HTML anymore, which is why there are no search results.

Edit: @JarbasAl Sorry, I saw your post, but I didn’t know you were addressing that particular problem. I’ll see if I can implement your package and get it working.

@Hexeratops see my link above…

1 Like

@pcwii in my case i get results for all those queries except “captain marvel”

ill try to debug further and update the package, PRs welcome

1 Like

@pcwii something is weird with youtube, i almost never get results for captain marvel, but maybe 1 in 10 times i do… see https://paste.ofcode.org/QgEyMnp8292uXKyJvrmUEb

Meanwhile while debugging this i added a few more things, specifically full movies, promoted videos, corrected query, and video description, new minor version is 0.1.2

Let’s move this discussion to github

Any update on search queries working? Was looking forward to trying this out once I setup my mycroft.

I think the @JarbasAl skill is working or you could try the @gnicolas31 skill here.