T4-FREE / utils.py
kadirnar's picture
Update utils.py
db9aaa1
import os
os.system('pip install -qq yt-dlp -U')
from yt_dlp import YoutubeDL
def url_download(url):
outtmpl = url[-5:] + '.mp4'
ydl_opts = {'format': 'bestvideo[ext=mp4]+bestaudio[ext=mp4]/mp4+best[height<=144]', 'outtmpl': outtmpl}
with YoutubeDL(ydl_opts) as ydl:
ydl.extract_info(url, download=True)
return outtmpl