Announcement

Collapse
No announcement yet.

ANNOUNCE: YouTube Plugin (API v3)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    ANNOUNCE: YouTube Plugin (API v3)

    The YouTube plugin thread is long and I cannot edit the initial post as it belongs to Triode. I've made a lot of changes since I started to maintain it so I think its better to start a new thread, as its difficult to find relevant information in the initial one.

    The stable version is in the 3rd party plugins, but if you want the dev version, add the following repository
    Code:
    http://downloads.sourceforge.net/project/lms-plugins-philippe44/dev/repo-sf.xml
    You *need* a YouTube API key, so either find somebody that gives you one or follow these steps

    - using your gmail account
    - Goto https://console.developers.google.com
    - Click: Create Project
    - Name the project. Example: YouTube-API-Key-Project
    - Leave Organization Blank
    - Click Create
    - Once at your project dashboard, in the APIs box, click: Go to APIs Overview
    - In the APIs & Services Dashboard, click: Enable APIs and Services
    - In the API Library, search for "youtube" and click: YouTube Data API v3
    - In the YouTube Data API v3 screen, click: ENABLE
    - In the YouTube Data API v3 Overview, click: CREATE CREDENTIALS
    - Under "Which API are you using?" choose: YouTube Data API v3
    - under “What data will you accessing” choose: Public data
    - Under "Where will you be calling the API from?" choose: Web browser (Javascript)
    - Under "What data will you be accessing?" choose: Public data
    - Then click "What credentials do I need?" button.
    - You should now see your API key. Copy it to your clipboard.
    - Click the link: "Restrict key"
    - Under "API restrictions" select Restrict key, and check "YouTube Data API v3"
    - Click Save
    - Return to the YouTube plugin and paste your key, making sure there are no leading or trailing spaces in what you paste.

    This plugin *requires* SSL so make sure it's installed on your LMS server. Not a problem for Windows, OSX, most Linux x86, Raspberry pi, Cubie, Odroid and others that use a Debian-based, but can be problematic with some NAS. I don't have a perfect guide, so please refer to your NAS forum, but most of the recent NAS firmware update include SSL as well, so that might be all that is required.

    Other than that, Perl must have SSL support enabled, which again is available in all recent distribution and LMS versions (I think). But in case of problem and for Debian-ish Linux, you can try "sudo apt-get install libio-socket-ssl-perl libnet-ssleay-perl" at any command prompt. Here is as well the link to the original thread http://forums.slimdevices.com/showth...l=1#post631449

    Another note regarding the "Country for Categories". I've seen a lot of people changing it to UK and complaining that they've changed nothing but the plugin does not work. So, 'UK' is *not* a region code, but 'GB' is. Not my decision https://www.worldatlas.com/aatlas/ctycodes.htm

    When you want to use your own account, you need the OAuth registration. It evolves regularly in Google and I can' update the help in the settings all the time. A tricky part is the consent screen as well as the type of application. Choose "TV and limited input" not "Desktop application"
    Last edited by philippe_44; 2022-01-28, 06:39.
    LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3

    #2
    Too cool.
    So many thanks again that you are keeping this invaluable plugin alive!
    :thumbsup:
    ---
    learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
    Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
    at penguinlovesmusic.com
    New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch

    Comment


      #3
      Originally posted by pippin View Post
      Too cool.
      So many thanks again that you are keeping this invaluable plugin alive!
      :thumbsup:
      +1
      "The only word I know is 'Grunt' - and I can't spell it" (R.I.P. D.A.)

      Comment


        #4
        Yes Thanks +1
        Logitech Media Server Version: 8.4.0 - 1678519305 @ Sat 11 Mar 2023 08:54:37 AM CET
        Operating system: Debian - EN - utf8
        Platform Architecture: x86_64-linux
        Perl Version: 5.34.0 - x86_64-linux-gnu-thread-multi
        Database Version: DBD::SQLite 1.58 (sqlite 3.22.0)​
        ​

        Comment


          #5
          Works for me

          This is working for me on my picoreplayer running LMS. Great work.

          Comment


            #6
            Working well here ..

            .. on my RPi3/Max2play/LMS7.9, thank you Phillipe.
            Server - LMS 8.4.0 RPi4B 4GB/NanoSound ONE case/pCP 8.1.0 - 75K library, playlists & LMS cache on Sata SSD (ntfs)

            Lounge - DAC32 - AudioEngine B2
            Office - RPi 3B+/HiFiBerry DAC HAT/RPi screen - Edifier D12
            Bedroom - Echo Show 8

            Spares - 1xSB Touch, 1xSB3, 4xRPi, AVI DM5 speakers

            Comment


              #7
              Please use that thread for YouTube - I'll stop answering on the old one

              placeholder
              LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3

              Comment


                #8
                Anyone got this running on ReadyNas OS 6.5.1?
                For all I know the NAS has SSL installed still I get:

                Code:
                [16-07-21 22:20:51.4145] Slim::bootstrap::tryModuleLoad (286) Warning: Module [Plugins::YouTube::Plugin] failed to load:
                Base class package "IO::Socket::SSL" is empty.
                    (Perhaps you need to 'use' the module which defines that package first,
                    or make that module available in @INC (@INC contains: /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/TrackStatPlaylist/lib /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/TrackStat/lib /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/SrvrPowerCtrl/lib /data/.apps/squeezeboxserver/cache/_Inline/lib /var/lib/squeezeboxserver/cache/InstalledPlugins /usr/share/squeezeboxserver/CPAN/arch/5.14/x86_64-linux-thread-multi /usr/share/squeezeboxserver/CPAN/arch/5.14/x86_64-linux-thread-multi/auto /usr/share/squeezeboxserver/CPAN/arch/5.14.2/x86_64-linux-gnu-thread-multi /usr/share/squeezeboxserver/CPAN/arch/5.14.2/x86_64-linux-gnu-thread-multi/auto /usr/share/squeezeboxserver/CPAN/arch/5.14/x86_64-linux-gnu-thread-multi /usr/share/squeezeboxserver/CPAN/arch/5.14/x86_64-linux-gnu-thread-multi/auto /usr/share/squeezeboxserver/CPAN/arch/x86_64-linux-gnu-thread-multi /usr/share/squeezeboxserver/CPAN/arch/5.14 /usr/share/squeezeboxserver/lib /usr/share/squeezeboxserver/CPAN /usr/share/squeezeboxserver /usr/sbin /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .).
                 at /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/YouTube/ProtocolHandler.pm line 2.
                BEGIN failed--compilation aborted at /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/YouTube/ProtocolHandler.pm line 2.
                Compilation failed in require at /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/YouTube/Plugin.pm line 18.
                BEGIN failed--compilation aborted at /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/YouTube/Plugin.pm line 18.
                Compilation failed in require at (eval 974) line 2.
                BEGIN failed--compilation aborted at (eval 974) line 2.

                Comment


                  #9
                  Open Video by CLI

                  Hi,

                  thanks for this great Plugin!

                  Is there a way, how I can open a Youtube URL by CLI, so that I can select a video by a script?

                  Claus

                  Comment


                    #10
                    Open Video by CLI

                    OK, I have found the solution:
                    Code:
                    echo -e "playlist play youtube:VIDEO_ID\nexit" | nc localhost 9090
                    Claus

                    Comment


                      #11
                      Originally posted by clausmuus View Post
                      OK, I have found the solution:
                      Code:
                      echo -e "playlist play youtube:VIDEO_ID\nexit" | nc localhost 9090
                      Claus
                      I've also added another protocolhander to play a YT playlist or channel if you know their id:
                      Code:
                      ytplaylist://[channelId | playlistId]=[id]
                      (without the [] of course)
                      LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3

                      Comment


                        #12
                        Woooohoo!!

                        Thank you!!!!!

                        Comment


                          #13
                          I've added both repositories, but I actually don't see the youtube plugin in any of them. Has it been removed?

                          Comment


                            #14
                            I unchecked "Update plugins automatically" and now I see it at the top under 'Updated plugins available". However when I check the box to enable it and restart it never gets enabled. There are some errors in the log file:

                            Code:
                            [16-07-30 19:29:22.2399] main::init (384) Starting Logitech Media Server (v7.9.0, 1453144861, Mon Jan 18 19:29:24 UTC 2016) perl 5.010000
                            [16-07-30 19:29:22.4301] Slim::Utils::PluginDownloader::extract (102) error loading Archive::Zip Compress::Raw::Zlib object version 2.021 does not match bootstrap parameter 2.033 at /share/MD0_DATA/.qpkg/LogitechMediaServer/var/home/SqueezeboxServer/CPAN/arch/5.10/Compress/Raw/Zlib.pm line 98.
                            Compilation failed in require at /share/MD0_DATA/.qpkg/LogitechMediaServer/var/home/SqueezeboxServer/CPAN/Archive/Zip.pm line 11.
                            BEGIN failed--compilation aborted at /share/MD0_DATA/.qpkg/LogitechMediaServer/var/home/SqueezeboxServer/CPAN/Archive/Zip.pm line 11.
                            Compilation failed in require at /share/MD0_DATA/.qpkg/LogitechMediaServer/var/home/SqueezeboxServer/Slim/Utils/PluginDownloader.pm line 98.
                            [16-07-30 19:29:48.4572] Slim::Plugin::UPnP::Events::error (323) Subscribe/unsubscribe error: 412 Precondition Failed
                            [16-07-30 19:29:51.7749] Slim::Plugin::UPnP::Events::error (323) Subscribe/unsubscribe error: 412 Precondition Failed
                            [16-07-30 19:29:51.7892] Slim::Plugin::UPnP::Events::error (323) Subscribe/unsubscribe error: 412 Precondition Failed
                            A version mismatch on the Zlib CPAN module somewhere. Not quite sure what the correct resolution is though.

                            Comment


                              #15
                              I moved /share/MD0_DATA/.qpkg/LogitechMediaServer/var/home/SqueezeboxServer/CPAN/arch/5.10/Compress/Raw/Zlib.pm out of the way and it now works *shrug*

                              Comment

                              Working...
                              X