Sign inSign up

hibare/yts_bot

By hibare

Updated over 3 years ago

A python3 bot to keep track of popular downloads on YTS and send notifications via Slack

Image
0

3.7K

hibare/yts_bot repository overview

YTS Bot

A Python 3 script to monitor for Popular Downloads on YTS and send notifications via Slack.

Script uses web scrapping methodology to check for popular downloads.

Dependencies

Scripts require following modules to function.

  1. requests
  2. bs4
  3. python-decouple

Execution

There are three ways to run this script.

  1. Run directly on host
  2. Run in a docker container
  3. Run using tasker
Run directly on host

Install all dependencies using following command.

python3 pip install -r requirements.txt

Rename file .env.example to .env (under src).

Populate enviroment variables memntioned in .env

Navigate to src and execute the script as follow.

python3 yts_bot.py
OR

Schedule the script execution using cron. Edit crontab file using command crontab -e and add following line at the end of the file.

0 */12 * * * python3 <path_to_src>/src/yts_bot.py

This runs the script every 12 hours.

Historical popular downloads are stored in file yts_movie_list.txt to avoid duplicate notifications. (Do not edit this file manually)

To periodically check for popular downloads, schedule the script using cron.

Run in docker container

Pull the latest docker image from Docker Hub using following command.

docker pull hibare/yts_bot

Alternatively, you can build the docker image using following command.

docker build --rm -t yts_bot . --no-cache

Create following files.

  1. env
  2. history

Populate the first file (env) with following value.

SLACK_ENDPOINT=<your value here>

Run the container using following command.

docker run -d -v $PWD/.env:/app/.env -v $PWD/history:/app/yts_movie_list.txt hibare/yts_bot:latest
Run using tasker

tasker is a docker image to schedule the execution of the containers. Its kind of cron for docker container execution.

Rename file .env.example to .env (under src).

Populate enviroment variables memntioned in .env

Replace <absolute path to src> with absolute path to the src directory in file docker-compose.yml.

Start stack using following command.

docker-compose up

:exclamation: All cron jobs are scheduled to run every 12 hours.

Tag summary

Content type

Image

Digest

sha256:7d8f8c1c1

Size

52.8 MB

Last updated

over 3 years ago

docker pull hibare/yts_bot