summaryrefslogtreecommitdiff
path: root/metube-README.md
diff options
context:
space:
mode:
Diffstat (limited to 'metube-README.md')
-rw-r--r--metube-README.md140
1 files changed, 140 insertions, 0 deletions
diff --git a/metube-README.md b/metube-README.md
new file mode 100644
index 0000000..59a6bbe
--- /dev/null
+++ b/metube-README.md
@@ -0,0 +1,140 @@
+<!--
+.. File: metube-README.md
+.. Location: /mnt/public/Support/Programs/metube/
+.. Author: bgstack15
+.. Startdate: 2023-01-23-2 15:54
+.. Title: Readme for Metube on Internal network
+.. Project: metube
+.. Purpose: Document how this was setup and how to use it
+.. History:
+.. Usage: See heading "Usage and Operations"
+.. Reference: See heading References
+.. Improve: See heading Improve
+.. Dependencies: See heading Dependencies
+.. Documentation: This.
+-->
+
+# 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 <http://server3/cgit/metube-internal/>. 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 <<EOF
+git clone https://github.com/alexta69/metube ~/git
+EOF
+
+Establish `/home/metube/git/docker-compose.yaml`
+Establish `/usr/lib/firewalld/services/metube.xml`
+
+ sudo firewall-cmd --reload
+ sudo firewall-cmd --permanent --add-service=metube
+ sudo firewall-cmd --reload
+
+Establish `/etc/systemd/system/metube.service`
+
+ sudo systemctl daemon-reload
+ sudo systemctl enable --now metube.service
+
+### Configuring httpd server
+Establish the following files which do not get included directly by apache httpd.
+
+* `/etc/httpd/conf.d/metube.cnf`
+
+Modify `local_mirror.conf` virtual hosts 80 and 443 to include this new file.
+
+Establish relevant snippets in `/etc/httpd/conf.d/local_mirror.conf`:
+
+ <VirtualHost *:80>
+ Include conf.d/metube.cnf
+ </VirtualHost>
+ <VirtualHost *:180>
+ # DO NOT INCLUDE metube on public http vhost
+ Include conf.d/metube-disabled.cnf
+ </VirtualHost>
+ <VirtualHost *:443>
+ Include conf.d/metube.cnf
+ </VirtualHost>
+ <VirtualHost *:444>
+ # DO NOT INCLUDE metube on public https vhost
+ Include conf.d/metube-disabled.cnf
+ </VirtualHost>
+
+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).
+
+* <https://github.com/Enriquito/youtube-dl-front/> **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.
+* <https://github.com/Tzahi12345/YoutubeDL-Material> I just don't really care about material design.
+* <https://github.com/mikenye/docker-youtube-dl> Did not appear to be a Web UI frontend.
+* <https://github.com/manbearwiz/youtube-dl-server> Looked incredibly spartan, even though it is in python which I can hope to understand.
+* <https://github.com/dockermgr/youtubedl-web> Not well-documented or otherwise just did not appear interesting.
+* <https://github.com/d0u9/youtube-dl-webui> 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.
+* <https://git.mills.io/prologic/tube> 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.
+
+### 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.
+
+ <a href='javascript:(function(){xhr=new XMLHttpRequest();xhr.open("POST","https://server3.ipa.internal.com/metube/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.")}}})();'>Save to Jellyfin</a>
+
+## 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
bgstack15