Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: refactor #460

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Example .env file for ytdlbot configuration

# Number of workers (default is 100)
WORKERS=100

# Telegram app ID
APP_ID=

# Telegram app hash
APP_HASH=

# Telegram bot token
BOT_TOKEN=

# Owner ID or username
OWNER=

# List of authorized users (comma-separated)
AUTHORIZED_USER=

# MySQL Data Source Name
MYSQL_DSN=

# Redis host
REDIS_HOST=

# Enable FFMPEG for video processing (True/False)
ENABLE_FFMPEG=False

# Desired audio format (e.g., mp3, wav)
AUDIO_FORMAT=

# Enable Aria2 for downloads (True/False)
ENABLE_ARIA2=False

# Path to Rclone executable
RCLONE_PATH=

# Enable VIP features (True/False)
ENABLE_VIP=False

# Payment provider token
PROVIDER_TOKEN=

# Free downloads allowed per user
FREE_DOWNLOAD=5

# Token price (default: 10 credits for 1 USD)
TOKEN_PRICE=10

# Rate limit for requests
RATE_LIMIT=120

# Path for temporary files (ensure the directory exists and is writable)
TMPFILE_PATH=

# Maximum size for Telegram uploads in MB
TG_NORMAL_MAX_SIZE=2000

# Maximum URL length in captions
CAPTION_URL_LENGTH_LIMIT=150
25 changes: 14 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
FROM python:3.11 as builder
ADD requirements.txt /tmp/
RUN apt update && apt install -y git && pip3 install --user -r /tmp/requirements.txt && rm /tmp/requirements.txt
FROM python:3.12-alpine AS pybuilder
ADD pyproject.toml pdm.lock /build/
WORKDIR /build
RUN apk add alpine-sdk python3-dev musl-dev linux-headers
RUN pip install pdm
RUN pdm install

FROM python:3.12-alpine AS runner
WORKDIR /app
ENV TZ=Europe/Stockholm

FROM python:3.11-slim
WORKDIR /ytdlbot/ytdlbot
ENV TZ=Europe/London
RUN apk update && apk add --no-cache ffmpeg aria2
COPY --from=pybuilder /build/.venv/lib/ /usr/local/lib/
COPY ytdlbot /app
WORKDIR /app

RUN apt update && apt install -y --no-install-recommends --no-install-suggests ffmpeg vnstat git aria2
COPY --from=builder /root/.local /usr/local
COPY . /ytdlbot

CMD ["/usr/local/bin/supervisord", "-c" ,"/ytdlbot/conf/supervisor_main.conf"]
CMD ["python" ,"main.py"]
52 changes: 0 additions & 52 deletions Makefile

This file was deleted.

1 change: 0 additions & 1 deletion Procfile

This file was deleted.

Loading