nirajandhakal
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ from transformers.pipelines.audio_utils import ffmpeg_read
|
|
6 |
import tempfile
|
7 |
import os
|
8 |
import torch
|
|
|
9 |
|
10 |
MODEL_NAME = "ylacombe/whisper-large-v3-turbo"
|
11 |
BATCH_SIZE = 8
|
@@ -37,7 +38,10 @@ def _return_yt_html_embed(yt_url):
|
|
37 |
return HTML_str
|
38 |
|
39 |
def download_yt_audio(yt_url, filename):
|
40 |
-
|
|
|
|
|
|
|
41 |
|
42 |
try:
|
43 |
info = info_loader.extract_info(yt_url, download=False)
|
|
|
6 |
import tempfile
|
7 |
import os
|
8 |
import torch
|
9 |
+
import requests
|
10 |
|
11 |
MODEL_NAME = "ylacombe/whisper-large-v3-turbo"
|
12 |
BATCH_SIZE = 8
|
|
|
38 |
return HTML_str
|
39 |
|
40 |
def download_yt_audio(yt_url, filename):
|
41 |
+
headers = {
|
42 |
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
|
43 |
+
}
|
44 |
+
info_loader = youtube_dl.YoutubeDL({'headers': headers})
|
45 |
|
46 |
try:
|
47 |
info = info_loader.extract_info(yt_url, download=False)
|