blackjack4494 / youtube-dlc

Command-line program to download various media from YouTube.com and other sites
https://blackjack4494.github.io/youtube-dlc/
The Unlicense
1.22k stars 13 forks source link

Make [download] log entries show download module before video strings, especially for videos in the archive #120

Open jbruchon opened 4 years ago

jbruchon commented 4 years ago

When a video is downloaded or fails to download, the log lines show the service in use and the video string as seen here:

[download] Downloading video 1 of 567
[BitChute] Y7sPqLJD1eU: Downloading webpage
[BitChute] Y7sPqLJD1eU: Checking video URL
...snip...
[BitChute] t_w0Y9p1LOw: Downloading webpage
[BitChute] t_w0Y9p1LOw: Checking video URL
[BitChute] t_w0Y9p1LOw: video URL is invalid, skipping

But this is not consistent when a download is already in the archive (the archive lines include the download module name with the string, but this line referencing a video in the archive does not):

[download] cpCEuBRA2c8 has already been recorded in archive
[download] Downloading video 480 of 567

Any time a video string is emitted, the service used should be included. Ideally, the above will instead read something like:

[download] [bitchute] cpCEuBRA2c8 has already been recorded in archive
[download] Downloading video 480 of 567

This makes it easier to know what service the string goes to so that a URL can be built to check things out manually. Without this, one must scroll up to the original command to find the service in use. I have a large script that archives hundreds of channels and I will often lose that scrollback at some point, too. I'd rather have the service name right beside any instance of a video string.

blackjack4494 commented 4 years ago

@jbruchon like this?

[youtube:playlist] Downloading playlist PLQzk3DaCoDR6iWYuzkU0n2iJg2mY7AFTl - add --no-playlist to just download video RTi3_0-_GPQ [youtube:playlist] PLQzk3DaCoDR6iWYuzkU0n2iJg2mY7AFTl: Downloading webpage [download] Downloading playlist: Korean [youtube:playlist] playlist Korean: Downloading 8 videos [download] [youtube:playlist] Downloading video 1 of 8 [download] [YoutubePlaylist] Downloading video 1 of 8 [youtube] RTi3_0-_GPQ: Downloading webpage ERROR: Interrupted by user

[youtube:playlist] this is the extractor and this [YoutubePlaylist] is the extractor_key

for i, entry in enumerate(entries, 1):
                self.to_screen('[download] [%s] Downloading video %s of %s' % (ie_result.get('extractor'), i, n_entries))
                self.to_screen('[download] [%s] Downloading video %s of %s' % (ie_result.get('extractor_key'), i, n_entries))
jbruchon commented 4 years ago

Yep, that'd do it!