MarshalX / tgcalls

Voice chats, private incoming and outgoing calls in Telegram for Developers
https://t.me/tgcallslib
GNU Lesser General Public License v3.0
514 stars 91 forks source link

Core Dumped #162

Closed Achu2234 closed 2 years ago

Achu2234 commented 2 years ago

When we steram yt lives after some min the error core dumbed coming after yt vidio or media have no problem this issue only when we steram yt live

image

Url of live : https://youtu.be/JstrU2QnMY0

MarshalX commented 2 years ago

Which pytgcalls version?

Achu2234 commented 2 years ago

Which pytgcalls version?

dev13

MarshalX commented 2 years ago

Which pytgcalls version?

dev13

Try start video without audio. Is the error still exists?

Achu2234 commented 2 years ago

Which pytgcalls version?

dev13

Try start video without audio. Is the error still exists?

ok sir

Achu2234 commented 2 years ago

sir same error

MarshalX commented 2 years ago

sir same error

Are you using pafy to get video source?

Achu2234 commented 2 years ago

yes

MarshalX commented 2 years ago

yes

try this temp solution

video = pafy.new('https://www.youtube.com/watch?v=7tNtU5XFwrU') video_source = video.getbest().url for stream in video.streams: if stream.resolution == '1280x720': video_source = stream.url

The main idea is pass only 720p video stream

Achu2234 commented 2 years ago

ok sir

you mean i want to change

video = m.text.split(None, 1)[1]

        youtube_regex = (
                                     r'(https?://)?(www\.)?'
                                   '(youtube|youtu|youtube-nocookie)\.(com|be)/'
                                   '(watch\?v=|embed/|v/|.+\?v=)?([^&=%\?]{11})')
        youtube_regex_match = re.match(youtube_regex, video)
        if youtube_regex_match:
            try:
                yt = pafy.new(video)
                best = yt.getbest()
                video_url = best.url

this to

video = pafy.new('vidio') video_source = video.getbest().url for stream in video.streams: if stream.resolution == '1280x720': videosource = stream.url