Youtube: Difference between revisions

From 太極
Jump to navigation Jump to search
No edit summary
 
(120 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Learning ==
= Download videos =
* [https://itsfoss.com/download-youtube-videos-ubuntu/ 3 Easy Ways to Download YouTube Videos in Ubuntu and Other Linux Distributions]
** Download YouTube Videos using Firefox Add-on ‘Video DownloadHelper’
** 3 Applications to download YouTube videos in Ubuntu and other Linux distributions: '''Clipgrab''', '''4K Video Downloader''',  '''youtube-dl'''
 
== VLC ==
See [[Vlc#Tips.2Ffeatures|VLC tips]].
# Play the video in VLC
# On VLC, check Tools -> Codec information and find a URL there
# Open the URL on a browser. Right click the video and choose to save the video.
 
The method works for youtube and vimeo videos.
 
== Firefox/Chrome add-on ==
[https://itsfoss.com/download-youtube-videos-ubuntu/ 3 Easy Ways to Download YouTube Videos in Ubuntu and Other Linux Distributions]
 
[http://www.downloadhelper.net/ Video DownloadHelper] add-on works fine when I test it on Firefox and Chrome. I need to install an app [http://www.downloadhelper.net/install-coapp Video DownloadHelper companion app] (the source code is on Github) in order to use the extension. It saves the videos to ~/dwhelper folder.
 
== Online websites ==
* https://yt5s.com/en62
* https://9convert.com/en230
* https://ytmp3.tube/
 
== Open source app ==
* YouTube Downloader Plus https://ytdn.netlify.app/. Snap, flathub, AppImage, macOS, Windows,... ytDownloader lets you download Videos and Extract Audios of different formats from hundreds of sites including but not limited to Youtube, Facebook, Tiktok, Twitch, Twitter, Instagram and so on...
 
== Host your own downloader ==
 
=== metube ===
<ul>
<li>[https://blog.rphl.io/selfhosted-youtube-downloader-with-docker/ Host your own YouTube-Downloader with Docker]
<li>[https://www.reddit.com/r/selfhosted/comments/ufxouk/download_youtube_videos_host_locally/ Download YouTube videos, host locally?]
* [https://hub.docker.com/r/alexta69/metube MeTube] & [https://github.com/alexta69/metube github]. The website instructs users to update yt-dlp regularly using tools such as [https://github.com/containrrr/watchtower watchtower].
: <syntaxhighlight lang='bash'>
docker run --rm -p 8081:8081 -v $(pwd):/downloads \
      --name metube ghcr.io/alexta69/metube
# http://localhost:8081/
</syntaxhighlight>
* [https://github.com/bbilly1/tubearchivist TubeArchivist],
* [https://github.com/Tzahi12345/YoutubeDL-Material YoutubeDL-Material],
* TubeSync. It doesn't have a video player built in and doesn't support downloading individual videos. But works really well for playlist/channel downloading.
</li>
<li>[https://github.com/axcore/tartube Tartube]. Looks interesting!
</ul>
 
=== Media Downloader ===
[https://github.com/mhogomchungu/media-downloader Media Downloader is a Qt/C++ front end to yt-dlp, youtube-dl, gallery-dl, lux, you-get, svtplay-dl, aria2c, wget and safari books]
 
=== Parabolic ===
* https://github.com/NickvisionApps/Parabolic Download web video and audio
* [https://www.tecmint.com/parabolic-download-videos-from-websites-linux/ Parabolic: A Powerful Tool for Downloading Online Media on Linux]
 
=== Tube Converter ===
[https://news.itsfoss.com/tube-downloader/ Tube Converter: An Open Source Tool to Download YouTube Videos]
 
== Youtube-dl ==
<ul>
<li>https://rg3.github.io/youtube-dl/download.html
<ul>
<li>It is based on Python2. Ubuntu 20.04 does not include python2.
</li>
<li>[https://github.com/ytdl-org/youtube-dl/blob/master/docs/supportedsites.md Supported sites] </li>
</ul>
<li>[https://github.com/yt-dlp/yt-dlp yt-dlp] A youtube-dl fork with additional features and fixes </li>
<li>[https://linoxide.com/linux-how-to/best-youtube-video-downloader-ubuntu/ What are the Best Youtube Video Downloader for Ubuntu] </li>
<li>[http://video.media.io/youtube-downloader/best-youtube-downloader-linux.html The Best YouTube Downloader on Linux]: youtube-dl, Minutube, ClipGrab </li>
<li>[https://www.how2shout.com/tools/4-best-open-source-free-youtube-downloader-for-ubuntu-linux.html 4 Best open source & free YouTube Downloader for Ubuntu Linux]
{{Pre}}
# which youtube-dl
# sudo rm /usr/bin/youtube-dl
 
# Method 1.
sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
 
# Method 2.
sudo pip install --upgrade youtube_dl
 
# Log out and log in
youtube-dl --version
# 2019.01.02
 
# Download as an mp4
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' URL
# Download a youtube playlist
youtube-dl -f mp4 --yes-playlist URL
</pre>
<ul>
<li>[https://www.how2shout.com/how-to/how-to-install-4k-video-downloader-youtube-on-ubuntu-linux.html 4K Video Downloader Ubuntu], </li>
<li>[https://clipgrab.org/ ClipGrab], </li>
<li>[https://youtube-dl.org/ Youtube-dl], </li>
</ul>
<li>For videos with 1080p resolution, youtube-dl will download 720p by default. To download 1080p, see [http://askubuntu.com/questions/486297/how-to-select-video-quality-from-youtube-dl this post]
{{Pre}}
# show the available resolutions
youtube-dl -F XXX
# download the desired resolution
youtube-dl -f 137+141 XXXX
# Note the two numbers 137, 141 is case dependent. They could be 137 & 140.
youtube-dl -f 22 XXX
# if the format 22 is mp4. If I do not specify the format, the mkv file will be downloaded
# But playing mkv file tends to be stuttering with VLC.
</pre>
<s>This assumes Ubuntu has installed '''avconv'''; otherwise video(mp4) and audio(m4a) files will be downloaded separately. </s>To install avconv, install the '''libav-tools''' package. Note that '''libav-tools''' was replaced by '''ffmpeg''' in Ubuntu 18.04.
{{Pre}}
sudo apt-get install ffmpeg
</pre>
</li>
<li>[http://www.webupd8.org/2014/11/youtube-command-line-player-and.html Play/Download youtube video] using [https://github.com/np1/mps-youtube mps-youtube]
{{Pre}}
mps-youtube
</pre>
</li>
<li>4k videos [http://www.imaging-resource.com/news/2014/11/19/samsung-nx1-4k-video-samples-and-new-full-res-frame-grabs-available-for-do samples] (vlc v2.1.4 cannot play), [https://youtu.be/ftlvreFtA2A FLYING OVER NORWAY]
</li>
<li>8K videos [https://youtu.be/mHUOCxVT5ro Yellowstone National Park in 8K 60P], [https://youtu.be/1La4QzGeaaQ Peru]
</li>
</ul>
 
=== stuttering ===
https://github.com/ytdl-org/youtube-dl/issues/29326#issuecomment-966416070
<pre>
VERSION=8e069597c658810567ced5f8046dc5d14ab93037
wget https://github.com/ytdl-org/youtube-dl/archive/$VERSION.zip
unzip $VERSION.zip
cd youtube-dl-$VERSION
sudo pip install .
</pre>
 
=== Minitube ===
* [https://flavio.tordini.org/minitube MiniTube]
* It is preinstalled in [https://voyagerlive.org/ Voyager Linux] and in the dock.
 
=== '''[https://github.com/mps-youtube/mps-youtube mpsyt]''': mps-youtube (mp3 + stream + youtube) ===
By default, mps-youtube is basically a YouTube audio player (and downloader), but you can enable external video playback (via mpv or MPlayer) from its options. Check out
* An [http://www.webupd8.org/2014/11/youtube-command-line-player-and.html article] on webupd8.
* More keyboard controls can be found on the webpage of [https://github.com/np1/mps mps].
 
Installation on Linux (works on Odroid with low CPU usage for audio stream from youtube but Odroid gives dirty noise when I played the music).
{{Pre}}
sudo apt-get install python3-pip
sudo pip3 install mps-youtube
sudo pip3 install youtube_dl
 
# On Ubuntu/Mint. Do not use mplayer. Use mpv instead.
# sudo add-apt-repository ppa:mc3man/mpv-tests
# sudo apt-get update && sudo apt-get install mpv
 
mpsyt  # launch
set player mpv
pl https://www.youtube.com/playlist?list=PL6h94tLpXv3LabUa7B0tCz7K0pI5ZzZEi  # a playlist
h      # help
Space  # pause
p      # play
q      # quit mpsyt
 
h search
url https://www.youtube.com/watch?v=hgIfZz8STLk  # retrieve specific youtube video by url or id
</pre>
 
[http://lifehacker.com/mps-youtube-is-a-terminal-based-youtube-player-and-down-1651752380 Installation on Windows]
 
Some highlight
* Search
* Local playlist
* support YouTube Playlists
* Download
* Music Album Matching
 
If something is wrong with using 'set' command, just run ''rm -rf ~/.config/mps-youtube/'' and restart everything.
 
By default, it only streams audio. To watch the video, use '''set show_video true'''.
 
Below is what I got from the ''set'' command (as you can see the default player is '''mpv''')
<pre>
  Key                Value                                                 
  order            : relevance
  user_order        :
  max_res          : 2160p
  player            : mpv
  playerargs        :
  encoder          : 0 [None]
  notifier          :
  checkupdate      : True
  show_mplayer_keys : True
  fullscreen        : False
  show_status      : True
  columns          :
  ddir              : /home/odroid/Downloads/mps
  overwrite        : True
  show_video        : False
  search_music      : True
  window_pos        :
  window_size      :
  download_command  :
  audio_format      : auto
  api_key          : AIzaSyCIM4EzNqi1in22f4Z3Ru3iYvLaY8tc3bo
</pre>
 
The screenshot shows mpsyt contains basic playing keyboard shortcuts.
 
[[File:Mps-youtube.png|200px]]
 
[Update 4-7-2017]: to fix an [https://github.com/mps-youtube/mps-youtube/issues/376 error] Signature extraction failed: Traceback (most recent call last):
{{Pre}}
sudo apt-get remove -y youtube-dl  # Removing youtube-dl (2014.02.17-1) ...
sudo pip3 install -U youtube-dl
 
$ youtube-dl --version
2017.04.11
</pre>
 
=== yewtube: forked from mps-youtube ===
* https://github.com/mps-youtube/yewtube & [https://github.com/mps-youtube/yewtube/wiki/Troubleshooting Troubleshooting/FAQ]. Install by pip or pipx.
* Tested on Nvidia Jetson nano with Ubuntu 20.04. It will call VLC media player for video playback (I have mplayer & VLC installed).
* [https://www.linuxuprising.com/2023/03/yewtube-is-feature-packed-terminal.html yewtube Is A Feature Packed Terminal Based YouTube Player]
 
=== mp3 download ===
<ul>
<li>[https://itsfoss.com/youtube-dl-audio-only/ How to Download Audio Only Using youtube-dl] & Download entire YouTube playlist in MP3 format. </li>
<li>To download mp3 from a Youtube Video (assume libav-tools or ffmpeg has been installed). See more info [https://askubuntu.com/questions/178481/how-to-download-an-mp3-track-from-a-youtube-video here].
{{Pre}}
youtube-dl -x --audio-format mp3 URL
youtube-dl --extract-audio --audio-format mp3 URL
</pre>
</li>
<li>To convert the video to mp3 format, use soundconverter
{{Pre}}
sudo apt-get install soundconverter
</pre>
</li>
<li>
[https://www.linuxuprising.com/2019/10/how-to-download-youtube-playlist-and.html How To Download A YouTube Playlist And Convert It To MP3 Using youtube-dl (Command Line)]
</li>
</ul>
 
=== mpv ===
* mpv depends on youtube-dl but we need to install youtube-dl manually.
** Youtube-dl depends on python. On Ubuntu it only has python3 but no python. A quick solution: '''sudo ln -s /usr/bin/python3 /usr/bin/python'''
* http://www.makeuseof.com/tag/terminal-alternatives-linux-desktop-apps/
* http://www.makeuseof.com/tag/5-amazing-linux-video-players-for-watching-movies-and-shows/
* [https://itsfoss.com/mpv-video-player/ MPV Player: A Minimalist Video Player for Linux]
* [https://defkey.com/mpv-media-player-shortcuts mpv keyboard shortcuts]
* https://wiki.archlinux.org/index.php/Mpv. [https://github.com/mpv-player/mpv/issues/4241 Choosing the resolution].
<ul>
<li>Play youtube audio only
<pre>
mpv link_to_youtube_vid --no-video
</pre>
</li>
<li>[https://www.linuxuprising.com/2021/07/open-youtube-and-more-videos-from-your.html Open YouTube (And More) Videos From Your Web Browser With mpv [Firefox, Chrome]]. Using this is especially useful if your web browser doesn't support '''hardware-accelerated video playback'''.
 
<pre>
sudo apt install mpv
mpv --ytdl-format="bestvideo[height<=?1080]+bestaudio/best" <URL_of_Video>
 
mpv --start=56:00 Some_YT_URL    # include time
mpv https://youtu.be/JlHsTd7nJW0?t=16  # embed time in the URL
</pre>
</li>
<li>Record live youtube video. For some reason, mp4 or mkv format does not work.
<pre>
mpv --stream-record=video.ts https://youtu.be/UCG1aXVO8H8
</pre>
</li>
<li>Keyboard shortcuts:
* Shift+o: toggle show progress
* volume control: 9/0
* m: mute
* Upper/down arrow: seek 60 seconds
* Left/right arrow: seed 5 seconds
* [: decrease speed
* ]: increase speed
* s: take a screenshot
* q: quit, save current position
</li>
</ul>
 
=== yt-dlp: download youtube video ===
<ul>
<li>By default, the video file has an extension webm. If we choose to [https://www.reddit.com/r/youtubedl/comments/otjtex/comment/h6vyoef/?utm_source=share&utm_medium=web2x&context=3 download a video file as an mp4 format], the file size will be quite large (e.g. triple).
<li>[https://github.com/yt-dlp/yt-dlp yt-dlp]: A youtube-dl fork with additional features and fixes. To install the binary
{{Pre}}
sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
sudo chmod a+rx /usr/local/bin/yt-dlp
</pre>
To download a video as mp3,
<syntaxhighlight lang='sh'>
yt-dlp -f 'ba' -x --audio-format mp3 URL
</syntaxhighlight>
To [https://write.corbpie.com/downloading-youtube-videos-and-playlists-with-yt-dlp/ download a video as mp4] and embed subtitles to video file (if they exist),
<syntaxhighlight lang='sh'>
yt-dlp -f 'bv[height=1080][ext=mp4]+ba[ext=m4a]' \
  --embed-subs --merge-output-format mp4 URL
</syntaxhighlight>
<li>[https://www.makeuseof.com/download-youtube-videos-yt-dlp-linux-terminal/ How to Download YouTube Videos on Linux Using yt-dlp]
<li>[https://ostechnix.com/yt-dlp-tutorial/ Yt-dlp Commands: The Complete Tutorial For Beginners (2023)]
</ul>
 
=== '''ytfzf''': search & play or download ===
* https://github.com/pystardust/ytfzf
* antiX-21 starts to use ytfzf to replace mps-youtube. See [https://antixlinux.com/antix-21-grup-yorum-released/ antiX-21 (Grup Yorum) released]
* [https://www.makeuseof.com/watch-youtube-videos-in-linux-terminal/ How to Watch YouTube Videos in the Linux Terminal With ytfzf]. It uses '''yt-dlp''' to download & stream the video to '''mpv'''.
** It's useful to create an alias in ~/.bashrc e.g. '''alias youtube="ytfzf"'''
* [https://www.linuxuprising.com/2021/03/ytfzf-search-with-thumbnails-and-play.html ytfzf - Search (With Thumbnails) And Play YouTube Videos From A Terminal]
** Download
** Video history
** Choose the media format (add "-f" option to see available resolution)
** Queue multiple tracks
** Audio only
** Auto-play
** Repeat
** Playlist (not yet)
* [https://www.linuxfordevices.com/tutorials/linux/ytfzf-play-youtube-videos-in-terminal YTFZF – Search and play YouTube videos in the Terminal]. 'kitty' was used as the thumbnail viewer. But kitty was removed from builtin due to it not working with fzf [https://github.com/pystardust/ytfzf/releases v2.5.5].
 
<pre>
# Tested on new Ubuntu 22.04 Desktop x64
sudo apt install jq mpv fzf git python3-pip python3-wheel \
    python3-dev python3-xlib libx11-dev libxext-dev \
    libxres-dev make curl
git clone https://github.com/pystardust/ytfzf
cd ytfzf
sudo make install
 
# First test: failed
ytfzf  URL
# Got an error -
# [ytdl_hook] ERROR: [youtube] 5NJ6V8i1Xd8: Unable to extract uploader id
 
yt-dlp --version
sudo apt-get remove yt-dlp
sudo apt-get install python3-pip
pip3 install --user yt-dlp
nano ~/.bashrc
# add export PATH=$PATH:/home/brb/.local/bin
source ~/.bashrc
which yt-dlp
yt-dlp --version
 
# Handling ueberzug
# See https://github.com/WhiteBlackGoose/ueberzug-latest
pip install setuptools
git clone https://github.com/WhiteBlackGoose/ueberzug-latest && cd ueberzug-latest
sudo pip install -e .
 
# ytfzf -t cti   
# Works perfect!
</pre>
<pre>
sudo apt install jq mpv fzf  # youtube-dl
sudo apt install build-essential  # neeed 'make'
 
git clone https://github.com/pystardust/ytfzf
cd ytfzf/
sudo make install
sudo make install doc  # optional
which ytfzf
# /usr/local/bin/ytfzf
 
sudo apt install socat  # to use mpv as the thumbnail viewer
ytfzf -T mpv -t scRNA  # -t means thumbnails,  scRNA is an example of some keywords
            # Note two mpv windows will be opened.
            # resize the 'terminal'-like mpv window so the thumbnail window is
            #    next to the 'terminal'-like mpv window
ytfzf -d scRNA  # -d means download
ytfzf URL      # same as 'mpv URL'
 
$ mpv --version
mpv 0.35.1 Copyright 2000-2023 mpv/MPlayer/mplayer2 projects
 
$ ytfzf --version
ytfzf: 2.5.5
 
$ ytfzf --help
Usage: ytfzf [OPTIONS] <search-query>
  OPTIONS:
    -h, --help                          Show this help text
    -v, --version                        -v for ytfzf's version, --version for ytfzf + youtube-dl's version
    -t, --thumbnails                    Show thumbnails (requires ueberzug)
                                          Doesn't work with -H -D
    -D, --ext-menu                      Use external menu(default dmenu) instead of fzf
    -H, --choose-from-history            Choose from history
    -x, --clear-history                  Delete history
    -m, --audio-only  <search-query>    Audio only (for music)
    -d, --download    <search-query>    Download to current directory
    -f                <search-query>    Show available formats before proceeding
    -a, --auto-play    <search-query>    Auto play the first result, no selector
    -r  --random-play  <search-query>    Auto play a random result, no selector
    -n, --video-count= <video-count>    To specify number of videos to select with -a or -r
    -l, --loop        <search-query>    Loop: prompt selector again after video ends
    -s                <search-query>    After the video ends make another search
    -L, --link-only    <search-query>    Prints the selected URL only, helpful for scripting
 
    --previews=      <left/right>      the side of the screen to show thumbnails
    --upload-time=    <time-range>      Time range can be one of, last-hour, today, this-week, this-month, this-year
                  You can also put the filter as it's own option eg: --today
    --upload-sort=    <sort-filter>    The filter to sort the videos can be one of, upload-date, view-count, rating
                  You can also put the filter as it's own option eg: --upload-date
    --filter-id=      <filter>          The id of the filter to use for video reults
                  A filter id can be found by going to youtube searching, filtering how you want
                  Then taking the value of the &sp= part of the url
                  Filters may not work especially when the filter sorts for non-videos
                  In addition this overrides any filter provided through options
                  Example: ytfzf --filter-id=EgJAAQ minecraft
                  This will filter by livestream
 
    --update                            clones the latest commit and installs it
                  on Arch ytfzf is available in the AUR
  Use - instead of <search-query> for stdin
 
  Option usage:
    ytfzf -fDH                          to show history using external
                                          menu and show formats
    ytfzf -fD --choose-from-history      same as above
 
  Defaults can be modified through ENV variables
  Defaults:
    YTFZF_HIST=1                          0 : off history
    YTFZF_CACHE=~/.cache/ytfzf
    YTFZF_LOOP=0                          1 : loop the selection prompt
    YTFZF_PREF=''                        22: 720p,  18: 360p
    YTFZF_CUR=1                          For status bar bodules
    YTFZF_EXTMENU=' dmenu -i -l 30'
  To use rofi
    YTFZF_EXTMENU=' rofi -dmenu -fuzzy -width 1500'
    YTFZF_ENABLE_FZF_DEFAULT_OPTS=0      1 : fzf will use FZF_DEFAULT_OPTS
 
  For more details refer https://github.com/pystardust/ytfzf
</pre>
 
=== Convert av1 format to h264 format ===
This is necessary if we add videos to Plex. [https://stackoverflow.com/a/2411987 Convert a video to MP4 (H.264/AAC) with ffmpeg].
 
Use Handbrake. [https://www.maketecheasier.com/convert-video-to-mp4-handbrake-linux/ Converting Video Files to H.264 MP4 Format Using HandBrake on Linux]
<pre>
$ apt-cache show handbrake-cli
$ sudo apt-get install handbrake-cli
$ HandBrakeCLI --help
$ HandBrakeCLI -e x264 -i input.mp4 -o output.mp4
</pre>
 
=== GUI ===
* [https://itsfoss.com/youtube-dl-gui-apps/ Not Comfortable Using youtube-dl in Terminal? Use These GUI Apps]
* [https://mrs0m30n3.github.io/youtube-dl-gui/ youtube-dl-gui]
 
= Download video frame =
Right click and right click again. Choose "Copy video frame".
 
= Learning =
* [http://www.makeuseof.com/tag/youtube-starter-kit-youtubers-worth-watching/ The YouTube Starter Kit: 20 YouTubers Worth Watching]
* [http://www.makeuseof.com/tag/youtube-starter-kit-youtubers-worth-watching/ The YouTube Starter Kit: 20 YouTubers Worth Watching]
* [https://www.makeuseof.com/tag/youtube-channels-learn-new-skill/ 5 Nifty YouTube Channels for Learning a New Skill or Strength ]
* [https://www.makeuseof.com/tag/youtube-channels-learn-new-skill/ 5 Nifty YouTube Channels for Learning a New Skill or Strength ]


== Biology ==
== Tips 1: SMTube ==
https://www.smtube.org/, https://github.com/smplayer-dev/smtube


[[Ubuntu#SMTube:_search_and_watch_youtube|Search and watch Youtube]]
== Tips 2: Pennywise ==
[[Ubuntu#Open_Websites_In_A_Floating.2C_Borderless_Window.2FPicture_in_picture|Open Websites In A Floating, Borderless Window/Picture in picture]]
= Keyboard shortcuts =
'''Shift + /''' for a complete collection of keyboard shortcuts
[https://support.google.com/youtube/answer/7631406?hl=en Keyboard shortcuts for YouTube]
[https://www.rd.com/article/youtube-keyboard-shortcuts/ 24 of the Most Useful YouTube Keyboard Shortcuts]
* j: backward 10 seconds
* l: forward 10 seconds
* >: Speed up the video playback rate.
* <: Slow down the video playback rate.
* c: captions
* m: mute
= Search for Words in a YouTube Video =
[https://www.makeuseof.com/tag/search-within-youtube-video/ How to Search for Words in a YouTube Video]
= Biology =
* [http://k12videos.mit.edu/content/polymerase-chain-reaction-making-copies-of-dna PCR] from http://k12videos.mit.edu/academic-subject/biology/video
* [http://k12videos.mit.edu/content/polymerase-chain-reaction-making-copies-of-dna PCR] from http://k12videos.mit.edu/academic-subject/biology/video
* [http://k12videos.mit.edu/content/genetic-engineering genetic engineer]
* [http://k12videos.mit.edu/content/genetic-engineering genetic engineer]
* [https://www.youtube.com/watch?v=gMOoMcsGTO4&list=PL3EED4C1D684D3ADF Crash Course Biology] from CrashCourse.
* [https://bioinformaticamente.com/2022/05/08/20-youtube-channels-every-bioinformatician-should-follow/ 40 YouTube Channels Every Bioinformatician Should Follow]
* Google: campbell biology pdf


== Bypass any restricted youtube video without an extension ==
= Bypass any restricted youtube video without an extension =
http://www.makeuseof.com/tag/bypass-restricted-youtube-video-without-extension/
http://www.makeuseof.com/tag/bypass-restricted-youtube-video-without-extension/


== 7 of the Best YouTube Channels for Learning Drums ==
== Unblock ==
[https://www.howtogeek.com/796838/how-to-unblock-youtube/ How to Unblock YouTube]
 
= Youtube ad block =
* [https://sites.google.com/view/adblock-for-yt/index Adblock for Youtube™], [https://chrome.google.com/webstore/detail/adblock-for-youtube/cmedhionkhpnakcndndgjdbohmhepckk Chrome] & [https://addons.mozilla.org/de/firefox/addon/adblock-for-youtube-tm/ Firefox]. Open source!
* See [[Firefox#Youtube|Firefox]]. [https://addons.mozilla.org/en-US/firefox/addon/adblock-for-youtube/ AdBlocker for YouTube™] by AdblockLite
 
== FreeTube ==
* https://freetubeapp.io/. A private youtube client. Windows, Mac, Linux (x64, arm64, armv7l).
* https://github.com/linuxserver/docker-freetube
 
= 7 of the Best YouTube Channels for Learning Drums =
http://www.makeuseof.com/tag/best-youtube-channels-learn-drums/
http://www.makeuseof.com/tag/best-youtube-channels-learn-drums/


== How to find HDR content on YouTube ==
= Cooking =
[https://www.makeuseof.com/tag/unique-youtube-cooking-channels/ 5 Unique YouTube Cooking Channels Worth Watching]
 
= How to find HDR content on YouTube =
https://lifehacker.com/how-to-find-hdr-content-on-youtube-1829374364
https://lifehacker.com/how-to-find-hdr-content-on-youtube-1829374364


== Add YouTube Player Controls To Your Linux Desktop With browser-mpris2 (Chrome Extension) ==
= Add YouTube Player Controls To Your Linux Desktop With browser-mpris2 (Chrome Extension) =
https://www.linuxuprising.com/2018/08/add-youtube-player-controls-to-your.html
https://www.linuxuprising.com/2018/08/add-youtube-player-controls-to-your.html
= Browser extension/add-on =
[[Firefox#Youtube|Firefox]]
= Facebook app =
When we play youtube on browsers other than Chrome, the resolution is 720p at most. But when I play youtube videos in Facebook app, it provides up to 1080p resolution and it blocks ads automatically.
= Live Stream on youtube =
* [https://www.makeuseof.com/tag/how-to-live-stream-on-youtube/ How to Live Stream on YouTube]
* [https://www.itechfever.com/live-stream-computer-screen-youtube/ How To Live Stream Computer Screen on YouTube?]
* [https://www.raspberrypi.org/blog/watch-wildlife-with-a-raspberry-pi-nature-camera-hackspace-33/ Watch wildlife with a Raspberry Pi nature camera]
= Captions =
[https://youtu.be/2G-Emzf29BU?si=GvhQOJB0-KAzkNoy&t=296 视频实时字幕功能]. If we don't see the media control icon, go to  chrome://flags and search for "Global media control". Now we need to change it from "default" to "Enabled".
= 5 Relaxing YouTube Channels to Help You Chill Out =
* https://www.makeuseof.com/tag/relaxing-youtube-channels-chill-out/
* [https://youtu.be/8yFVBuGcOe8 RELAXING MUSIC TO CALM THE MIND AND REDUCE STRESS, RELAXATION AND MEDITATION MUSIC]
* [https://www.makeuseof.com/best-guided-meditation-youtube-channels/ The 6 Best Guided Meditation YouTube Channels to Calm Your Mind]
== Natural sounds ==
* [https://youtu.be/ubNfkpbxXUs Rainforest Rain Sounds for Sleeping or Studying 🌧️ White Noise Rainstorm 10 Hours]
* [https://youtu.be/5lCRsLjMeso Sounds of nature, birds singing, Sounds of Forests, for relaxation, sleep, Meditation, Relax 8 hours]
* [https://youtu.be/hlWiI4xVXKY Beautiful Relaxing Music • Peaceful Piano Music & Guitar Music | Sunny Mornings by @Peder B. Helland]
= Suggested videos overlay =
[https://onlinepixie.com/component/k2/item/8-how-to-remove-the-suggested-videos-overlay-from-a-paused-embedded-youtube-video.html How to remove the suggested videos overlay from a paused, embedded YouTube video]
= How to Watch Flagged YouTube Videos Without Logging In =
[https://www.makeuseof.com/tag/nsfwyoutube-watch-flagged-youtube-videos/ How to Watch Flagged YouTube Videos Without Logging In]
= How to Pause Your YouTube Watch History =
[https://www.makeuseof.com/how-to-pause-youtube-watch-history/ H How to Pause Your YouTube Watch History]. Library -> History -> stacked dots icon -> History Controls -> toggle switch to Pause watch history.
= How Much Money Can You Make on YouTube =
[https://twocents.lifehacker.com/how-much-money-can-you-make-on-youtube-1845756449 How Much Money Can You Make on YouTube?]
= How to Disable YouTube’s Auto-Playing Thumbnails & Video Previews =
Profile picture - Settings - General - Playback in feeds - Off.
= Stats for nerds =
Profile picture - Settings - General - Enable stats for nerds
= Youtube bot =
[https://lifehacker.com/how-to-stop-annoying-youtube-bots-from-spamming-everyon-1848924366 How to Stop Annoying YouTube Bots From Spamming Everyone]
= Picture in picture mode =
https://www.youtube.com/new
= Youtube Music =
[https://android.gadgethacks.com/how-to/make-any-youtube-link-open-youtube-music-app-0323773/ Make Any YouTube Link Open in the YouTube Music App]
= Audiobooks =
[https://www.makeuseof.com/best-youtube-channels-to-listen-to-audiobooks-free-legally/ The 10 Best YouTube Channels to Listen to Audiobooks for Free (Legally)]
= Soundcloud =
https://soundcloud.com/search?q=happy. Tracks -> To listen to -> To use commercially.
= Epidemic sound =
https://www.epidemicsound.com/
= Music =
* https://en.wikipedia.org/wiki/Lo-fi_music
* [https://lofimusic.app/ Lofimusic.app]
* [https://www.makeuseof.com/christmas-music-and-radio-apps/ The 6 Greatest Free Christmas Music and Radio Apps]
== Crop audio ==
[https://unix.stackexchange.com/a/302469 Trim audio file using start and stop times]
<pre>
ffmpeg -i file.mkv -ss 00:00:20 -to 00:00:40 -c copy file-2.mkv
</pre>
= Membership =
[https://pay.google.com/gp/w/u/0/home/subscriptionsandservices Subscriptions and services & How you pay] or [https://www.youtube.com/paid_memberships Manage membership]
= Script and Transcript =
* [https://www.freevideoworkshop.com/download-youtube-transcripts-as-text/ How to Download YouTube Transcripts as Text for Free with Top YouTube Transcript Generators]
** https://downsub.com/ (Directly download either srt or txt)
** https://youtubetranscript.com/ (similar to what we see on youtube but no timestamp)
= YouTube Playables - youtube mini games =
[https://www.makeuseof.com/youtube-playables-mini-games/ YouTube Is Now Testing Mini Games (and Here's How to Play Them)]

Latest revision as of 19:24, 20 October 2024

Download videos

VLC

See VLC tips.

  1. Play the video in VLC
  2. On VLC, check Tools -> Codec information and find a URL there
  3. Open the URL on a browser. Right click the video and choose to save the video.

The method works for youtube and vimeo videos.

Firefox/Chrome add-on

3 Easy Ways to Download YouTube Videos in Ubuntu and Other Linux Distributions

Video DownloadHelper add-on works fine when I test it on Firefox and Chrome. I need to install an app Video DownloadHelper companion app (the source code is on Github) in order to use the extension. It saves the videos to ~/dwhelper folder.

Online websites

Open source app

  • YouTube Downloader Plus https://ytdn.netlify.app/. Snap, flathub, AppImage, macOS, Windows,... ytDownloader lets you download Videos and Extract Audios of different formats from hundreds of sites including but not limited to Youtube, Facebook, Tiktok, Twitch, Twitter, Instagram and so on...

Host your own downloader

metube

Media Downloader

Media Downloader is a Qt/C++ front end to yt-dlp, youtube-dl, gallery-dl, lux, you-get, svtplay-dl, aria2c, wget and safari books

Parabolic

Tube Converter

Tube Converter: An Open Source Tool to Download YouTube Videos

Youtube-dl

stuttering

https://github.com/ytdl-org/youtube-dl/issues/29326#issuecomment-966416070

VERSION=8e069597c658810567ced5f8046dc5d14ab93037
wget https://github.com/ytdl-org/youtube-dl/archive/$VERSION.zip
unzip $VERSION.zip
cd youtube-dl-$VERSION
sudo pip install .

Minitube

mpsyt: mps-youtube (mp3 + stream + youtube)

By default, mps-youtube is basically a YouTube audio player (and downloader), but you can enable external video playback (via mpv or MPlayer) from its options. Check out

  • An article on webupd8.
  • More keyboard controls can be found on the webpage of mps.

Installation on Linux (works on Odroid with low CPU usage for audio stream from youtube but Odroid gives dirty noise when I played the music).

sudo apt-get install python3-pip
sudo pip3 install mps-youtube
sudo pip3 install youtube_dl

# On Ubuntu/Mint. Do not use mplayer. Use mpv instead.
# sudo add-apt-repository ppa:mc3man/mpv-tests
# sudo apt-get update && sudo apt-get install mpv

mpsyt   # launch
set player mpv
pl https://www.youtube.com/playlist?list=PL6h94tLpXv3LabUa7B0tCz7K0pI5ZzZEi   # a playlist
h       # help
Space   # pause
p       # play
q       # quit mpsyt

h search
url https://www.youtube.com/watch?v=hgIfZz8STLk   # retrieve specific youtube video by url or id

Installation on Windows

Some highlight

  • Search
  • Local playlist
  • support YouTube Playlists
  • Download
  • Music Album Matching

If something is wrong with using 'set' command, just run rm -rf ~/.config/mps-youtube/ and restart everything.

By default, it only streams audio. To watch the video, use set show_video true.

Below is what I got from the set command (as you can see the default player is mpv)

  Key                 Value                                                  
  order             : relevance
  user_order        : 
  max_res           : 2160p
  player            : mpv
  playerargs        : 
  encoder           : 0 [None]
  notifier          : 
  checkupdate       : True
  show_mplayer_keys : True
  fullscreen        : False
  show_status       : True
  columns           : 
  ddir              : /home/odroid/Downloads/mps
  overwrite         : True
  show_video        : False
  search_music      : True
  window_pos        : 
  window_size       : 
  download_command  : 
  audio_format      : auto
  api_key           : AIzaSyCIM4EzNqi1in22f4Z3Ru3iYvLaY8tc3bo

The screenshot shows mpsyt contains basic playing keyboard shortcuts.

Mps-youtube.png

[Update 4-7-2017]: to fix an error Signature extraction failed: Traceback (most recent call last):

sudo apt-get remove -y youtube-dl  # Removing youtube-dl (2014.02.17-1) ...
sudo pip3 install -U youtube-dl

$ youtube-dl --version
2017.04.11

yewtube: forked from mps-youtube

mp3 download

mpv

  • Play youtube audio only
    mpv link_to_youtube_vid --no-video
    
  • Open YouTube (And More) Videos From Your Web Browser With mpv [Firefox, Chrome]. Using this is especially useful if your web browser doesn't support hardware-accelerated video playback.
    sudo apt install mpv
    mpv --ytdl-format="bestvideo[height<=?1080]+bestaudio/best" <URL_of_Video>
    
    mpv --start=56:00 Some_YT_URL    # include time
    mpv https://youtu.be/JlHsTd7nJW0?t=16  # embed time in the URL
    
  • Record live youtube video. For some reason, mp4 or mkv format does not work.
    mpv --stream-record=video.ts https://youtu.be/UCG1aXVO8H8
    
  • Keyboard shortcuts:
    • Shift+o: toggle show progress
    • volume control: 9/0
    • m: mute
    • Upper/down arrow: seek 60 seconds
    • Left/right arrow: seed 5 seconds
    • [: decrease speed
    • ]: increase speed
    • s: take a screenshot
    • q: quit, save current position

yt-dlp: download youtube video

ytfzf: search & play or download

# Tested on new Ubuntu 22.04 Desktop x64
sudo apt install jq mpv fzf git python3-pip python3-wheel \
     python3-dev python3-xlib libx11-dev libxext-dev \
     libxres-dev make curl
git clone https://github.com/pystardust/ytfzf
cd ytfzf
sudo make install

# First test: failed
ytfzf  URL
# Got an error - 
# [ytdl_hook] ERROR: [youtube] 5NJ6V8i1Xd8: Unable to extract uploader id

yt-dlp --version
sudo apt-get remove yt-dlp
sudo apt-get install python3-pip
pip3 install --user yt-dlp
nano ~/.bashrc
# add export PATH=$PATH:/home/brb/.local/bin
source ~/.bashrc
which yt-dlp
yt-dlp --version

# Handling ueberzug
# See https://github.com/WhiteBlackGoose/ueberzug-latest
pip install setuptools
git clone https://github.com/WhiteBlackGoose/ueberzug-latest && cd ueberzug-latest
sudo pip install -e .

# ytfzf -t cti    
# Works perfect!
sudo apt install jq mpv fzf  # youtube-dl 
sudo apt install build-essential  # neeed 'make'

git clone https://github.com/pystardust/ytfzf
cd ytfzf/
sudo make install
sudo make install doc  # optional
which ytfzf
# /usr/local/bin/ytfzf

sudo apt install socat  # to use mpv as the thumbnail viewer
ytfzf -T mpv -t scRNA  # -t means thumbnails,  scRNA is an example of some keywords
             # Note two mpv windows will be opened.
             # resize the 'terminal'-like mpv window so the thumbnail window is 
             #    next to the 'terminal'-like mpv window
ytfzf -d scRNA  # -d means download
ytfzf URL       # same as 'mpv URL'

$ mpv --version
mpv 0.35.1 Copyright 2000-2023 mpv/MPlayer/mplayer2 projects 

$ ytfzf --version
ytfzf: 2.5.5

$ ytfzf --help
Usage: ytfzf [OPTIONS] <search-query>
  OPTIONS:
     -h, --help                           Show this help text
     -v, --version                        -v for ytfzf's version, --version for ytfzf + youtube-dl's version
     -t, --thumbnails                     Show thumbnails (requires ueberzug)
                                          Doesn't work with -H -D
     -D, --ext-menu                       Use external menu(default dmenu) instead of fzf 
     -H, --choose-from-history            Choose from history 
     -x, --clear-history                  Delete history
     -m, --audio-only   <search-query>    Audio only (for music)
     -d, --download     <search-query>    Download to current directory
     -f                 <search-query>    Show available formats before proceeding
     -a, --auto-play    <search-query>    Auto play the first result, no selector
     -r  --random-play  <search-query>    Auto play a random result, no selector
     -n, --video-count= <video-count>     To specify number of videos to select with -a or -r
     -l, --loop         <search-query>    Loop: prompt selector again after video ends
     -s                 <search-query>    After the video ends make another search 
     -L, --link-only    <search-query>    Prints the selected URL only, helpful for scripting

     --previews=       <left/right>      the side of the screen to show thumbnails
     --upload-time=     <time-range>      Time range can be one of, last-hour, today, this-week, this-month, this-year
                   You can also put the filter as it's own option eg: --today
     --upload-sort=     <sort-filter>     The filter to sort the videos can be one of, upload-date, view-count, rating
                   You can also put the filter as it's own option eg: --upload-date
     --filter-id=       <filter>          The id of the filter to use for video reults
                   A filter id can be found by going to youtube searching, filtering how you want
                   Then taking the value of the &sp= part of the url
                   Filters may not work especially when the filter sorts for non-videos
                   In addition this overrides any filter provided through options
                   Example: ytfzf --filter-id=EgJAAQ minecraft
                   This will filter by livestream

     --update                             clones the latest commit and installs it
                   on Arch ytfzf is available in the AUR
  Use - instead of <search-query> for stdin

  Option usage:
     ytfzf -fDH                           to show history using external 
                                          menu and show formats
     ytfzf -fD --choose-from-history      same as above

  Defaults can be modified through ENV variables
  Defaults:
     YTFZF_HIST=1                          0 : off history
     YTFZF_CACHE=~/.cache/ytfzf
     YTFZF_LOOP=0                          1 : loop the selection prompt
     YTFZF_PREF=''                         22: 720p,  18: 360p
     YTFZF_CUR=1                           For status bar bodules
     YTFZF_EXTMENU=' dmenu -i -l 30'
  To use rofi
     YTFZF_EXTMENU=' rofi -dmenu -fuzzy -width 1500'
     YTFZF_ENABLE_FZF_DEFAULT_OPTS=0       1 : fzf will use FZF_DEFAULT_OPTS

  For more details refer https://github.com/pystardust/ytfzf

Convert av1 format to h264 format

This is necessary if we add videos to Plex. Convert a video to MP4 (H.264/AAC) with ffmpeg.

Use Handbrake. Converting Video Files to H.264 MP4 Format Using HandBrake on Linux

$ apt-cache show handbrake-cli
$ sudo apt-get install handbrake-cli
$ HandBrakeCLI --help
$ HandBrakeCLI -e x264 -i input.mp4 -o output.mp4

GUI

Download video frame

Right click and right click again. Choose "Copy video frame".

Learning

Tips 1: SMTube

https://www.smtube.org/, https://github.com/smplayer-dev/smtube

Search and watch Youtube

Tips 2: Pennywise

Open Websites In A Floating, Borderless Window/Picture in picture

Keyboard shortcuts

Shift + / for a complete collection of keyboard shortcuts

Keyboard shortcuts for YouTube

24 of the Most Useful YouTube Keyboard Shortcuts

  • j: backward 10 seconds
  • l: forward 10 seconds
  • >: Speed up the video playback rate.
  • <: Slow down the video playback rate.
  • c: captions
  • m: mute

Search for Words in a YouTube Video

How to Search for Words in a YouTube Video

Biology

Bypass any restricted youtube video without an extension

http://www.makeuseof.com/tag/bypass-restricted-youtube-video-without-extension/

Unblock

How to Unblock YouTube

Youtube ad block

FreeTube

7 of the Best YouTube Channels for Learning Drums

http://www.makeuseof.com/tag/best-youtube-channels-learn-drums/

Cooking

5 Unique YouTube Cooking Channels Worth Watching

How to find HDR content on YouTube

https://lifehacker.com/how-to-find-hdr-content-on-youtube-1829374364

Add YouTube Player Controls To Your Linux Desktop With browser-mpris2 (Chrome Extension)

https://www.linuxuprising.com/2018/08/add-youtube-player-controls-to-your.html

Browser extension/add-on

Firefox

Facebook app

When we play youtube on browsers other than Chrome, the resolution is 720p at most. But when I play youtube videos in Facebook app, it provides up to 1080p resolution and it blocks ads automatically.

Live Stream on youtube

Captions

视频实时字幕功能. If we don't see the media control icon, go to chrome://flags and search for "Global media control". Now we need to change it from "default" to "Enabled".

5 Relaxing YouTube Channels to Help You Chill Out

Natural sounds

Suggested videos overlay

How to remove the suggested videos overlay from a paused, embedded YouTube video

How to Watch Flagged YouTube Videos Without Logging In

How to Watch Flagged YouTube Videos Without Logging In

How to Pause Your YouTube Watch History

H How to Pause Your YouTube Watch History. Library -> History -> stacked dots icon -> History Controls -> toggle switch to Pause watch history.

How Much Money Can You Make on YouTube

How Much Money Can You Make on YouTube?

How to Disable YouTube’s Auto-Playing Thumbnails & Video Previews

Profile picture - Settings - General - Playback in feeds - Off.

Stats for nerds

Profile picture - Settings - General - Enable stats for nerds

Youtube bot

How to Stop Annoying YouTube Bots From Spamming Everyone

Picture in picture mode

https://www.youtube.com/new

Youtube Music

Make Any YouTube Link Open in the YouTube Music App

Audiobooks

The 10 Best YouTube Channels to Listen to Audiobooks for Free (Legally)

Soundcloud

https://soundcloud.com/search?q=happy. Tracks -> To listen to -> To use commercially.

Epidemic sound

https://www.epidemicsound.com/

Music

Crop audio

Trim audio file using start and stop times

ffmpeg -i file.mkv -ss 00:00:20 -to 00:00:40 -c copy file-2.mkv

Membership

Subscriptions and services & How you pay or Manage membership

Script and Transcript

YouTube Playables - youtube mini games

YouTube Is Now Testing Mini Games (and Here's How to Play Them)