import subprocess import tempfile import os import youtube_dl import time class MyLogger ( object ): def debug ( self , msg ): pass def warning ( self , msg ): pass def error ( self , msg ): print (msg) def my_hook ( d ): if d[ 'status' ] == 'finished' : print ( 'Done downloading, now converting ...' ) ydl_opts = { 'outtmpl' : './temp/ZCL5.mp4' , 'logger' : MyLogger(), 'progress_hooks' : [my_hook], ...