samim23 / polymath

Convert any music library into a music production sample-library with ML
MIT License
1.51k stars 114 forks source link

YoutubeDL filenaming inconsistent #47

Closed lhjlu closed 3 months ago

lhjlu commented 1 year ago

I encountered an issue with ytdl and filenames when downloading files that start with a hyphen. For example: -qFw9qljQf4 If a link begins with a hyphen or - The ytdl throws an error as starting the command with a hyphen leads to incorrect reading of the link. polymath.py: error: argument -a/--add: expected one argument To avoid this a workaround is to replace the hyphen with %2d, thus running instead: polymath.py -a %2dqFw9qljQf4 The file gets downloaded, but than saved to a filename that does not get renamed correctly making the accessed file non-existent: FileNotFoundError: [Errno 2] No such file or directory: 'C:\\~\\polymath\\library\\-qFw9qljQf4.wav' Doing the exact same command again after renaming the file with %2d prefix with a - resolves the issue as a work-around.