I do APIfor youtube-dl in tkinterand pythonand should know:
- How to get dict information from youtube-dl in real time (speed, percentage completed, file size, etc.)
I tried:
import subprocess
def execute(command):
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
while True:
nextline = process.stdout.readline()
if nextline == '' and process.poll() != None:
break
sys.stdout.write(nextline.decode('utf-8'))
sys.stdout.flush()
output = process.communicate()[0]
exitCode = process.returncode
if (exitCode == 0):
return output
else:
raise ProcessException(command, exitCode, output)
execute("youtube-dl.exe www.youtube.com/watch?v=9bZkp7q19f0 -t")
from this question
But he had to wait until the download was complete to give me information; there may be a way to get information from the youtube-dl source code.
source
share