All Projects → alexta69 → metube

alexta69 / metube

Licence: AGPL-3.0 license
youtube-dl web UI

Programming Languages

typescript
32286 projects
python
139335 projects - #7 most used programming language
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
Sass
350 projects
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to metube

youtube-dl-docker
Download with youtube-dl using command line arguments or a configuration file + Automated updates
Stars: ✭ 44 (-95.66%)
Mutual labels:  youtube-dl
megadlbot oss
Megatron was a telegram file management bot that helped a lot of users, specially movie channel managers to upload their files to telegram by just providing a link to it. The project initially started as roanuedhuru_bot which lately retired and came back as Megatron which was a side project of the famous Maldivian Telegram community - @baivaru u…
Stars: ✭ 151 (-85.11%)
Mutual labels:  youtube-dl
deplayer
Decentralized mediaplayer which runs entirely in the browser.
Stars: ✭ 14 (-98.62%)
Mutual labels:  youtube-dl
YT-DLP-SCRIPTS
...Just a place for me to share my various YT-DLP & related bash scripts.
Stars: ✭ 70 (-93.1%)
Mutual labels:  youtube-dl
mmdl
MMDL (Mega Music Downloader) - A tool to easily download music.
Stars: ✭ 29 (-97.14%)
Mutual labels:  youtube-dl
YouP3
Android app for downloading media from YouTube with 4K Support (Beta)
Stars: ✭ 51 (-94.97%)
Mutual labels:  youtube-dl
cirilla
Multipurpose telegram bot
Stars: ✭ 33 (-96.75%)
Mutual labels:  youtube-dl
odio
A Simple Utility to Download Music (.m4a) From Youtube Links Using Only Clipboard/PasteBoard
Stars: ✭ 32 (-96.84%)
Mutual labels:  youtube-dl
hollow memories
Save your precious memories.
Stars: ✭ 49 (-95.17%)
Mutual labels:  youtube-dl
MiXLab
MiXLab is a mix of multiple amazing Colab Notebooks found on the internet such as rcloneLab, RLabClone, Torrent to Google Drive Downloader and some more.
Stars: ✭ 143 (-85.9%)
Mutual labels:  youtube-dl
youtube-dl-batch
Simple batch files for simplifying basic usage of https://github.com/rg3/youtube-dl Windows .exe releases
Stars: ✭ 55 (-94.58%)
Mutual labels:  youtube-dl
twitch-clip-downloader
[DONE] NodeJS tool to download every clip (and it's metadata) from a Twitch channel
Stars: ✭ 27 (-97.34%)
Mutual labels:  youtube-dl
PowerShell-Youtube-dl
A PowerShell script interface used to operate the youtube-dl command line program.
Stars: ✭ 64 (-93.69%)
Mutual labels:  youtube-dl
sync-dl
Flexible tool for saving and syncing playlists from YouTube without loosing removed songs
Stars: ✭ 13 (-98.72%)
Mutual labels:  youtube-dl
yt2audiobot
Telegram bot for converting YouTube videos to mp3
Stars: ✭ 26 (-97.44%)
Mutual labels:  youtube-dl
youtify
Installs and configures youtube-dl and spotdl for music and videos downloading in android termux
Stars: ✭ 21 (-97.93%)
Mutual labels:  youtube-dl
Vividl
Modern Windows GUI for youtube-dl/ yt-dlp
Stars: ✭ 189 (-81.36%)
Mutual labels:  youtube-dl
SourceRadio
Stream music from YouTube while playing games on Steam
Stars: ✭ 10 (-99.01%)
Mutual labels:  youtube-dl
Grabber
A wrapper for Youtube-dl for Windows.
Stars: ✭ 22 (-97.83%)
Mutual labels:  youtube-dl
android-youtube-dl
The android library that wraps Python 2.7 and youtube-dl python scripts
Stars: ✭ 35 (-96.55%)
Mutual labels:  youtube-dl

MeTube

Build Status Docker Pulls

Web GUI for youtube-dl (using the yt-dlp fork) with playlist support. Allows you to download videos from YouTube and dozens of other sites (https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md).

screenshot1

Run using Docker

docker run -d -p 8081:8081 -v /path/to/downloads:/downloads alexta69/metube

Run using docker-compose

version: "3"
services:
  metube:
    image: alexta69/metube
    container_name: metube
    restart: unless-stopped
    ports:
      - "8081:8081"
    volumes:
      - /path/to/downloads:/downloads

Configuration via environment variables

Certain values can be set via environment variables, using the -e parameter on the docker command line, or the environment: section in docker-compose.

  • UID: user under which MeTube will run. Defaults to 1000.
  • GID: group under which MeTube will run. Defaults to 1000.
  • UMASK: umask value used by MeTube. Defaults to 022.
  • DOWNLOAD_DIR: path to where the downloads will be saved. Defaults to /downloads in the docker image, and . otherwise.
  • AUDIO_DOWNLOAD_DIR: path to where audio-only downloads will be saved, if you wish to separate them from the video downloads. Defaults to the value of DOWNLOAD_DIR.
  • STATE_DIR: path to where the queue persistence files will be saved. Defaults to /downloads/.metube in the docker image, and . otherwise.
  • URL_PREFIX: base path for the web server (for use when hosting behind a reverse proxy). Defaults to /.
  • OUTPUT_TEMPLATE: the template for the filenames of the downloaded videos, formatted according to this spec. Defaults to %(title)s.%(ext)s.
  • OUTPUT_TEMPLATE_CHAPTER: the template for the filenames of the downloaded videos, when split into chapters via postprocessors. Defaults to %(title)s - %(section_number)s %(section_title)s.%(ext)s.
  • YTDL_OPTIONS: Additional options to pass to youtube-dl, in JSON format. See available options here. They roughly correspond to command-line options, though some do not have exact equivalents here, for example --recode-video has to be specified via postprocessors. Also note that dashes are replaced with underscores.

The following example value for YTDL_OPTIONS embeds English subtitles and chapter markers (for videos that have them), and also changes the permissions on the downloaded video:

{"writesubtitles": true, "subtitleslangs": ["en", "-live_chat"], "postprocessors": [{"key": "Exec", "exec_cmd": "chmod 0664", "when": "after_move"}, {"key": "FFmpegEmbedSubtitle", "already_have_subtitle": false}, {"key": "FFmpegMetadata", "add_chapters": true}]}

Using browser cookies

In case you need to use your browser's cookies with MeTube, for example to download restricted or private videos:

  • Add the following to your docker-compose.yml:
    volumes:
      - /path/to/cookies:/cookies
    environment:
      - YTDL_OPTIONS={"cookiefile":"/cookies/cookies.txt"}
  • Install in your browser an extension to extract cookies:
  • Extract the cookies you need with the extension and rename the file cookies.txt
  • Drop the file in the folder you configured in the docker-compose.yml above
  • Restart the container

Browser extensions

Browser extensions allow right-clicking videos and sending them directly to MeTube. Please note that if you're on an HTTPS page, your MeTube instance must be behind an HTTPS reverse proxy (see below) for the extensions to work.

Chrome: contributed by Rpsl. You can install it from Google Chrome Webstore or use developer mode and install from sources.

Firefox: contributed by nanocortex. You can install it from Firefox Addons or get sources from here.

Bookmarklet

kushfest has created a Chrome bookmarklet for sending the currently open webpage to MeTube. Please note that if you're on an HTTPS page, your MeTube instance must be behind an HTTPS reverse proxy (see below) for the bookmarklet to work.

GitHub doesn't allow embedding JavaScript as a link, so the bookmarklet has to be created manually by copying the following code to a new bookmark you create on your bookmarks bar. Change the hostname in the URL below to point to your MeTube instance.

javascript:!function(){xhr=new XMLHttpRequest();xhr.open("POST","https://metube.domain.com/add");xhr.send(JSON.stringify({"url":document.location.href,"quality":"best"}));xhr.onload=function(){if(xhr.status==200){alert("Sent to metube!")}else{alert("Send to metube failed. Check the javascript console for clues.")}}}();

shoonya75 has contributed a Firefox version:

javascript:(function(){xhr=new XMLHttpRequest();xhr.open("POST","https://metube.domain.com/add");xhr.send(JSON.stringify({"url":document.location.href,"quality":"best"}));xhr.onload=function(){if(xhr.status==200){alert("Sent to metube!")}else{alert("Send to metube failed. Check the javascript console for clues.")}}})();

The above bookmarklets use alert() as a success/failure notification. The following will show a toast message instead:

Chrome:

javascript:!function(){function notify(msg) {var sc = document.scrollingElement.scrollTop; var text = document.createElement('span');text.innerHTML=msg;var ts = text.style;ts.all = 'revert';ts.color = '#000';ts.fontFamily = 'Verdana, sans-serif';ts.fontSize = '15px';ts.backgroundColor = 'white';ts.padding = '15px';ts.border = '1px solid gainsboro';ts.boxShadow = '3px 3px 10px';ts.zIndex = '100';document.body.appendChild(text);ts.position = 'absolute'; ts.top = 50 + sc + 'px'; ts.left = (window.innerWidth / 2)-(text.offsetWidth / 2) + 'px'; setTimeout(function () { text.style.visibility = "hidden"; }, 1500);}xhr=new XMLHttpRequest();xhr.open("POST","https://metube.domain.com/add");xhr.send(JSON.stringify({"url":document.location.href,"quality":"best"}));xhr.onload=function() { if(xhr.status==200){notify("Sent to metube!")}else {notify("Send to metube failed. Check the javascript console for clues.")}}}();

Firefox:

javascript:(function(){function notify(msg) {var sc = document.scrollingElement.scrollTop; var text = document.createElement('span');text.innerHTML=msg;var ts = text.style;ts.all = 'revert';ts.color = '#000';ts.fontFamily = 'Verdana, sans-serif';ts.fontSize = '15px';ts.backgroundColor = 'white';ts.padding = '15px';ts.border = '1px solid gainsboro';ts.boxShadow = '3px 3px 10px';ts.zIndex = '100';document.body.appendChild(text);ts.position = 'absolute'; ts.top = 50 + sc + 'px'; ts.left = (window.innerWidth / 2)-(text.offsetWidth / 2) + 'px'; setTimeout(function () { text.style.visibility = "hidden"; }, 1500);}xhr=new XMLHttpRequest();xhr.open("POST","https://metube.domain.com/add");xhr.send(JSON.stringify({"url":document.location.href,"quality":"best"}));xhr.onload=function() { if(xhr.status==200){notify("Sent to metube!")}else {notify("Send to metube failed. Check the javascript console for clues.")}}})();

Running behind a reverse proxy

It's advisable to run MeTube behind a reverse proxy, if authentication and/or HTTPS support are required.

When running behind a reverse proxy which remaps the URL (i.e. serves MeTube under a subdirectory and not under root), don't forget to set the URL_PREFIX environment variable to the correct value.

If you're using the linuxserver/swag image for your reverse proxying needs (which I can heartily recommend), it already includes ready snippets for proxying MeTube both in subfolder and subdomain modes under the nginx/proxy-confs directory in the configuration volume. It also includes Authelia which can be used for authentication.

NGINX

location /metube/ {
        proxy_pass http://metube:8081;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
}

Note: the extra proxy_set_header directives are there to make WebSocket work.

Apache

Contributed by PIE-yt. Source here.

# For putting in your Apache sites site.conf
# Serves MeTube under a /metube/ subdir (http://yourdomain.com/metube/)
<Location /metube/>
    ProxyPass http://localhost:8081/ retry=0 timeout=30
    ProxyPassReverse http://localhost:8081/
</Location>

<Location /metube/socket.io>
    RewriteEngine On
    RewriteCond %{QUERY_STRING} transport=websocket    [NC]
    RewriteRule /(.*) ws://localhost:8081/socket.io/$1 [P,L]
    ProxyPass http://localhost:8081/socket.io retry=0 timeout=30
    ProxyPassReverse http://localhost:8081/socket.io
</Location>

Caddy

The following example Caddyfile gets a reverse proxy going behind caddy.

example.com {
  route /metube/* {
    uri strip_prefix metube
    reverse_proxy metube:8081
  }
}

Updating yt-dlp

The engine which powers the actual video downloads in MeTube is yt-dlp. Since video sites regularly change their layouts, frequent updates of yt-dlp are required to keep up.

There's an automatic nightly build of MeTube which looks for a new version of yt-dlp, and if one exists, the build pulls it and publishes an updated docker image. Therefore, in order to keep up with the changes, it's recommended that you update your MeTube container regularly with the latest image.

I recommend installing and setting up watchtower for this purpose.

Build and run locally

Make sure you have node.js and Python 3.8 installed.

cd metube/ui
# install Angular and build the UI
npm install
node_modules/.bin/ng build
# install python dependencies
cd ..
pip3 install pipenv
pipenv install
# run
pipenv run python3 app/main.py

A Docker image can be built locally (it will build the UI too):

docker build -t metube .

Development notes

  • The above works on Windows and macOS as well as Linux.
  • If you're running the server in VSCode, your downloads will go to your user's Downloads folder (this is configured via the environment in .vscode/launch.json).
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].