trying to make a file and youtube downloader
monikarazdan opened this issue · 1 comments
hello, I'm new to python and trying to make files and youtube downloader but while making that I have a problem with setting the youtube URL by the user at runtime(plz someone kindly correct me where I'm wrong)
from future import unicode_literals
import youtube_dl
from youtube_dl import YoutubeDL
import urllib
import shutil
import os
u_input=int(input("enter url:"))
ydl_opts = {}
url=(u_input)
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download(url)
info_dict=ydl.extract_info(url[0], download=False)
video_title = info_dict.get('title', None)
print(video_title)
print("DONE!")
script_dir = os.path.dirname(os.path.realpath(file))
print(script_dir+"\" +video_title)](url)
Hi, I would suggest you to check youtube_dl' wiki and address the question to its forum