A python3 bot to keep track of popular downloads on YTS and send notifications via Slack
3.7K
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.
Scripts require following modules to function.
There are three ways to run this script.
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
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.
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.
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
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.
Content type
Image
Digest
sha256:7d8f8c1c1…
Size
52.8 MB
Last updated
over 3 years ago
docker pull hibare/yts_bot