GithubHelp home page GithubHelp logo

aziascreations / youtube-auto-archiver Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 2.0 207 KB

A simple python application that automatically checks if a Youtuber is streaming, and downloads said streams.

License: The Unlicense

Python 96.88% Dockerfile 3.12%
youtube stream streamlink archiving youtube-live youtube-livestream

youtube-auto-archiver's Introduction

Youtube Auto Archiver v0.7.1

A simple and yet highly configurable Python application that automatically checks if a Youtuber is streaming, and downloads said streams while also archiving its latest uploads.

The application will be improved as I have time to do so, or if you raise an issue when I have time to look into it.

Warning

Due to the way some commands are executed, it is possible to have a command injection vulnerability if you mess up or leave the config file editable by everyone.
This might be fixed in the future, but don't count on it as this project is a personal one.

The Python module named "lxml" may fail to compile, but streamlink will work regardless since it is installed via the "py3-lxml" package.

The application isn't designed to be used by another one as a module.

Features

  • General
    • Can run on Windows and Linux (Tested on x64 and ARMv8)
    • Relatively high level of configurability.
  • YouTube
    • Automatic livestream download through https://youtube.com/c/.../live
    • Automatic livestream thumbnail and description download.
    • Automatic download of uploads and their metadata.
    • Configurable delays, actions, locations per channel.
  • Planned for v1.0.0
    • Native support for cookies for yt-dlp and maybe streamlink.
    • Better support to prevent command injection. (Will block some features if used)
  • Planned for later
    • Using TOML for the config file when Python 3.11 is released and stable.

Requirements

The application may work just fine with older or newer versions of these pieces of software, but they will not be supported.
All requirements, except for Python, can be installed via pip or manually.

Installation

Standalone

  1. Clone the repository and enter it
git clone https://github.com/aziascreations/Youtube-Auto-Archiver.git
cd Youtube-Auto-Archiver
  1. If desired, setup a Python virtual environment
pip install --upgrade virtualenv
python -m venv ./venv
  • Linux:
source venv/bin/activate
  • Windows:
venv\Scripts\activate
  1. Install the required Python modules
pip install -r requirements.txt

Please note that streamlink may need to be compiled when installed via pip.
You can ignore it as long as the executable is accessible in the PATH environment variable.

  1. Configure the application's config file
  2. Run the application

Docker

  1. Clone the repository and enter it
git clone https://github.com/aziascreations/Youtube-Auto-Archiver.git
cd Youtube-Auto-Archiver
  1. Configure the docker-compose.yml file.

If you are running Docker on Windows, or on a NTFS mount under Linux, you may need to run the application as root since the output volume binding's permissions can't be properly configured.

  1. Build the container via docker-compose
docker-compose up --build

Config

The config is stored in config.json and has to be in the same folder as app.py, unless the appropriate environment variables tells the application to look elsewhere for it.

Please refer to config.md for more information on the config file and its fields.

Regarding the configuration of this container, all you have to do is change the /data volume if you need it in a specific location.

Build Arguments (Docker)

Variable Type Remark Default
BUID Integer User ID under which the app runs and who owns the app's directory.
May not work on Windows and NTFS volumes !
1000
BGID Integer Group ID under which the app runs and who owns the app's directory.
May not work on Windows and NTFS volumes !
1000

Environment Variables

Any environment variable that is not set will have the effect of its default value.

Please note that the docker-compose.yml files already has its environment variables set, as well as an independent config file setup.

Variable Type Remark Default
YAA_ALLOW_ROOT Boolean (0|1) Can be used to prevent the application from running as root on Linux-based systems. (UID==0) 1
YAA_CONFIG_PATH String Indicates where the config file can be found.
The path can be relative to app.py's location, or absolute.
"./config.json"

Credits

Livestream achival guide by abayochocoball
    Helped greatly with downloading the thumbnail and description of a stream.

● The yt-dlp contributors
    For actually giving a fuck about maintaining and improving youtube-dl.

License

Unlicense

This license does not apply to the required Python modules or any other required piece of software.

youtube-auto-archiver's People

Contributors

aziascreations avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

steffenauer

youtube-auto-archiver's Issues

ValueError when running

Hi, hit this error today when trying out using Python3.11

Traceback (most recent call last):
  File "Y:\v&uarchiver\Youtube-Auto-Archiver-main\app.py", line 10, in <module>
    import yaa.config as yaa_config
  File "Y:\v&uarchiver\Youtube-Auto-Archiver-main\yaa\config.py", line 170, in <module>
    @dataclass
     ^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 1220, in dataclass
    return wrap(cls)
           ^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 1210, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 958, in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 815, in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable default <class 'yaa.config.ConfigApplication'> for field application is not allowed: use default_factory

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.