# README for Metube on Internal network Metube is a web frontent for yt-dlp that makes it convenient to download youtube videos and place them in the Downloads directory for Jellyfin. ## Upstream This project's upstream is at . It depends entirely on the third-party upstream [metube](https://github.com/alexta69/metube) project. ## Installing The architecture is fairly simple. Vm4 runs the app in docker-compose, and server3 reverse-proxies it for local web requests only. File storage is in the customary nfs export. The web components are served only on the local http/s ports of the web server; they are not supposed to be available to the public. ### Configuring docker server Set up a new user on vm4 which already has docker from previous projects. sudo useradd metube sudo usermod -a -G docker metube sudo su - metube < Include conf.d/metube.cnf # DO NOT INCLUDE metube on public http vhost Include conf.d/metube-disabled.cnf Include conf.d/metube.cnf # DO NOT INCLUDE metube on public https vhost Include conf.d/metube-disabled.cnf Reload httpd after a successful test. sudo httpd -t && sudo systemctl reload httpd Httpd needs the selinux permission for accessing network ports, which has been enabled already for other projects on this network. ### Assumptions for Jellyfin The mode on `/mnt/public/Video/Downloads` is 0777. Jellyfin uses real-time monitoring on the library that reads this directory, and that library is content type "Other." Jellyfin appears to read the video id at the end of the filename and fetches the .nfo contents! ## Alternatives I bookmarked a few alternative projects, primarily in 2022-07 (on system vm2 Firefox bookmarks). * **Tested** this one, but it was slightly out of date and had probably minor internal app problems that broke it, and I don't want to fiddle with nodejs code. * I just don't really care about material design. * Did not appear to be a Web UI frontend. * Looked incredibly spartan, even though it is in python which I can hope to understand. * Not well-documented or otherwise just did not appear interesting. * Not as slick-looking, but uses python+flask which appeals to me. This **should be my first line** of research if my current solution fails. * Is a web frontend that resembles youtube itself, but possibly does not provide the yt-dlp functions at all, so belongs in a different category. I tested this, and uploading to it made duplicate files and was just below adequate for that category of usage. I actually tested only a few alternatives, which are indicated in the above list. ## Reason for existence To provide a simple way to add Internet videos into the local Jellyfin instance so users do not have to go out to the Internet with the possibility of autoplay that goes beyond user acceptability. ## Using and Operations Tasks that will probably repeat. Update metube image, mostly for the latest yt-dlp version: docker pull alexta69/metube:latest cd ~/metube/git ; docker-compose down ; docker-compose up -d ### Visiting Visit the main page via one of these following links. The main page is where you can add new videos by url and view current and completed downloads: http://vm4:8081/metube/ https://server3.ipa.internal.com/metube/ http://server3/metube/ Notably, the reverse proxy configuration does not allow external access to `/metube/` path. This is to protect the server from outside access which could be abused more easily. Also, the direct server url is not published. ### Using Primarily, you visit the [status page](http://server3/metube/) and paste in a video url. On a mobile device, you can use the sharing menu to copy a link, and then paste it on this page. #### Bookmarklets Upstream provides sample bookmarklets you can save as a browser bookmark. When visiting a video page, you can select this bookmarklet and it will send it to the app. Save to Jellyfin ## Dependencies Docker, httpd, jellyfin, existing selinux rule on server3 for `httpd_can_connect_network` or similar. ## Improve WORKHERE Combine all files into this support dir, and make scm repo and publish. ## Related files On vm4 * `/home/metube/git/docker-compose.yaml` * `/etc/systemd/system/metube.service` * `/usr/lib/firewalld/services/metube.xml` On server3 * `/etc/httpd/conf.d/metube.cnf` * `/etc/httpd/conf.d/metube-disabled.cnf` * `/etc/httpd/conf.d/local_mirror.conf`, just relevant lines * `/var/server3/shares/public/www/metube-help/index.html` ## References