This is a great project, and thank you for sharing it with us. I'm using pytube3 in one of my apps, and it works great.
I really appreciate the "on_progress" function. But I have an issue with the "on_progress" function when it comes to logging. Pytube uses the default logger, and that's ideal. However, "on_progress" in "streams.py" writes to the log on ever call, simply to show the remaining download. When downloading a YouTube video, this means that each video download writes hundreds and hundreds of lines to the log file, pushing all other log entries out in the process. I see little value in seeing hundreds or even thousands of lines of:
and then not having the debug lines of the errors I'm looking for from other modules, cause they have been purged from the log as it rolls over.
Personally I don't think this should be logged at all. I'm sure that's debatable, perhaps someone has a use-case for seeing this in the log, but I don't, as it purges useful log info, with no gain (in my opinion.)
I'd like to request that line 300 of streams.py be commented out, or removed.
Or at the very least, perhaps an option needs to be set to activate it or deactivate it, if you feel it's important to have.
I just don't feel that a single module of a project should be able to dominate 90% of a log file with info that has very limited usefulness, leaving no log space for much else.
Thanks for your consideration, and thanks again for the project!
Hello,
This is a great project, and thank you for sharing it with us. I'm using pytube3 in one of my apps, and it works great.
I really appreciate the "on_progress" function. But I have an issue with the "on_progress" function when it comes to logging. Pytube uses the default logger, and that's ideal. However, "on_progress" in "streams.py" writes to the log on ever call, simply to show the remaining download. When downloading a YouTube video, this means that each video download writes hundreds and hundreds of lines to the log file, pushing all other log entries out in the process. I see little value in seeing hundreds or even thousands of lines of:
2020-03-26 12:31:32,pytube.streams,DEBUG,Func:on_progress,download remaining: 58425494 2020-03-26 12:31:32,pytube.streams,DEBUG,Func:on_progress,download remaining: 58421398 2020-03-26 12:31:32,pytube.streams,DEBUG,Func:on_progress,download remaining: 58417302 2020-03-26 12:31:32,pytube.streams,DEBUG,Func:on_progress,download remaining: 58413206 2020-03-26 12:31:32,pytube.streams,DEBUG,Func:on_progress,download remaining: 58409110 2020-03-26 12:31:32,pytube.streams,DEBUG,Func:on_progress,download remaining: 58405014 2020-03-26 12:31:32,pytube.streams,DEBUG,Func:on_progress,download remaining: 58400918 2020-03-26 12:31:32,pytube.streams,DEBUG,Func:on_progress,download remaining: 58396822 2020-03-26 12:31:32,pytube.streams,DEBUG,Func:on_progress,download remaining: 58392726 2020-03-26 12:31:32,pytube.streams,DEBUG,Func:on_progress,download remaining: 58388630 2020-03-26 12:31:32,pytube.streams,DEBUG,Func:on_progress,download remaining: 58384534
and then not having the debug lines of the errors I'm looking for from other modules, cause they have been purged from the log as it rolls over.
Personally I don't think this should be logged at all. I'm sure that's debatable, perhaps someone has a use-case for seeing this in the log, but I don't, as it purges useful log info, with no gain (in my opinion.)
I'd like to request that line 300 of streams.py be commented out, or removed.
Or at the very least, perhaps an option needs to be set to activate it or deactivate it, if you feel it's important to have.
I just don't feel that a single module of a project should be able to dominate 90% of a log file with info that has very limited usefulness, leaving no log space for much else.
Thanks for your consideration, and thanks again for the project!