Skip to content

Migrate to py-tgcalls 2.x & Fix Media Playback Issues#2

Open
taslim19 wants to merge 5 commits intoTeamUltroid:mainfrom
taslim19:main
Open

Migrate to py-tgcalls 2.x & Fix Media Playback Issues#2
taslim19 wants to merge 5 commits intoTeamUltroid:mainfrom
taslim19:main

Conversation

@taslim19
Copy link
Copy Markdown

@taslim19 taslim19 commented Mar 6, 2026

This pull request updates the core voice/video engine to py-tgcalls 2.x and addresses several critical playback, metadata, and compatibility bugs in VcBot.

Summary of Changes

  • Migrated to py-tgcalls 2.x: Updated all core group call functions to support the new py-tgcalls architecture.
  • Fixed InvalidMTProtoClient Error: Added a _TelethonShim wrapper for vcClient to ensure py-tgcalls correctly recognizes it as a Telethon client.
  • Fixed TypeError: 'coroutine' object is not callable: Updated init.py to correctly await app.group_calls as a property rather than a function.
  • Fixed .play Command Playing Video: Modified start_audio to explicitly pass video_flags=MediaStream.Flags.IGNORE, ensuring .play stays strictly audio-only.
  • Replaced youtubesearchpython with yt-dlp: Switched the primary metadata extractor to yt-dlp for better reliability and to avoid frequent proxy errors.
  • Fixed Thumbnails Sent as Stickers: Added a formatter that replaces .webp extensions with .jpg when fetching YouTube thumbnails, preventing Telegram from accidentally rendering them as stickers.

taslim19 added 5 commits March 6, 2026 19:14
- Replace GroupCallFactory with single PyTgCalls(vcClient) instance
- Add _PlayerCompat layer for group_call API (start_audio, start_video, stop, volume, mute, pause, reconnect)
- Use stream_end() handler for queue playback; _play_from_queue(chat_id) for skip/stream end
- controls: NotConnectedError -> NotInCallError, use is_connected_async()
- play/ytplaylist: use is_connected_async() for join checks
- Add requirements.txt (py-tgcalls[telethon]>=2.2.0)
- Doc tweaks in vctools.py, videoplay.py

Made-with: Cursor
- Replace VideosSearch() calls with yt-dlp -j wrapper (yt_search_first)
- Avoid httpx 'proxies' kwarg TypeError from youtubesearchpython
- Keep existing get_stream_link() yt-dlp pipeline

Made-with: Cursor
@taslim19 taslim19 force-pushed the main branch 3 times, most recently from aac591b to f354865 Compare March 7, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant