StefanLobbenmeier / youtube-dl-gui

A cross-platform GUI for youtube-dl made in Electron and node.js
GNU Affero General Public License v3.0
1.44k stars 57 forks source link

Add an option to avoid redownloading files (for V3). #111

Closed hatwearingdumb closed 5 months ago

hatwearingdumb commented 5 months ago

Is your feature request related to a problem? Please describe. For backing up large playlists/channels, I would like not to be forced to download everything in one go.

Describe the solution you'd like Add a checkbox, in the settings, that once enabled activates the following checks, before downloading files:

Pseudocode of the proposed functionality:

if ($avoidRedownloading == true) then {
    if (doesFileExist($targetDownloadDirectory + "/" + $currentlyDownloadedFilesTitle) == true) then {
        if (metadataOf($currentlyDownloadedFilesTitle) == metadataOf($targetDownloadDirectory + "/" + $currentlyDownloadedFilesTitle)) {
            exit;
        } else {
            downloadFile(filename=($currentlyDownloadedFilesTitle + $prefix));
        }
    } else {
        downloadFile(filename=$currentlyDownloadedFilesTitle);
    }
} else {
    downloadFile(filename=$currentlyDownloadedFilesTitle allowOverride=true);
}

Describe alternatives you've considered Temporarily, making the already downloaded files, read-only.

Additional context You are awesome :)

StefanLobbenmeier commented 5 months ago

Actually I would like to avoid having logic like that, because it was quite fragile when we added such logic in v2

but we can achieve tje behaviour of downloading everything just once with built in tools from yt-dlp, see download-archive https://github.com/StefanLobbenmeier/youtube-dl-gui/issues/80

As for making sure that the filenames are unique, I would ask you to add the id to the end of the filename instead

hatwearingdumb commented 5 months ago

Yeah, I didn't really write that with safe coding in mind, but just as the most bare-bones caveman implementation. You could definitely make it not as fragile, but if you say there's a better way of achieving this, so be it.