Git Product home page Git Product logo

yt-archive's Introduction

yt-archive

A lightweight Docker container for archiving personal YouTube channels using yt-dlp.

This repo is provided as-is, because it does what I want. It contains minimal code, so it should be trustable. (The serve_file and generate_rss_feed functions can be removed if not needed)

If you want it to do what you want, go ahead and fork it, adopt it, whatever. I don't care, but I also can't guarantee I'll be around to give support or accept pull requests.

Oh and don't run it on a public network, It runs a little unauthenticated web server that is not designed for the general public to be able to see.

Setting this up

The container reads YouTube channel list and keep those channels mirrored locally in folders of the same name.

It runs whenever it recieves a GET request to the path /go on its exposed port. This can be used for scheduling or testing. You can roll your own authentication for this if you want to.

You can add this GET request to any task scheduler / cron job, to ensure it happens regularly. yt-dlp does not re-download videos. Something like curl "http://hostname.local:8781/go" could be scheduled easily enough, and you can also run this in the browser if you want a manual approach.

Please note that to avoid throttling this won't download more than 10 videos, per channel, per execution. You could just run it every day until the archive is filled, as videos that are already downloaded don't count towards the quota.

The archive also provides an RSS feed of the folders it controls.

You need

  • Docker
  • A folder mapped to /data/
  • A /data/channels.txt job definition file, formatted as per channels.txt.sample

Building the Docker image

Build the Docker image with the following command:

docker build -t yt-archive .

Running the Docker container

Run the Docker container with the following command:

docker run -d -v c:/youtube/:/data/ -p 8781:8781 --name yt-archive yt-archive

Volumes

  • /data/: The path where the downloaded videos are stored and where the /data/channels.txt file is located.

Saving the Docker image for import

If you're running this on a NAS device, you'll want to save the Docker image with the following command:

docker save yt-archive -o yt-archive.tar

You can then copy the tar file to your target, and either run docker import on the .tar file, or upload it to your docker GUI as an image.

License

This project is licensed under the MIT License - see the LICENSE file for details.

yt-archive's People

Contributors

alirobe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.