Spaces:
Paused
Paused
Captain D. Ezio
commited on
Commit
·
bbfcac4
1
Parent(s):
1497e15
Update web_helpers.py
Browse files
Powers/utils/web_helpers.py
CHANGED
|
@@ -187,7 +187,7 @@ async def youtube_downloader(c:Gojo,m:Message,query:str,is_direct:bool,type_:str
|
|
| 187 |
)
|
| 188 |
if song:
|
| 189 |
audio_stream= yt.streams.filter(only_audio=True).first()
|
| 190 |
-
f_path = audio_stream.download("
|
| 191 |
file_path = f"./youtube_downloads/{f_name.strip()}.mp3"
|
| 192 |
os.rename(f_path,file_path)
|
| 193 |
await m.reply_audio(file_path,caption=cap,reply_markup=kb,duration=vid_dur,thumb=thumb,title=f_name)
|
|
@@ -197,7 +197,7 @@ async def youtube_downloader(c:Gojo,m:Message,query:str,is_direct:bool,type_:str
|
|
| 197 |
return
|
| 198 |
elif video:
|
| 199 |
video_stream = yt.streams.get_highest_resolution()
|
| 200 |
-
video_stream.download("
|
| 201 |
file_path = f"./youtube_downloads/{f_name}.mp4"
|
| 202 |
await m.reply_video(file_path,caption=cap,reply_markup=kb,duration=vid_dur,thumb=thumb)
|
| 203 |
os.remove(file_path)
|
|
|
|
| 187 |
)
|
| 188 |
if song:
|
| 189 |
audio_stream= yt.streams.filter(only_audio=True).first()
|
| 190 |
+
f_path = audio_stream.download("/youtube_downloads")
|
| 191 |
file_path = f"./youtube_downloads/{f_name.strip()}.mp3"
|
| 192 |
os.rename(f_path,file_path)
|
| 193 |
await m.reply_audio(file_path,caption=cap,reply_markup=kb,duration=vid_dur,thumb=thumb,title=f_name)
|
|
|
|
| 197 |
return
|
| 198 |
elif video:
|
| 199 |
video_stream = yt.streams.get_highest_resolution()
|
| 200 |
+
video_stream.download("/youtube_downloads",f"{f_name}.mp4")
|
| 201 |
file_path = f"./youtube_downloads/{f_name}.mp4"
|
| 202 |
await m.reply_video(file_path,caption=cap,reply_markup=kb,duration=vid_dur,thumb=thumb)
|
| 203 |
os.remove(file_path)
|