This commit is contained in:
@@ -4,6 +4,11 @@ use strict;
|
|||||||
|
|
||||||
use base qw(Slim::Plugin::OPMLBased);
|
use base qw(Slim::Plugin::OPMLBased);
|
||||||
|
|
||||||
|
use File::Spec::Functions qw(catdir);
|
||||||
|
use FindBin qw($Bin);
|
||||||
|
use lib catdir($Bin, 'Plugins', 'YouTubeMusic', 'lib');
|
||||||
|
use YTMusicAPI qw(YTMusic);
|
||||||
|
|
||||||
use Slim::Utils::Strings qw(string);
|
use Slim::Utils::Strings qw(string);
|
||||||
use Slim::Utils::Prefs;
|
use Slim::Utils::Prefs;
|
||||||
use Slim::Utils::Log;
|
use Slim::Utils::Log;
|
||||||
@@ -54,6 +59,10 @@ sub getDisplayName { 'PLUGIN_YOUTUBEMUSIC' }
|
|||||||
sub mainMenu {
|
sub mainMenu {
|
||||||
my ( $client, $callback, $args ) = @_;
|
my ( $client, $callback, $args ) = @_;
|
||||||
|
|
||||||
|
my $yt = YTMusicAPI::YTMusic->new();
|
||||||
|
my $song = $yt->get_song("CF1rt_9pdgU");
|
||||||
|
my $title = $song->{"videoDetails"}->{"title"};
|
||||||
|
|
||||||
$callback->(
|
$callback->(
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -62,6 +71,10 @@ sub mainMenu {
|
|||||||
url => \&myPlaylistHandler,
|
url => \&myPlaylistHandler,
|
||||||
passthrough => [ { count => 2 } ]
|
passthrough => [ { count => 2 } ]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name => $title,
|
||||||
|
type => 'text'
|
||||||
|
}
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user