Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
How to get estimated download time and download-speed programmatically? #2091
Comments
|
They are stored in the For getting the messages you just need to set the |
|
Thanks, can you pls. provide an example snippet of consuming the |
|
Got it -
This works and logs to the |
|
Sure, instead of creating a real logging.Logger object you create an object with the from youtube_dl import YoutubeDL
class Logger(object):
def debug(self, msg):
print('debug msg==> %s' % msg)
def error(self, msg):
print('error msg==> %s' % msg)
opts = {
'logger': Logger(),
}
ydl = YoutubeDL(opts)
with ydl:
ydl.add_default_info_extractors()
ydl.download(['http://www.youtube.com/watch?v=BaW_jenozKc'])Then you can do anything you want with the messages, write them to a GUI, store them show an error dialog if you receive an error message. |
|
Thanks :) |
|
@jaimeMF wow looks simple and is better than what i was thinking... something like
|
When importing YTDL in python and using the below to download with
progress_hook, how to get the estimated download time and download-speed programmatically?Also, how to capture other messages like info and error's ?