-
Notifications
You must be signed in to change notification settings - Fork 0
Add handlers for unsupported content types in private chats #62
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
Conversation
Simplify configuration by removing most performance-related env vars and hardcoding values optimized for maximum resource usage: - ThreadPoolExecutor: 500 workers (vs default 32) - aiohttp connections: unlimited (limit=0) - curl_cffi pool: 10000 max_clients - Image downloads: no concurrency limit (removed semaphore) Keep only 3 user-configurable limits via env vars: - MAX_USER_QUEUE_SIZE (default 0 = no limit) - STREAMING_DURATION_THRESHOLD (default 300s) - MAX_VIDEO_DURATION (default 0 = no limit)
…adata TikTok's browser impersonation (impersonate=True) doesn't work through HTTP proxies, causing extraction to fail with "Unable to extract webpage video data". Changed approach: - Use direct connection (no proxy) for video info extraction with impersonate - Use proxy for media downloads to hide server IP This fixes the issue where all proxy attempts would fail due to TikTok's JavaScript challenge blocking non-browser requests through proxies.
Create the new YoutubeDL instance before closing the old one to ensure we have a valid ydl even if initialization fails.
Return extraction error if video_data is None despite a non-error status code, preventing downstream issues from invalid data.
Remove logic that stripped proxy from ydl_opts during extraction. Datacenter IPs are typically blocked by TikTok, so extraction must use the configured proxy to work on servers.
TikTok's WAF blocks newer Chrome versions (136+) when used with proxies due to TLS fingerprint / User-Agent mismatches. This commit: - Use fixed Chrome 120 impersonation target instead of auto-selecting newest - Set matching User-Agent header for yt-dlp extraction and media downloads - Add per-proxy session pool to avoid proxy contamination between requests - Bake proxy into curl_cffi sessions at construction time
Extend message handling to respond with helpful guidance when users send images, voice messages, audio files, or other unsupported content in private chats. Group chats remain silent for these content types. - Add F.photo handler for image uploads - Add F.voice | F.audio handler for voice/audio messages - Add catch-all handler for any other unsupported content - Add tiktok_links_only locale key in all 8 languages
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
Failed to generate code suggestions for PR |
PR Type
Enhancement
Description
Add handlers for unsupported content types in private chats
Improve error messaging for invalid links and uploads
Update locale strings with more user-friendly messages
Fix reaction emoji on errors in group chats
Diagram Walkthrough
flowchart LR A[User sends message] --> B{Content type?} B -->|Video| C[Reply: video_upload_hint] B -->|Photo| D[Reply: tiktok_links_only] B -->|Voice/Audio| D B -->|Text| E{Valid TikTok link?} E -->|No URL| F[Reply: send_link_prompt] E -->|Non-TikTok URL| G[Reply: non_tiktok_link] E -->|Valid| H[Process video] B -->|Other| DFile Walkthrough
1 files
Add handlers for unsupported content types8 files
Update Arabic error messagesUpdate English error messagesUpdate Hindi error messagesUpdate Indonesian error messagesUpdate Russian error messagesUpdate Somali error messagesUpdate Ukrainian error messagesUpdate Vietnamese error messages