[check] something

This commit is contained in:
levina 2022-02-21 05:54:42 +07:00 committed by GitHub
parent 769fb65ed5
commit ba5170a35f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,7 +44,12 @@ def ytsearch(query: str):
async def ytdl(link: str): async def ytdl(link: str):
stdout, stderr = await bash( stdout, stderr = await bash(
f'yt-dlp --geo-bypass -g -f "best[height<=?720][width<=?1280]/best" {link}' 'yt-dlp',
'--geo-bypass',
'-g',
'-f',
'best[height<=?720][width<=?1280]/best',
f'{link}',
) )
if stdout: if stdout:
return 1, stdout return 1, stdout
@ -99,7 +104,7 @@ async def play_tg_file(c: Client, m: Message, replied: Message = None, link: str
duration = convert_seconds(replied.voice.duration) duration = convert_seconds(replied.voice.duration)
except BaseException: except BaseException:
pass pass
# recheck
if not thumbnail: if not thumbnail:
thumbnail = f"{IMG_5}" thumbnail = f"{IMG_5}"
@ -301,7 +306,7 @@ async def play(c: Client, m: Message):
query = m.text.split(None, 1)[1] query = m.text.split(None, 1)[1]
search = ytsearch(query) search = ytsearch(query)
if search == 0: if search == 0:
await suhu.edit("❌ **no results found.**") await suhu.edit("❌ **no results found**")
else: else:
songname = search[0] songname = search[0]
title = search[0] title = search[0]