Spaces:
Paused
Paused
Captain D. Ezio
commited on
Commit
·
9410fe6
1
Parent(s):
af28574
Update web_helpers.py
Browse files
Powers/utils/web_helpers.py
CHANGED
|
@@ -187,8 +187,8 @@ 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"
|
| 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)
|
| 194 |
os.remove(f_path)
|
|
@@ -197,9 +197,9 @@ 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"
|
| 202 |
await m.reply_video(file_path,caption=cap,reply_markup=kb,duration=vid_dur,thumb=thumb)
|
| 203 |
os.remove(file_path)
|
| 204 |
os.remove(thumb)
|
| 205 |
-
return
|
|
|
|
| 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)
|
| 194 |
os.remove(f_path)
|
|
|
|
| 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)
|
| 204 |
os.remove(thumb)
|
| 205 |
+
return
|