jely2002 / youtube-dl-gui

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

File Not Being Saved When Playlist Contains Video Of The Same Name. #455

Open Zenodeon opened 1 year ago

Zenodeon commented 1 year ago

Describe the bug Youtube Videos of the same name in a playlist don't get downloaded or fail to save to disk after the first one is saved to disk.
Even when the names don't match by their case.

To Reproduce Steps to reproduce the behavior:

  1. Add two different videos of the same name to a youtube playlist
  2. Add Playlist link to youtube-dl-gui
  3. Download Video or Audio
  4. App will say it has downloaded 2 videos but on the folder, there will be only one of them.

Expected behavior When it fails to save the file, it should append the duplicate count of the name, For eg. Playlist Video Content - "ENCASSATOR - Psychotronics inc" , "ENCASSATOR - PSYCHOTRONICS INC" and "encassator - Psychotronics inc"

First one getting download will be named as "ENCASSATOR - Psychotronics inc.mp4" the 2nd one should be saved as "ENCASSATOR - PSYCHOTRONICS INC(1).mp4" the 3rd one should be saved as "encassator - Psychotronics inc(2).mp4"

Zenodeon commented 1 year ago

Created a Youtube Playlist that will be useful for testing. https://www.youtube.com/playlist?list=PLKF6xMlz-7Bgipbs1lYolJBweaBVJRy8h

StefanLobbenmeier commented 1 year ago

This is a bit of a conceptual issue - yt-dlp will not download files when they already exist. As a workaround you could for example add the video id to the output template. I documented output templates here: https://github.com/StefanLobbenmeier/youtube-dl-gui/issues/15#issuecomment-1374635407 you could for example try %(title)s [%(id)s].%(ext)s

maybe there is some other yt-DLP option that we can use to turn on the enumeration behaviour instead, but not sure

Zenodeon commented 1 year ago

I have a different solution, let me fork and check I can code in JS.

Zenodeon commented 1 year ago

JS is annoying.