PyTgCalls wrapper
pytgcalls.
Making it easier for you to useFeatures
- No need to care about audio convertion.
- Play directly from URLs, YouTube and local files.
- Get warned if can't be paused or resumed.
- Async + Sync support.
Requirements
- FFmpeg
- YouTube DL
Full examples
See the examples
folder.
Installation
pip install py-tgcalls-wrapper
Usage
Importing
from pytgcalls_wrapper import Wrapper
Initializing
wrapper = Wrapper(pytgcalls)
Streaming
The stream function joins the call if it didn't previously, otherwise just changes stream. Converted files are cached and won't be reconverted.
YouTube videos
YouTube videos are cached and won't be redownloaded.
wrapper.stream(-123456789, "https://youtube.com/watch?v=9KAQaKydqA0")
Links
wrapper.stream(-123456789, "http://somewebsite.com/path/to/somefile.webm")
Local files
wrapper.stream(-123456789, "/path/to/file.mp3")
Note: make sure you don't pass anything to the file parameter other than things like examples above for improved security.
Controlling
Pausing
wrapper.pause(-123456789)
Resuming
wrapper.resume(-123456789)
More to come soon!