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
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"
Update 2024-02 - version 0.200
You can now have some level of control of the ranking and order of tracks/playlist/channels the plugin presents to you. It's not perfect, so just a quick recall of the concept of YT. You have the notion of tracks, playlist (a set of tracks) and channels (a set of playlists and tracks). Each item has a unique ID. The most important way to navigate the plugin is the search function. A search have the following parameters
- what is the query (a plain text question, including boolean logic |&..)
- with what ranking order do you want YT to parse the database: relevance, date, title, view counts, ratings
- what content do you want to have returned: channels, playlist, tracks (any combination of these)
- how many do you want returned at each call (50 maximum)
- each search costs 100 credits and you have 10,000 credits per 24 hours (0:00 PST reset)
YT will tell you how many total items matched your search, but will only send them by batched (pages) of up to 50. Each page containa link to the next page, so you need to follow them in order. You can't access page 5 without going through 1..4 before. So you can receive many batches/pages but it takes time.
Once you have receive a list of items, of course locally you can sort them by title, date or leave them as returned.
Now, this API has some oddities:
- You can request (list) the content of a playlist by providing its ID and YT will return its items (tracks), still paginated, but you can't ask for a ranking order. You have to do a sort locally. Such request costs 1 credit.
- You can NOT request the content of a channel by providing its ID. To access a channel when you know it's ID, you must do a full search but add the ID so that the search is limited to that channel. You can also add a query (question) but I've not allowed that option. Now, because it's search, not a list, you can as well specifiy in what ranking order you want YT to parse the channel (relevance, date, title, view counts, ratings). Bear in mind that this will cost you 100 credits as well.
Of course, every result is cached (and you can tweak that) but still keep in mind that listing channels content is expensive. Listing playlist content is not.
The plugin has a limit of the total amount of items it will ever request in a search, and it will do them page by page of 50 each, as you browse the results, when you want to see more (using whetever controller you prefer classic, material, iPeng...). That as the consequence that the plugin can only sort what it already has.
Typically, the first time it has 50 items and if you want to sort them by title, the result will be different from a sorting once you have been to the last page of the search. For example, if an item in the last page as the title 'AAA', it will not be known until you have been to that last page. You can override that by changing the "query batch size" setting, but understand that now the plugin will require as many pages of 50 each time so that it grabs "query batch size" items at each request. It can be VERY long.
To be remembered: the "ranking" order refers to the order YT uses to look at its database and see the matches and the "sorting" order refers to the sorting the plugin does once it has received a set of items. Items are received by pages of maximum 50 and the plugin can only sort what it has received. Each search, and that include channel listing, costs 100 credist and you have 10,000 credits per day.
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
- 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"
Update 2024-02 - version 0.200
You can now have some level of control of the ranking and order of tracks/playlist/channels the plugin presents to you. It's not perfect, so just a quick recall of the concept of YT. You have the notion of tracks, playlist (a set of tracks) and channels (a set of playlists and tracks). Each item has a unique ID. The most important way to navigate the plugin is the search function. A search have the following parameters
- what is the query (a plain text question, including boolean logic |&..)
- with what ranking order do you want YT to parse the database: relevance, date, title, view counts, ratings
- what content do you want to have returned: channels, playlist, tracks (any combination of these)
- how many do you want returned at each call (50 maximum)
- each search costs 100 credits and you have 10,000 credits per 24 hours (0:00 PST reset)
YT will tell you how many total items matched your search, but will only send them by batched (pages) of up to 50. Each page containa link to the next page, so you need to follow them in order. You can't access page 5 without going through 1..4 before. So you can receive many batches/pages but it takes time.
Once you have receive a list of items, of course locally you can sort them by title, date or leave them as returned.
Now, this API has some oddities:
- You can request (list) the content of a playlist by providing its ID and YT will return its items (tracks), still paginated, but you can't ask for a ranking order. You have to do a sort locally. Such request costs 1 credit.
- You can NOT request the content of a channel by providing its ID. To access a channel when you know it's ID, you must do a full search but add the ID so that the search is limited to that channel. You can also add a query (question) but I've not allowed that option. Now, because it's search, not a list, you can as well specifiy in what ranking order you want YT to parse the channel (relevance, date, title, view counts, ratings). Bear in mind that this will cost you 100 credits as well.
Of course, every result is cached (and you can tweak that) but still keep in mind that listing channels content is expensive. Listing playlist content is not.
The plugin has a limit of the total amount of items it will ever request in a search, and it will do them page by page of 50 each, as you browse the results, when you want to see more (using whetever controller you prefer classic, material, iPeng...). That as the consequence that the plugin can only sort what it already has.
Typically, the first time it has 50 items and if you want to sort them by title, the result will be different from a sorting once you have been to the last page of the search. For example, if an item in the last page as the title 'AAA', it will not be known until you have been to that last page. You can override that by changing the "query batch size" setting, but understand that now the plugin will require as many pages of 50 each time so that it grabs "query batch size" items at each request. It can be VERY long.
To be remembered: the "ranking" order refers to the order YT uses to look at its database and see the matches and the "sorting" order refers to the sorting the plugin does once it has received a set of items. Items are received by pages of maximum 50 and the plugin can only sort what it has received. Each search, and that include channel listing, costs 100 credist and you have 10,000 credits per day.
Comment