-
Notifications
You must be signed in to change notification settings - Fork 29
Module: YouTube
Allows you to browse and watch the latest videos from a curated list of YouTube channels.
Contributors: anthonycaccese
Browse
- Lists videos via YouTube RSS feeds from your curated list of channels
- Subscriptions View: Browse the latest videos from all of your curated channels in a reverse chronological list
- Channels View: Select a channel to view its latest videos
- Playlists: Browse a list of curated playlists that you manage on YouTube
- Save to Watch Later: Save videos to watch later. This is local to 240-MP (on device only), not associated to any account and the list can be cleared in settings at any time.
- View Watch History: Displays a list of recently watch videos via the module. This is local to 240-MP (on device only), not associated to any account and the list can be cleared in settings at any time.
- Choose if Shorts are displayed while browsing (default is
On/ can be toggled inSettings > YouTube)
Playback
- Playback is handled via mpv + yt-dl (please keep yt-dl up to date to reduce the chance of errors)
- Resume Playback: Resume from your last playback position or restart from the beginning
- Set Playback Resolution: 480p (default and good for the RaspberryPi), 720p and 1080p
| Option | Values | Info |
|---|---|---|
| Enabled | On/Off | Sets if the module should display in the main module list when you start 240-MP. |
| Playback Resolution | 480p (Default), 720p, 1080p | Set the resolution of the video to request for playback. I recommend to keep this on 480p for the Raspberry Pi on a CRT for best performance |
| Resume Playback | Ask/Always | 'Ask' will present you with an option to restart playback or resume and 'Always' will resume without asking |
| Display Shorts | On/Off | Choose if YouTube shorts should display while browsing Subscriptions and Channels |
| Delete Watch Later | -- | Removes your Watch Later list from youtube_watch_later.json
|
| Delete History | -- | Removes your Watch History from youtube_history.json
|
- Make sure the latest version of yt-dlp is installed (mpv requires this to resolve YouTube URLs at playback time):
- On Raspberry Pi:
- first run the following (this will install the latest direct from yt-dlp and place it directly in your path)
sudo wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O /usr/local/bin/yt-dlp- then run
sudo chmod a+rx /usr/local/bin/yt-dlp
- On macOS:
brew install yt-dlp
- On Raspberry Pi:
- Create a
youtube_subscriptions.txtfile in the 240-MP data directory- On Raspberry Pi:
~/.local/share/240-MP/youtube_subscriptions.txt - On macOS:
~/Library/Application Support/240-MP/youtube_subscriptions.txt
- On Raspberry Pi:
- And add the channel ID's you'd like to be able to view (one channel ID per line) into that file.
- Blank lines and lines starting with
#are ignored - Example:
UC-2YHgc363EdcusLIBbgxzg UCgRaK4A7yi4ZELCLUjdP_pg UC3IYhdamzjvEJ9CwkQa4RAw - Blank lines and lines starting with
- Then go to
Settings > YouTubeand setEnabledtoOn
There are a few ways to get the IDs for the channels you'd like to add to youtube_subscriptions.txt
If you'd like to use the same channel list that you have on your youtube account then you can use google takeout to generate an export of those IDs that can just be copied into youtube_subscriptions.txt
Steps
- Go to takeout.google.com (while signed in to your account)
- Under
Create a new export > Select data to includefirst press theDeselect Allbutton- We're doing this to make this export focused only on your YouTube channel list
- You should see 0 of X selected above the button after you press it (where X matches the total number of services you have)
- Scroll down until you see
YouTube and YouTube Musicand check the box for it - Click on the button that says
All YouTube data includedto open a modal and then press theDeselect Allbutton at the top of the modal - Scroll down until you see
Subscriptions, check that checkbox and then press theOkbutton to close the modal- The
All YouTube data includedbutton should have changed to say1 type selected.
- The
- Press the
Next Stepbutton to go to the "Choose file type, frequency & destination" step - Choose how you'd prefer to get the export, the frequency you'd like and then press the
Create exportbutton- I usually use
send download link via emailandexport once
- I usually use
- You'll get an email shortly with the file to download and in that export you'll get a
subscriptions.csvfile - Copy the IDs from the first column of the CSV into
youtube_subscriptions.txtand save it.- Please be sure to remove the header row called "Channel Id" if you copied it by accident
- When you open the YouTube module it will now have the same channels as your main YouTube account.
- If you get any errors check that you only copied the first column of IDs from the google takeout
subscriptions.csvexport, that theyoutube_subscriptions.txtis named correctly and its in the correct location (see details above)
- If you get any errors check that you only copied the first column of IDs from the google takeout
Often you can find the ID of a channel directly in its URL in the format youtube.com/channel/<ID>
However if the URL shows an @handle URL instead then you can view page source and search for "channelId"
As of the v2026.07.08 release the module now supports supplying a set of playlist URLs which you can use to pull in playlists that are directly managed on YouTube
It works with public and unlisted playlists only (private playlists require auth which this module does not support)
Steps
- Create a file called
youtube_playlists.txtand place it in the 240-MP data directory- On Raspberry Pi:
~/.local/share/240-MP/youtube_playlists.txt - On macOS:
~/Library/Application Support/240-MP/youtube_playlists.txt
- On Raspberry Pi:
- In that file add any public/unlisted playlist URLs or direct IDs (one per line) that you'd like to be able to browse in 240-MP
- the file will accept either URLs or Direct IDs so please feel free to use the format you prefer
- you can also supply an optional name for how the playlist will be called when displayed in 240-MP by adding
[Your custom name |before the playlist URL/ID - an example file:
TechDweeb - Dusty Game Society | PLKhoWffbfVnbX0kBv4U4TnbUGSPAr3eCP https://www.youtube.com/playlist?list=PLScCWE7AP_PUIOOSwRF_e5jR6e2rLwLoF RGC - Essential Videos | https://www.youtube.com/playlist?list=PL1_8CMUErfdvHh8BDapT3L1-5C0fLNAQe - Save that file and reload 240-MP you should see a new
Playlistentry in the main list when you open the YouTube module
Important Notes
- This leverages yt-dlp's
--flat-playlistoption to poll for playlist metadata which enables the return of "more items" (see notes below) than the traditional RSS cap of 15 that exists on YouTubes RSS feeds for playlists - That said it has some limitations to keep in mind
- Because its a poll it can take a bit more time than parsing an already existing RSS feed. This basically means that when you open the playlist menu just expect to sit for a bit longer while the playlists you've listed are parsed. There is a cache in place for 15 mins so it won't occur on every open
- Regarding the "more items" and why that doesn't say "all items"... I had to put a cap of 500 in place to prevent crashing for things like infinite auto generated playlists. in practice my guess is that limit should be more than enough but if its not... its just what we'll need to accept for this implementation. We're running YouTube on a CRT without auth so this is pretty awesome already =)
- the module is also updated to look for either a subscriptions or a playlist file now so you can have one or the other or both and it will work
If you get an error when trying to playback a video its typically resolved by updating YT-DL to the latest version. Simply run the commands listed in Step 1 from the To Enable section again.
