Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
301 commits
Select commit Hold shift + click to select a range
7a7b7f3
telegram payment
BennyThink Jan 7, 2023
c8c0482
fix tgvip
BennyThink Jan 7, 2023
d874416
show receipt
BennyThink Jan 7, 2023
d9eb049
instagram cookie fix #189
BennyThink Jan 20, 2023
d0e32bb
REQUIRED_MEMBERSHIP fix
BennyThink Jan 20, 2023
48b8b60
fix sub edge case #146
BennyThink Jan 20, 2023
ecf39ec
upgrade dep
BennyThink Jan 20, 2023
9d932e8
EX conversion to int
BennyThink Jan 22, 2023
880a868
upgrade tgbot_ping
BennyThink Jan 28, 2023
dfbd69d
fix timezone issue in ping
BennyThink Jan 28, 2023
2d58289
Env toggle to enable / disable Playlist download (#200)
Bartixxx32 Feb 5, 2023
1f72259
Changed video quality choices (#205)
SanujaNS Feb 13, 2023
9d24c34
fix: youtube-dl download
gengjiawen Feb 17, 2023
f7ea35b
use yt-dlp daily build for now
BennyThink Mar 2, 2023
0f3dd86
feat: add aria2 (#211)
oElberte Mar 4, 2023
9a9de98
make aria2 optional
BennyThink Mar 4, 2023
fe4f859
Revert "create celery app, not in-memory"
BennyThink Mar 19, 2023
218b1d5
token mode instead of vip mode
BennyThink Apr 6, 2023
7bf4331
membership check #198
BennyThink Apr 8, 2023
282bf3c
update README.md
BennyThink Apr 8, 2023
ee3dfbd
remove webm and av01 from codec detection
BennyThink Apr 8, 2023
553caab
Merge pull request #222 from tgbot-collection/token
BennyThink Apr 8, 2023
4987785
bump dependencies
dependabot[bot] Apr 8, 2023
0427a9a
fix import bug
BennyThink Apr 8, 2023
455cad6
bad config REQUIRED_MEMBERSHIP
BennyThink Apr 8, 2023
1db7c68
fix transaction issue
BennyThink Apr 8, 2023
cebe1d8
create in memory
BennyThink Apr 8, 2023
3fb3dd6
large size detect in hook
BennyThink Apr 8, 2023
61c02be
extend auto restart time
BennyThink Apr 8, 2023
3374560
flood wait mitigation
BennyThink Apr 11, 2023
cc459f7
add worker data in ping
BennyThink Apr 12, 2023
f8fa672
use rate limit
BennyThink Apr 12, 2023
4c337fa
hide some info for ping
BennyThink Apr 15, 2023
07cbf8f
use session
BennyThink Apr 15, 2023
b101ff2
support instagram
BennyThink Apr 16, 2023
3afb82d
fix subscribe bug, add many type annotations
BennyThink Apr 17, 2023
783d1af
telegram send webp as sticker, need to convert it to jpg
BennyThink Apr 17, 2023
baaf3bf
better error handling
BennyThink Apr 18, 2023
cddc37f
enhance db connection
BennyThink Apr 20, 2023
ffcfcea
add sentry error tracking
BennyThink Apr 26, 2023
f2b47fb
change default pyrogram worker count
BennyThink Apr 28, 2023
3e75961
correct way to use fakeredis
BennyThink May 1, 2023
2e41d6e
add search function
BennyThink May 6, 2023
c7ac2bb
sub direct download
BennyThink May 18, 2023
c510323
add link checker, local mode exclusive
BennyThink May 18, 2023
b8f945d
update actions
BennyThink May 18, 2023
22900f4
Revert https://github.com/tgbot-collection/ytdlbot/commit/c51032373f2…
n0vad3v May 19, 2023
6c97810
Revert "Revert https://github.com/tgbot-collection/ytdlbot/commit/c51…
BennyThink May 20, 2023
2b9a6c7
fix stream checker
BennyThink May 20, 2023
941cc06
fix instagram api
BennyThink May 20, 2023
dd0627c
supress error
BennyThink May 20, 2023
8395486
fix instagram
BennyThink May 20, 2023
8a50104
fix celery override
BennyThink May 20, 2023
4aa956b
add /settings notice
BennyThink May 28, 2023
8db05d6
free download 10
BennyThink May 29, 2023
ba85246
download from file
BennyThink Jun 11, 2023
af322dc
add config for ssyoutube
BennyThink Jun 11, 2023
b85b559
bump dependencies
BennyThink Jun 23, 2023
92c8bf8
fix: exclude vp09 for download (#267)
gengjiawen Jul 9, 2023
f8888d6
Bump yt-dlp from 2023.6.22 to 2023.7.6 (#265)
dependabot[bot] Jul 9, 2023
2767290
Fix PLAYLIST_SUPPORT option not working (#262)
kran0 Jul 9, 2023
2d05e2c
Update app.json (#279)
adityabotsex Aug 12, 2023
f3ae3e5
bump and fix #273
BennyThink Aug 13, 2023
02341a9
Merge remote-tracking branch 'origin/master'
BennyThink Aug 13, 2023
0b6efaa
remove sentry
BennyThink Aug 15, 2023
297e976
bump
BennyThink Aug 26, 2023
dd2af8d
fix consent
BennyThink Aug 26, 2023
56b0dd2
copy file to other path
BennyThink Aug 26, 2023
fcfd68f
change warning to debug
BennyThink Aug 27, 2023
0607ae8
fix youtube short
BennyThink Sep 8, 2023
d901332
Pyrogram2 (#291)
BennyThink Sep 10, 2023
32fe1a8
upgrade yt-dlp to master version
BennyThink Sep 17, 2023
1ea8390
m3u8 toggle (#293)
Bartixxx32 Sep 17, 2023
880bc8f
option for setting custom tmpfile(download) path (#294)
SanujaNS Sep 19, 2023
9191b4e
Update to new yt-dlp version (yt-dlp==2023.9.24) (#297)
SanujaNS Oct 6, 2023
82ba992
rollback to pyrogram1
BennyThink Oct 9, 2023
6bce8b9
Always use the `source` format for Google Drive URLs (#300)
SanujaNS Oct 15, 2023
4962cb4
bump
BennyThink Oct 20, 2023
c40ef74
add msg_id is too low
BennyThink Oct 21, 2023
1cf4261
Temporary fix for 'msg_id is too low' error and small fix for getting…
SanujaNS Oct 25, 2023
bbcc690
don't call it in main
BennyThink Oct 25, 2023
1e9b058
add id to low script
BennyThink Oct 29, 2023
6106b94
update yt-dlp
BennyThink Nov 15, 2023
aae0f92
drop armv7
BennyThink Nov 15, 2023
1d49952
Bump yt-dlp from 2023.11.14 to 2023.11.16 (#310)
dependabot[bot] Nov 16, 2023
73bdf2a
double default limits
BennyThink Nov 17, 2023
2b6fb38
Update README.md (Improve) (#315)
SanujaNS Dec 5, 2023
37f1d4c
Update config.py
BennyThink Dec 7, 2023
a09cce4
Tron (#318)
BennyThink Dec 8, 2023
c67a548
add instagram built-in support
BennyThink Dec 9, 2023
c16718d
remove search
BennyThink Dec 9, 2023
25e3e72
move qrcode and pay btn in later response
BennyThink Dec 9, 2023
bbc357e
Correct balance and transfer amount in TRX
BennyThink Dec 10, 2023
419cb22
auto Local and channel link
BennyThink Dec 12, 2023
d09c4a5
add instagram as microservice
BennyThink Dec 12, 2023
acc07f7
bring back search
BennyThink Dec 12, 2023
320f0d5
instagram download on wg
BennyThink Dec 12, 2023
5df6ab3
fix README.md
BennyThink Dec 12, 2023
23f617e
add backup bot
BennyThink Dec 13, 2023
acacfe5
decouple redis and mysql
BennyThink Dec 14, 2023
f7243a4
let's try pyrogram 2.x again
BennyThink Dec 16, 2023
62342ee
fix local mode
BennyThink Dec 17, 2023
1c3bece
refine code
BennyThink Dec 17, 2023
34a6f9d
add connection lost
BennyThink Dec 17, 2023
08500c7
increase worker, separate redis for backup bot
BennyThink Dec 18, 2023
c486fe8
4 GiB Support (#322)
BennyThink Dec 20, 2023
1164824
add download hook
BennyThink Dec 20, 2023
cde4f91
add disclaimer
BennyThink Dec 20, 2023
78323a4
upload hook
BennyThink Dec 20, 2023
750c897
premium download consent
BennyThink Dec 20, 2023
ee65c37
disable 4g
BennyThink Dec 21, 2023
0f8c541
remove fakeredis
BennyThink Dec 21, 2023
9f9ff0a
add max_concurrent_transmissions
BennyThink Dec 21, 2023
c2d5afb
limitations on premium download
BennyThink Dec 21, 2023
613f36b
small fix for 'NoneType' object has no attribute 'lower'
BennyThink Dec 21, 2023
d0e2025
set premium at first
BennyThink Dec 22, 2023
4ec8a8e
premium 4GB max fix
BennyThink Dec 22, 2023
682d7db
disable tasks auto restart
BennyThink Dec 23, 2023
b3cabe3
Update database.py - pymysql.err.InterfaceError: (0,”) error (#325)
vuisme Dec 24, 2023
4b885cf
auto restart 10 lines
BennyThink Dec 25, 2023
b82e48c
more restart time for worker
BennyThink Dec 30, 2023
6c37e82
add some debug symbols
BennyThink Dec 30, 2023
882b313
Clean resond from yt-dlp download errror (#328)
vuisme Dec 30, 2023
0ef589f
Revert "add some debug symbols"
BennyThink Dec 30, 2023
7689c97
add gc
BennyThink Dec 30, 2023
3edcfa9
fix influxdb data collect
BennyThink Dec 30, 2023
a8c4db9
Bump yt-dlp from 2023.11.16 to 2023.12.30 (#329)
dependabot[bot] Jan 1, 2024
7962d9d
change influxdb server
BennyThink Jan 1, 2024
09352a1
deps
BennyThink Jan 9, 2024
aa66ecd
fix #335 #334
BennyThink Jan 22, 2024
ebd17fe
bumps
BennyThink Feb 9, 2024
0f6f0cc
add inline mode
BennyThink Feb 10, 2024
cd8dae8
Update tasks.py (#356)
deusyu Feb 19, 2024
885f93f
Bump fakeredis from 2.21.0 to 2.21.1 (#354)
dependabot[bot] Feb 25, 2024
5dbc4fb
Bump tqdm from 4.66.1 to 4.66.2 (#352)
dependabot[bot] Feb 25, 2024
5be9d65
bs4 exact match
BennyThink Feb 25, 2024
e297ceb
use yt-dlp with commit hash
BennyThink Mar 1, 2024
5f9329e
Bump redis from 5.0.1 to 5.0.2 (#359)
dependabot[bot] Mar 1, 2024
76172fb
auth key
BennyThink Mar 3, 2024
aab8abd
disable buy
BennyThink Apr 7, 2024
0547fc6
Enhanced download functionality for yt-dlp unsupported links (#363)
SanujaNS Apr 8, 2024
a86e073
reformat and bumps
BennyThink Apr 8, 2024
fe628ad
use fork of pyrogram
BennyThink Apr 9, 2024
cfc7983
update text
BennyThink Apr 9, 2024
fb51f12
update readme
BennyThink Apr 9, 2024
1940f2c
bump
BennyThink Apr 10, 2024
fc0745d
add support for krakenfiles and improve selection process (#370)
SanujaNS Apr 19, 2024
575e94c
Revert "disable buy"
BennyThink Apr 22, 2024
c5681d0
bump
BennyThink Apr 22, 2024
90b911c
Rewrote spdl functionality to feel more integrated and add support fo…
SanujaNS May 3, 2024
6d5894a
Bump tqdm from 4.66.2 to 4.66.4 (#378)
dependabot[bot] May 3, 2024
b30b751
Bump blinker from 1.7.0 to 1.8.1 (#377)
dependabot[bot] May 3, 2024
80ed735
Bump redis from 5.0.3 to 5.0.4 (#375)
dependabot[bot] May 3, 2024
b961248
Update sp_downloader.py: fix progress bar for Instagram downloads (#379)
SanujaNS May 28, 2024
2e45823
Bump yt-dlp from 2024.04.9 to 2024.5.27 (#390)
dependabot[bot] Jun 13, 2024
d1e702f
Fix `ping` command by separating detailed output into a new `stats` c…
SanujaNS Jun 19, 2024
18d807a
Shortening URL in the caption if it's too long and some cleanup (#400)
SanujaNS Jun 30, 2024
1490970
Bump yt-dlp from 2024.5.27 to 2024.7.2 (#402)
SanujaNS Jul 3, 2024
0964958
Bump requests from 2.31.0 to 2.32.3
SanujaNS Jul 4, 2024
d2951eb
Merge pull request #404 from SanujaNS/master
SanujaNS Jul 4, 2024
4159905
Bump yt-dlp from 2024.7.2 to 2024.7.7 (#405)
dependabot[bot] Jul 8, 2024
edc8d5b
Bump yt-dlp from 2024.7.7 to 2024.7.9 (#406)
dependabot[bot] Jul 9, 2024
78972c5
leech option for direct download using aria2 (#408)
SanujaNS Jul 17, 2024
32be202
improve /direct command (#410)
SanujaNS Jul 23, 2024
9cfdf0a
Bump yt-dlp from 2024.7.9 to 2024.8.1 (#415)
SanujaNS Aug 3, 2024
c8c8978
send as file regardless of streamable
BennyThink Aug 3, 2024
03e3010
bump everything
BennyThink Aug 3, 2024
c39b020
fix download hook
BennyThink Aug 4, 2024
f07d522
Bump yt-dlp from 2024.8.1 to 2024.8.6 (#418)
dependabot[bot] Aug 6, 2024
1f3871d
fix download as file #412
BennyThink Aug 6, 2024
0881eee
Bump fakeredis from 2.23.4 to 2.24.1 (#421)
dependabot[bot] Sep 1, 2024
2c4cb03
Bump tqdm from 4.66.4 to 4.66.5 (#416)
dependabot[bot] Sep 1, 2024
07632b1
Rename option for `/direct` command (#423)
SanujaNS Sep 1, 2024
2f4ebdd
Update README.md (#426)
BM-Bots Sep 10, 2024
1a60460
Fix issue #424(/ytdl not working in group) (#425)
SanujaNS Sep 10, 2024
dd3e42f
Improved `/stats` command (#427)
SanujaNS Sep 21, 2024
324b18d
disable buy
BennyThink Sep 26, 2024
fa88ea5
Bump yt-dlp from 2024.8.6 to 2024.9.27 (#438)
dependabot[bot] Oct 2, 2024
fcfbf35
Bump yt-dlp from 2024.9.27 to 2024.10.7 (#445)
dependabot[bot] Oct 11, 2024
afb2e58
Bump yt-dlp from 2024.10.7 to 2024.10.22 (#447)
dependabot[bot] Oct 31, 2024
ba43e79
Bump yt-dlp from 2024.10.22 to 2024.11.04 #451 (#453)
SanujaNS Nov 4, 2024
829c62b
yt-dlp's Python dependencies must be installed using the default grou…
SanujaNS Nov 10, 2024
0523254
Improve caption (Fix #456) (#457)
SanujaNS Nov 14, 2024
926c372
Improve `extract_code_from_instagram_url` function (#458)
SanujaNS Nov 22, 2024
2a89385
Bump yt-dlp[default] from 2024.11.18 to 2024.12.3 (#465)
dependabot[bot] Dec 4, 2024
825d817
Upgrade to CodeQL Action v3 (#470)
SanujaNS Dec 17, 2024
3adb096
Bump yt-dlp[default] from 2024.12.3 to 2024.12.13 (#469)
dependabot[bot] Dec 17, 2024
02bd9f0
Bump yt-dlp to 2024.12.23 (#474)
SanujaNS Dec 30, 2024
100b14d
Bump yt-dlp to 2025.1.12 (#475)
SanujaNS Jan 14, 2025
d472cdc
WIP: refactor (#460)
BennyThink Jan 14, 2025
69c7ac5
update packages
BennyThink Jan 14, 2025
1661715
update dbdsn
BennyThink Jan 14, 2025
58f2058
add logging for options
BennyThink Jan 14, 2025
d2080f5
use bigint
BennyThink Jan 14, 2025
5c52f46
live detection
BennyThink Jan 14, 2025
da5ae16
Remove Terabox details from README.md (#476)
SanujaNS Jan 14, 2025
b8157dc
detect cookie file size
BennyThink Jan 15, 2025
1554758
group fix
BennyThink Jan 15, 2025
7dddca3
cache done
BennyThink Jan 15, 2025
bac0b4f
add potoken
BennyThink Jan 16, 2025
22b5161
Bump yt-dlp from 2025.1.12 to 2025.1.15 (#477)
dependabot[bot] Jan 16, 2025
6526bd5
only record success
BennyThink Jan 16, 2025
b81befb
update yt-dlp
BennyThink Jan 16, 2025
96eb708
payment
BennyThink Jan 16, 2025
f8dfdbb
add cookies from browser
BennyThink Jan 18, 2025
f8313d1
update links
BennyThink Jan 18, 2025
85de9da
flex payment
BennyThink Jan 19, 2025
fceab00
quota fix
BennyThink Jan 24, 2025
b979551
Improve README.md (#479)
SanujaNS Jan 26, 2025
0ac49e1
add comments
BennyThink Jan 26, 2025
d064ce6
Update Docker compose (#480)
sviperm Jan 28, 2025
9e96d74
tidy compose file
BennyThink Jan 28, 2025
cd56ca5
direct download fix
BennyThink Jan 28, 2025
a9d8e0e
env bool fix
BennyThink Jan 28, 2025
eb7ba77
Fix typo (#484)
SanujaNS Jan 28, 2025
2386b59
Fix #483 & `get_env` (#485)
SanujaNS Jan 29, 2025
cd77033
Improve `/direct` (aria2) command (#486)
SanujaNS Jan 31, 2025
876f8ac
fix #487 typo
BennyThink Feb 1, 2025
8bd1607
Fix `/spdl` (refactor #460) (#488)
SanujaNS Feb 17, 2025
e39d9e9
Fix #489 (#490)
SanujaNS Feb 17, 2025
ab0882e
m3u8 support and toggle (#493)
SanujaNS Feb 24, 2025
63a1fcd
Bump yt-dlp from 2025.1.15 to 2025.2.19 (#492)
dependabot[bot] Mar 2, 2025
5a0decb
Bump yt-dlp from 2025.2.19 to 2025.3.21 with standard tag `[default]`…
SanujaNS Mar 22, 2025
5e4552c
Bump yt-dlp[default] from 2025.3.21 to 2025.3.27 (#498)
dependabot[bot] Mar 28, 2025
a033e05
tag with commit hash
BennyThink Mar 28, 2025
a58ce2c
Bump yt-dlp[default] from 2025.3.27 to 2025.3.31 (#499)
dependabot[bot] Apr 7, 2025
8a75208
Bump kurigram from 2.1.38 to 2.2.0 (PDM) (#503)
SanujaNS Apr 17, 2025
68948c4
Bump dependencies; (#509)
SanujaNS May 1, 2025
b486974
Bump kurigram from 2.2.1 to 2.2.3 (#511)
dependabot[bot] May 12, 2025
1045b93
Update kurigram 2.2.1 -> 2.2.3 (PDM) (#513)
SanujaNS May 15, 2025
7c9eeec
Bump redis from 5.2.1 to 6.1.0 (#512)
dependabot[bot] May 15, 2025
f881308
Bump kurigram, redis and yt-dlp to the latest version (#519)
SanujaNS May 31, 2025
e347a7f
Bump yt-dlp[curl-cffi,default] from 2025.5.22 to 2025.6.9 (#521)
SanujaNS Jun 13, 2025
a2f61ac
Bump yt-dlp[curl-cffi,default] from 2025.6.9 to 2025.6.25 (#524)
dependabot[bot] Jun 27, 2025
61b5017
Bump yt-dlp[curl-cffi,default] from 2025.6.9 to 2025.6.25 (PDM) (#525)
SanujaNS Jun 27, 2025
f39d363
Improve media upload reliability and error handling (#527)
SanujaNS Jun 28, 2025
28d342d
Bump yt-dlp[curl-cffi,default] from 2025.6.25 to 2025.6.30 (#529)
SanujaNS Jul 9, 2025
e5a0a5c
Bump kurigram from 2.2.6 to 2.2.7 (#532)
SanujaNS Jul 22, 2025
9b7d3d6
Improve Download Handling in `/direct` and Performance with Metadata …
SanujaNS Jul 22, 2025
7279fc6
Bump redis from 6.2.0 to 6.3.0 (#535)
dependabot[bot] Aug 7, 2025
933eb4c
Bump redis from 6.2.0 to 6.3.0 (PDM) (#536)
SanujaNS Aug 8, 2025
35aaf26
Bump yt-dlp and redis to the latest versions (#539)
SanujaNS Aug 19, 2025
44f1a4b
Bump yt-dlp[curl-cffi,default] from 2025.8.11 to 2025.8.20 (#541)
SanujaNS Aug 26, 2025
c29c5d8
Bump yt-dlp[curl-cffi,default] from 2025.8.20 to 2025.8.22 (#543)
SanujaNS Aug 27, 2025
b73784e
Bump kurigram and yt-dlp to the latest versions (#547)
SanujaNS Aug 30, 2025
be5334b
Bump yt-dlp[curl-cffi,default] from 2025.8.27 to 2025.9.5 (#549)
dependabot[bot] Sep 9, 2025
2816236
Bump yt-dlp[curl-cffi,default] from 2025.9.5 to 2025.9.26 (#554)
dependabot[bot] Oct 2, 2025
24b5783
Bump kurigram and yt-dlp to the latest versions (#555)
SanujaNS Oct 2, 2025
979e95b
Bump kurigram and yt-dlp to the latest versions (#558)
SanujaNS Oct 31, 2025
f5687a4
Bump yt-dlp to latest with support for external JavaScript runtime (#…
SanujaNS Nov 23, 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
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
env
venv
db_data
.ash_history
.DS_Store
.DS_Store
66 changes: 66 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# 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, comma-separated
OWNER=

# List of authorized users, comma-separated
AUTHORIZED_USER=

# Database connection address, i.e. mysql+pymysql://user:pass@mysql/dbname
DB_DSN=mysql+pymysql://ytdlbot:your_password@mysql/ytdlbot

# Redis host, leave it empty to use fakeredis
REDIS_HOST=redis

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

# Desired audio format (e.g., mp3, wav), leave it empty to use m4a
AUDIO_FORMAT=

# Enable m3u8 link support (True/False)
M3U8_SUPPORT=False

# 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 from Bot Father
PROVIDER_TOKEN=

# Free downloads allowed per user
FREE_DOWNLOAD=5

# 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

# potoken 'https://github.com/yt-dlp/yt-dlp/wiki/PO-Token-Guide'
POTOKEN=11

BROWSERS=firefox
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: BennyThink
custom: https://buy.stripe.com/bIYbMa9JletbevCaEE
26 changes: 15 additions & 11 deletions .github/workflows/builder.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: docker image builder
on:
push:
paths-ignore:
- '**.md'
branches:
- 'master'

Expand All @@ -9,63 +11,65 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: true

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Lower case for Docker Hub
id: dh_string
uses: ASzc/change-string-case-action@v1
uses: ASzc/change-string-case-action@v5
with:
string: ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}

- name: Lower case for ghcr
id: ghcr_string
uses: ASzc/change-string-case-action@v1
uses: ASzc/change-string-case-action@v5
with:
string: ${{ github.event.repository.full_name }}

- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/arm,linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ steps.dh_string.outputs.lowercase }}
${{ steps.dh_string.outputs.lowercase }}:${{ github.sha }}
ghcr.io/${{ steps.ghcr_string.outputs.lowercase }}
ghcr.io/${{ steps.ghcr_string.outputs.lowercase }}:${{ github.sha }}

cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -53,7 +53,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -67,4 +67,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
21 changes: 20 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,23 @@ ytdlbot/ytdl.session
data/*
upgrade_worker.sh
ytdl.session
reinforcement/*
reinforcement/*
/ytdlbot/session/celery.session
/.idea/prettier.xml
/.idea/watcherTasks.xml
/ytdlbot/session/ytdl.session-journal
/ytdlbot/unknown_errors.txt
/ytdlbot/ytdl.session-journal
/ytdlbot/ytdl-main.session-journal
/ytdlbot/ytdl-main.session
/ytdlbot/ytdl-celery.session-journal
/ytdlbot/ytdl-celery.session
/ytdlbot/main.session
/ytdlbot/tasks.session
/ytdlbot/tasks.session-journal
/ytdlbot/premium.session
/dump.rdb
/ytdlbot/premium.session-journal
/ytdlbot/main.session-journal
/src/main.session
/src/main.session-journal
29 changes: 13 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
FROM python:3.9-alpine as builder
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

RUN apk update && apk add --no-cache tzdata alpine-sdk libffi-dev ca-certificates
ADD requirements.txt /tmp/
RUN pip3 install --user -r /tmp/requirements.txt && rm /tmp/requirements.txt
FROM python:3.12-alpine AS runner
WORKDIR /app

RUN apk update && apk add --no-cache ffmpeg aria2 deno
COPY --from=pybuilder /build/.venv/lib/ /usr/local/lib/
COPY src /app
WORKDIR /app

FROM python:3.9-alpine
WORKDIR /ytdlbot/ytdlbot
ENV TZ=Asia/Shanghai

COPY apk.txt /tmp/
RUN apk update && xargs apk add < /tmp/apk.txt
COPY --from=builder /root/.local /usr/local
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
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