-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix: Invalid directory creation when downloading from YouTube Music. #2431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Copilot's review matches what I saw. Some logic has been removed which will break some features. |
Ah yea I missed that, I will add the duplicate check back in 👍 |
…uld result in them being saved to a None/None directory. The root cause was that the directory was being generated before the songs metadata was fully fetched from YT music. album_artist and album_name were None when the directory was created, leading to an invlaid directory structure, and any M3U created after to not point to the correctt directories. The fix was entirely in downloader.py.
Ok, I have amended the if statement, and slightly changed it to make it a little more readable, and added back the accidental deletion for the duplicate force logic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a critical bug where downloading from YouTube Music playlists created invalid directory structures due to premature directory creation before metadata was fully fetched.
- Moved song reinitialization to occur before file path creation
- Removed redundant code for metadata checking and reinitialization
- Fixed duplicate variable assignment in file existence check
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Ha, one thing after another, keep working on this after long shifts at work lol. Anyway, I think it's good now, but let me know. |
Title
Fixes Invalid directory creation when downloading from YouTube Music.
Description
Resolves an issue where downloading songs from a YT music playlist would result in them being saved to a None/None directory. The root cause was that the directory was being generated before the songs' metadata was fully fetched from YT music. album_artist and album_name were None when the directory was created, leading to an invalid directory structure, and any M3U created after to not point to the correct directories. The fix was entirely in downloader.py.
Related Issue
Fixes #2286Motivation and Context
This change is required to ensure that playlists downloaded from YouTube Music are saved in the correct directory structure, specified by the user's output format. It fixes a significant bug that affected the core use of the tool and prevented further problems, such as breaking M3U links.
How Has This Been Tested?
Screenshots (if appropriate)
N/A
Types of Changes
Checklist