Go to file
Tiberiu Chibici d8f4151242 Added /media location to nginx, so it fetches the downloaded thumbnails. 2018-11-02 02:50:49 +02:00
.idea Added /media location to nginx, so it fetches the downloaded thumbnails. 2018-11-02 02:50:49 +02:00
app Fixed problem caused by parallel downloads where ok.mkdirs would fail (when called by youtube-dl). 2018-11-02 02:50:16 +02:00
config Added /media location to nginx, so it fetches the downloaded thumbnails. 2018-11-02 02:50:49 +02:00
docker Added /media location to nginx, so it fetches the downloaded thumbnails. 2018-11-02 02:50:49 +02:00
.directory Fixed docker image. Fixed issue with environment variable interpolation (on Linux, it is case sensitive, so converting to lowercase was bad. Cleaned up directory structure. 2018-11-02 02:25:15 +02:00
.gitignore Fixed docker image. Fixed issue with environment variable interpolation (on Linux, it is case sensitive, so converting to lowercase was bad. Cleaned up directory structure. 2018-11-02 02:25:15 +02:00
Docker_README.md Environment Variables and Docker standalone support (#21) 2018-10-31 17:57:32 +02:00
Dockerfile Added /media location to nginx, so it fetches the downloaded thumbnails. 2018-11-02 02:50:49 +02:00
LICENSE Added license 2018-10-30 11:58:43 +02:00
README.md Improved settings.py to read the global settings from the .ini file. 2018-11-01 01:01:21 +02:00
docker-compose.yml Added /media location to nginx, so it fetches the downloaded thumbnails. 2018-11-02 02:50:49 +02:00
requirements.txt Fixed docker image. Fixed issue with environment variable interpolation (on Linux, it is case sensitive, so converting to lowercase was bad. Cleaned up directory structure. 2018-11-02 02:25:15 +02:00

README.md

YouTube Subscription Manager

A self-hosted tool which manages your YouTube subscriptions, and downloads files automatically.

Current state

Currently, the program will do what it's main job is to do: download videos, and keep track of the subscriptions.

Of course, there are a lot of things that still need to be done. The web interface is still pretty limited, and there might still be uncaught bugs. These are some of the things that need to be done:

  • get status bar to actually display something (right now it's just a hardcoded message)
  • add an indication of what the synchronization jobs are doing to the UI
  • video page, which contains an embedded player
  • OAuth YouTube authentication, so private playlists can be obtained
  • Web UI improvements:
    • Paging for videos
    • Handle drag & drop for the subscription folders
    • Update UI when something changes
  • Improve stability
  • Bonus: Plex integration
  • Bonus: Support for additional services (Twitch, Vimeo)

Dependencies

  • python3: $ apt install python3
  • pip: $ apt install python3-pip
  • django: $ pip3 install django
  • crispy_forms: $ pip3 install django-crispy-forms
  • dj-config-url: $ pip3 install dj-config-url
  • youtube-dl: $ pip3 install youtube-dl
  • google-api-python-client: $ pip3 install google-api-python-client
  • google_auth_oauthlib: $ pip3 install google_auth_oauthlib
  • apscheduler (v3.5+): $ pip3 install apscheduler
  • (recommended) oauth2client: $ pip3 install oauth2client

Installation

Normal installation for development/testing

  1. Install all the dependencies listed above.

    sudo apt install python3 python3-pip
    sudo pip3 install apscheduler django django-crispy-forms dj-config-url youtube-dl google-api-python-client google_auth_oauthlib oauth2client
    
  2. Clone this repository:

    git clone https://github.com/chibicitiberiu/ytsm.git
    cd ytsm/app
    
  3. Set up the database: python3 manage.py migrate

    By default, a SQLite database is used, which is located in the project's folder. You can customize that in YtManager/settings.py, by modifying the DATABASES variable (search Django documentation for details).

  4. Obtain an YouTube API developer key from https://console.developers.google.com/apis/dashboard. You can find a detailed guide on this page.

    The defaults.ini file already has an API key, but if the quotas are reached, you won't be able to use this program any more. Also, I might decide to delete that key, which will break your installation.

  5. Modify config/config.ini to your liking. All the settings should be documented through comments. All these settings apply server-wide. The settings in the user section can be overriden from the web page for each individual user.

    The most important settings are:

    • [Global] YoutubeApiKey - put your YouTube API key here
    • [User] DownloadPath - sets the folder where videos will be downloaded
  6. Start the server: python3 manage.py runserver [port] --noreload

    The port parameter is optional.

    The --noreload option is necessary, otherwise the scheduler will run on 2 separate processes at the same time, which is not ideal.

  7. Open the server's page in your browser, by entering http://localhost:port in your address bar.

  8. Create an admin user by going to the register page, and creating an user account.

  9. Add some subscriptions, and enjoy!

Docker

A much easier way to install is to use Docker.

To run with docker, edit the config file (config/config.ini) and then run docker-compose up -d, it will bind to port 80.

You can edit the default download locations in the docker-compose.yml file.

Deploying for production

This is a django project, so the correct way to deploy it to a server would be by using mod_wsgi. Since this project is still in development, I haven't really thought about getting it ready for production.

If you are willing to try that, you can find the information on how to deploy this application on the Django website.