Signed-off-by: mbrucedogs <mbrucedogs@gmail.com>
This commit is contained in:
parent
6a2eb2bac5
commit
820a885f9f
@ -232,9 +232,10 @@ class KaraokeDownloader:
|
|||||||
if not output_path.exists() or output_path.stat().st_size == 0:
|
if not output_path.exists() or output_path.stat().st_size == 0:
|
||||||
print(f"❌ Download failed or file is empty: {output_path}")
|
print(f"❌ Download failed or file is empty: {output_path}")
|
||||||
continue
|
continue
|
||||||
if not self._is_valid_mp4(output_path):
|
# TEMP: Skipping MP4 validation for debugging
|
||||||
print(f"❌ File is not a valid MP4: {output_path}")
|
# if not self._is_valid_mp4(output_path):
|
||||||
continue
|
# print(f"❌ File is not a valid MP4: {output_path}")
|
||||||
|
# continue
|
||||||
add_id3_tags(output_path, f"{artist} - {title} (Karaoke Version)", channel_name)
|
add_id3_tags(output_path, f"{artist} - {title} (Karaoke Version)", channel_name)
|
||||||
mark_songlist_song_downloaded(self.songlist_tracking, artist, title, channel_name, output_path)
|
mark_songlist_song_downloaded(self.songlist_tracking, artist, title, channel_name, output_path)
|
||||||
print(f"✅ Downloaded and tracked: {artist} - {title}")
|
print(f"✅ Downloaded and tracked: {artist} - {title}")
|
||||||
@ -261,6 +262,7 @@ class KaraokeDownloader:
|
|||||||
print(f" - {song['artist']} - {song['title']}")
|
print(f" - {song['artist']} - {song['title']}")
|
||||||
downloaded_count = 0
|
downloaded_count = 0
|
||||||
attempted = set()
|
attempted = set()
|
||||||
|
total_to_download = limit if limit is not None else len(undownloaded)
|
||||||
# Keep looping until limit is reached or no more undownloaded songs
|
# Keep looping until limit is reached or no more undownloaded songs
|
||||||
while undownloaded and (limit is None or downloaded_count < limit):
|
while undownloaded and (limit is None or downloaded_count < limit):
|
||||||
for song in list(undownloaded):
|
for song in list(undownloaded):
|
||||||
@ -283,6 +285,8 @@ class KaraokeDownloader:
|
|||||||
v_artist, v_title = extract_artist_title(video['title'])
|
v_artist, v_title = extract_artist_title(video['title'])
|
||||||
if (normalize_title(v_artist) == normalize_title(artist) and normalize_title(v_title) == normalize_title(title)) or \
|
if (normalize_title(v_artist) == normalize_title(artist) and normalize_title(v_title) == normalize_title(title)) or \
|
||||||
(normalize_title(video['title']) == normalize_title(f"{artist} - {title}")):
|
(normalize_title(video['title']) == normalize_title(f"{artist} - {title}")):
|
||||||
|
# Progress print statement
|
||||||
|
print(f"\U0001F4E5 Downloading {downloaded_count + 1} of {total_to_download} songlist songs...")
|
||||||
# Download this song from this channel
|
# Download this song from this channel
|
||||||
output_path = self.downloads_dir / channel_name / f"{artist} - {title} (Karaoke Version).mp4"
|
output_path = self.downloads_dir / channel_name / f"{artist} - {title} (Karaoke Version).mp4"
|
||||||
output_path.parent.mkdir(parents=True, exist_ok=True)
|
output_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
@ -302,9 +306,10 @@ class KaraokeDownloader:
|
|||||||
if not output_path.exists() or output_path.stat().st_size == 0:
|
if not output_path.exists() or output_path.stat().st_size == 0:
|
||||||
print(f"❌ Download failed or file is empty: {output_path}")
|
print(f"❌ Download failed or file is empty: {output_path}")
|
||||||
continue
|
continue
|
||||||
if not self._is_valid_mp4(output_path):
|
# TEMP: Skipping MP4 validation for debugging
|
||||||
print(f"❌ File is not a valid MP4: {output_path}")
|
# if not self._is_valid_mp4(output_path):
|
||||||
continue
|
# print(f"❌ File is not a valid MP4: {output_path}")
|
||||||
|
# continue
|
||||||
add_id3_tags(output_path, f"{artist} - {title} (Karaoke Version)", channel_name)
|
add_id3_tags(output_path, f"{artist} - {title} (Karaoke Version)", channel_name)
|
||||||
mark_songlist_song_downloaded(self.songlist_tracking, artist, title, channel_name, output_path)
|
mark_songlist_song_downloaded(self.songlist_tracking, artist, title, channel_name, output_path)
|
||||||
print(f"✅ Downloaded and tracked: {artist} - {title}")
|
print(f"✅ Downloaded and tracked: {artist} - {title}")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user