razhan commited on
Commit
098a8bb
1 Parent(s): c742e31

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -208,7 +208,7 @@ def _return_yt_html_embed(yt_url):
208
  )
209
  return HTML_str
210
 
211
- def download_yt_audio(yt_url, filename):
212
  # info_loader = youtube_dl.YoutubeDL()
213
 
214
  # try:
@@ -238,9 +238,9 @@ def download_yt_audio(yt_url, filename):
238
  # ydl.download([yt_url])
239
  # except youtube_dl.utils.ExtractorError as err:
240
  # raise gr.Error(str(err))
241
- yt = pt.YouTube(yt_url)
242
- stream = yt.streams.filter(only_audio=True)[0]
243
- stream.download(filename=filename)
244
 
245
  # @spaces.GPU
246
  # def yt_transcribe(yt_url, task="transcribe", max_filesize=75.0):
@@ -267,7 +267,7 @@ def yt_transcribe(yt_url, task="transcribe", progress=gr.Progress(), max_filesiz
267
  try:
268
  # yt = pytube.YouTube(yt_url)
269
  # stream = yt.streams.filter(only_audio=True)[0]
270
- yt = YouTube(yt_url, on_progress_callback = on_progress)
271
 
272
  stream = yt.streams.get_audio_only()
273
 
 
208
  )
209
  return HTML_str
210
 
211
+ # def download_yt_audio(yt_url, filename):
212
  # info_loader = youtube_dl.YoutubeDL()
213
 
214
  # try:
 
238
  # ydl.download([yt_url])
239
  # except youtube_dl.utils.ExtractorError as err:
240
  # raise gr.Error(str(err))
241
+ # yt = pt.YouTube(yt_url)
242
+ # stream = yt.streams.filter(only_audio=True)[0]
243
+ # stream.download(filename=filename)
244
 
245
  # @spaces.GPU
246
  # def yt_transcribe(yt_url, task="transcribe", max_filesize=75.0):
 
267
  try:
268
  # yt = pytube.YouTube(yt_url)
269
  # stream = yt.streams.filter(only_audio=True)[0]
270
+ yt = YouTube(yt_url, on_progress_callback = on_progress, use_po_token=True)
271
 
272
  stream = yt.streams.get_audio_only()
273