I'm using tkinter and youtube-dl under python
def dl(lk,fl): # link / file location
opts=['-o', fl+'/%(title)s-%(id)s.%(ext)s', '--playlist-end', '20', '--extract-audio', '--audio- format', 'mp3', '--audio-quality', '9', '--write-thumbnail', lk]
youtube_dl.main(opts)
return "Successful download"
This is the basic function which using the library, nothing extraordinary.
I call it from tkinter, so when I run it, the download start and finish. After, it close my tkinter windows.
Here, the function which call the first function in a tkinter class.
def dlv(self):
self.url = self.iurl.get()
if not self.url:
self.msg = "Error : no url"
elif not urlregex.match(self.url):
self.msg = "Error : invalid url"
else:
self.msg = dl(self.url,filel)
self.Com()
I try to stop by calling some functions as input or raw input. I also looked for option from the youtube dl librarie.
Nothing has work well.
Thanks