This repository is archived in favor of go-yts
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.
- requests
- bs4
- python-decouple
There are three ways to run this script.
- Run directly on host
- Run in a docker container
- Run using tasker
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.
- env
- 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/data:/data hibare/yts_bot:latest
version: "3.7"
services:
yts_bot:
image: hibare/yts_bot
container_name: yts_bot
hostname: yts_bot
restart: always
environment:
- SLACK_ENDPOINT=<your value>
- INTERVAL=12 #Optinal, default=12 hours
volumes:
- yts_data:/data
volumes:
yts_data:
Update SLACK_ENDPOINT
environment variable with Slack webhook URL.
❗ By default all cron jobs are scheduled to run every 12 hours.