feat: initial implementation of uptodownbot

Telegram bot for downloading media from any site using yt-dlp.
Supports audio/video/both, quality selection, language picker,
container format selection, playlist pagination, progress updates,
per-user quotas, user preferences, download history, cancel at any step,
polling and webhook modes, proxy support, and SQLite persistence.
This commit is contained in:
2026-06-25 14:22:48 +03:30
commit 05fcdf7458
26 changed files with 3302 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package domain
import "testing"
func TestValidateURL(t *testing.T) {
tests := []struct {
input string
want string
ok bool
}{
{"https://www.youtube.com/watch?v=123", "https://www.youtube.com/watch?v=123", true},
{"http://example.com/video", "http://example.com/video", true},
{"https://vimeo.com/123456", "https://vimeo.com/123456", true},
{"https://www.pornhub.com/view_video.php?viewkey=123", "https://www.pornhub.com/view_video.php?viewkey=123", true},
{"", "", false},
{"not a url", "", false},
{"ftp://example.com", "", false},
{" https://example.com ", "https://example.com", true},
}
for _, tt := range tests {
got, ok := ValidateURL(tt.input)
if ok != tt.ok || (ok && got != tt.want) {
t.Errorf("ValidateURL(%q) = (%q, %v), want (%q, %v)", tt.input, got, ok, tt.want, tt.ok)
}
}
}