Difference between revisions of "Using YouTube"

From LibrePlanet
Jump to: navigation, search
m (Note about mpv)
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
YouTube is the second most popular website in the world, behind only Google. However, unlike Google, YouTube does not function at all without proprietary JavaScript (see [https://www.gnu.org/philosophy/javascript-trap.en.html The JavaScript Trap]). This guide describes a number of options for accessing this wealth of knowledge and entertainment. It also provides alternatives to posting videos to YouTube so we can reduce our dependence on it.
 
YouTube is the second most popular website in the world, behind only Google. However, unlike Google, YouTube does not function at all without proprietary JavaScript (see [https://www.gnu.org/philosophy/javascript-trap.en.html The JavaScript Trap]). This guide describes a number of options for accessing this wealth of knowledge and entertainment. It also provides alternatives to posting videos to YouTube so we can reduce our dependence on it.
  
== [https://github.com/omarroth/invidious Invidious] ==  
+
== [https://github.com/omarroth/invidious Invidious (AGPL v3.0)] ==  
 
By far the easiest option is to use a public instance of invidious.
 
By far the easiest option is to use a public instance of invidious.
 +
[https://api.invidious.io/ List of public instances.]
  
 
Youtube links looks like this: https://www.youtube.com/watch?v=AaA1a1AaA-a
 
Youtube links looks like this: https://www.youtube.com/watch?v=AaA1a1AaA-a
Line 8: Line 9:
 
Invidious links look like this: https://www.invidio.us/watch?v=AaA1a1AaA-a
 
Invidious links look like this: https://www.invidio.us/watch?v=AaA1a1AaA-a
  
Links can be manually changed or converted with an add-on.
+
Links can be manually changed or converted with an add-on, such as [https://github.com/einaregilsson/Redirector Redirector (MIT)] for Firefox-based browsers.
  
=== self-hosting invidious ===
+
Example Redirector settings to rewrite youtube to a specific invidious instance.
 +
 
 +
* Description: YouTube to puffyan invidious
 +
* Example URL: https://www.youtube.com/watch?v=AaA1a1AaA-a
 +
* Include pattern: https://www.youtube.com/*
 +
* Redirect to: https://vid.puffyan.us/$1
 +
* Pattern type: Wildcard
 +
* Pattern Description: (Intentionally left blank)
 +
* Example result: https://vid.puffyan.us/watch?v=AaA1a1AaA-a
 +
 
 +
=== Self-Hosting Invidious ===
 +
 
 +
[https://docs.invidious.io/installation/ Official install instructions]
 +
 
 +
== [https://github.com/mpv-player/mpv MPV (GPL v2.0+)] ==
 +
 
 +
It is also possible to play YouTube videos using MPV when you have youtube-dl installed. You can take any YouTube, or invidious instance link and enter it with the MPV command like so:
 +
 
 +
    mpv https://www.youtube.com/watch?v=AaA1a1AaA-a
  
 
== Command-line Programs ==
 
== Command-line Programs ==
Line 25: Line 44:
  
 
     youtube-dl https://www.youtube.com/watch?v=AaA1a1AaA-a
 
     youtube-dl https://www.youtube.com/watch?v=AaA1a1AaA-a
 +
 +
Or just use the video id:
 +
 +
    youtube-dl AaA1a1AaA-a
  
 
=== ytdl ===
 
=== ytdl ===
Line 32: Line 55:
  
 
     https://www.youtube.com/feeds/videos.xml?channel_id={channel_id}
 
     https://www.youtube.com/feeds/videos.xml?channel_id={channel_id}
 +
 +
For example, here is the feed for Kero Kero Bonito's youtube channel:
 +
 +
    https://www.youtube.com/feeds/videos.xml?channel_id=UC87PQkY3dDS-FastDm97emA
 +
 +
You can find a channel's id either in its URL or by inspecting the source and searching for "channelid"

Latest revision as of 14:18, 21 April 2022

YouTube is the second most popular website in the world, behind only Google. However, unlike Google, YouTube does not function at all without proprietary JavaScript (see The JavaScript Trap). This guide describes a number of options for accessing this wealth of knowledge and entertainment. It also provides alternatives to posting videos to YouTube so we can reduce our dependence on it.

Invidious (AGPL v3.0)

By far the easiest option is to use a public instance of invidious. List of public instances.

Youtube links looks like this: https://www.youtube.com/watch?v=AaA1a1AaA-a

Invidious links look like this: https://www.invidio.us/watch?v=AaA1a1AaA-a

Links can be manually changed or converted with an add-on, such as Redirector (MIT) for Firefox-based browsers.

Example Redirector settings to rewrite youtube to a specific invidious instance.

Self-Hosting Invidious

Official install instructions

MPV (GPL v2.0+)

It is also possible to play YouTube videos using MPV when you have youtube-dl installed. You can take any YouTube, or invidious instance link and enter it with the MPV command like so:

   mpv https://www.youtube.com/watch?v=AaA1a1AaA-a

Command-line Programs

youtube-dl

Open a terminal.

Install youtube-dl on a Debian based system.

   sudo apt install -y youtube-dl

Download a video with a command like this:

   youtube-dl https://www.youtube.com/watch?v=AaA1a1AaA-a

Or just use the video id:

   youtube-dl AaA1a1AaA-a

ytdl

RSS

You can get an RSS feed of a channel if you have its ID like so:

   https://www.youtube.com/feeds/videos.xml?channel_id={channel_id}

For example, here is the feed for Kero Kero Bonito's youtube channel:

   https://www.youtube.com/feeds/videos.xml?channel_id=UC87PQkY3dDS-FastDm97emA

You can find a channel's id either in its URL or by inspecting the source and searching for "channelid"