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

Merged
merged 43 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d42e55b
step1
BennyThink Sep 21, 2024
57b159c
remove
BennyThink Nov 4, 2024
eedb8e3
add pdm
BennyThink Nov 25, 2024
bd47128
going
BennyThink Nov 25, 2024
5cb76e3
going
BennyThink Nov 25, 2024
48c3304
going
BennyThink Nov 26, 2024
4f02bc2
Improved `extract_code_from_instagram_url` function
SanujaNS Nov 27, 2024
e0f095d
Remove terabox download function
SanujaNS Nov 27, 2024
f10b07f
Remove unused `parse_cookie_file` function
SanujaNS Nov 27, 2024
cf0c2b8
define abstract class
BennyThink Nov 27, 2024
991a036
basic upload done?
BennyThink Nov 28, 2024
580c499
db operation
BennyThink Nov 30, 2024
072f1d1
db operation
BennyThink Nov 30, 2024
deb7683
db operation
BennyThink Nov 30, 2024
9ff9b20
db operation
BennyThink Nov 30, 2024
4c1c710
db operation
BennyThink Nov 30, 2024
0f8df41
fix name_pattern regex of `extract_url_and_name` function
SanujaNS Dec 1, 2024
83a8c73
pre-commit
BennyThink Dec 1, 2024
ef0beca
pre-push
BennyThink Dec 1, 2024
f7bd4fe
pre-push
BennyThink Dec 1, 2024
f8dec38
Refactor: Change single quotes to double quotes for name_pattern regex
SanujaNS Dec 1, 2024
e484098
add more methods
BennyThink Dec 3, 2024
6ba0cc2
rename
BennyThink Dec 3, 2024
5346fb6
use self._bot_msg
BennyThink Dec 3, 2024
38ed4c4
download done?
BennyThink Dec 3, 2024
3b1b9c7
update deps
BennyThink Dec 4, 2024
de04b72
add entrance
BennyThink Jan 11, 2025
f5beefd
runnable
BennyThink Jan 11, 2025
611d39a
fixes
BennyThink Jan 11, 2025
1da0edc
fix
BennyThink Jan 12, 2025
14e3368
record usage fix
BennyThink Jan 12, 2025
1546ed3
add cookies
BennyThink Jan 14, 2025
897211f
fix settings
BennyThink Jan 14, 2025
233193f
hint
BennyThink Jan 14, 2025
f4b49af
hint
BennyThink Jan 14, 2025
bd17efa
reset
BennyThink Jan 14, 2025
ae84522
rename
BennyThink Jan 14, 2025
86e896c
formats fix
BennyThink Jan 14, 2025
da8d45f
update README.md
BennyThink Jan 14, 2025
4f9df5a
update
BennyThink Jan 14, 2025
e909640
Merged master into your-branch-name, resolved conflicts in favor of y…
BennyThink Jan 14, 2025
7f2f16e
rename
BennyThink Jan 14, 2025
e30324b
rename
BennyThink Jan 14, 2025
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