diff --git a/README.md b/README.md index c8b1374..3f157c0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ -# Media Roller +# KV-Download (Media Roller) + A mobile friendly tool for downloading videos from social media. -The backend is a Golang server that will take a URL (YouTube, Reddit, Twitter, etc), +The backend is a Golang server that will take a URL (YouTube, Reddit, Twitter, TikTok, Instagram, etc), download the video file, and return a URL to directly download the video. The video will be transcoded to produce a single mp4 file. This is built on [yt-dlp](https://github.com/yt-dlp/yt-dlp). yt-dlp will auto update every 12 hours to make sure it's running the latest nightly build. @@ -11,33 +12,76 @@ Note: This was written to run on a home network and should not be exposed to pub ![Screenshot 2](https://i.imgur.com/TWAtM7k.png) - # Running + Make sure you have [yt-dlp](https://github.com/yt-dlp/yt-dlp) and [FFmpeg](https://github.com/FFmpeg/FFmpeg) installed then pull the repo and run: ```bash ./run.sh ``` Or for docker locally: ```bash - ./docker-build.sh - ./docker-run.sh +./docker-build.sh +./docker-run.sh ``` -With Docker, published to both dockerhub and github. -* ghcr: `docker pull ghcr.io/rroller/media-roller:master` -* dockerhub: `docker pull ronnieroller/media-roller` +## Docker Image -See: -* https://github.com/rroller/media-roller/pkgs/container/media-roller -* https://hub.docker.com/repository/docker/ronnieroller/media-roller +The Docker image is available from the Forgejo container registry: -The files are saved to the /download directory which you can mount as needed. +```bash +docker pull git.khoavo.myds.me/vndangkhoa/kv-download:latest +``` -## Docker Environemnt Variables +### Deploy on Synology NAS + +1. Load the image (if using local transfer): +```bash +docker load -i kv-download.tar +``` + +2. Run with docker-compose: +```yaml +services: + kv-download: + image: git.khoavo.myds.me/vndangkhoa/kv-download:latest + container_name: kv-download + restart: unless-stopped + ports: + - "9292:9292" + volumes: + - /volume2/docker/kv-download/download:/download + environment: + - MR_DOWNLOAD_DIR=/download + - TZ=Asia/Ho_Chi_Minh +``` + +```bash +docker compose up -d +``` + +### Build Your Own Image + +```bash +docker build -t kv-download:latest --platform linux/amd64 . +``` + +## Docker Environment Variables * `MR_DOWNLOAD_DIR` where videos are saved. Defaults to `/download` -* `MR_PROXY` will pass the value to yt-dlp witht he `--proxy` argument. Defaults to empty +* `MR_PROXY` will pass the value to yt-dlp with the `--proxy` argument. Defaults to empty + +## File Structure + +After downloading videos, files are organized as follows: +``` +/download/ +├── / +│ └── .mp4 # Video files +└── json/ + └── .info.json # Metadata files (separate folder) +``` # API + To download a video directly, use the API endpoint: ``` @@ -47,13 +91,15 @@ To download a video directly, use the API endpoint: Create a bookmarklet, allowing one click downloads (From a PC): ``` -javascript:(location.href="http://127.0.0.1:3000/fetch?url="+encodeURIComponent(location.href)); +javascript:(location.href="http://127.0.0.1:9292/fetch?url="+encodeURIComponent(location.href)); ``` # Integrating with mobile + After you have your server up, install this shortcut. Update the endpoint to your server address by editing the shortcut before running it. https://www.icloud.com/shortcuts/d3b05b78eb434496ab28dd91e1c79615 # Unraid + media-roller is available in Unraid and can be found on the "Apps" tab by searching its name.