deepjyoti30 / ytmdl

A simple app to get songs from YouTube in mp3 format with artist name, album name etc from sources like iTunes, Spotify, LastFM, Deezer, Gaana etc.
https://ytmdl.deepjyoti30.dev
MIT License
3.22k stars 164 forks source link

Songs don't get named correctly #256

Closed SyndiShanX closed 1 year ago

SyndiShanX commented 1 year ago

Bug report

Checklist

Version Info

How Ytmdl was installed?

pip install ytmdl --upgrade

Console Log

ytmdl -o D:/Desktop/Spotify/YTMDL/Done --ignore-chapters --spotify-id 11empTcflLLXn41XHmitrW --choice 1 --quiet  --download-archive Downloaded.txt --level DEBUG --artist "Jared Halley" Believer / Gold / Thunder / Demons / Its Time / Shots / On Top of the World / I Bet My Life / Whatever It Takes / Radioactive
 ==> Logger running in DEBUG mode
 ==> Passed args: Namespace(SONG_NAME=['Believer', '/', 'Gold', '/', 'Thunder', '/', 'Demons', '/', 'Its', 'Time', '/', 'Shots', '/', 'On', 'Top', 'of', 'the', 'World', '/', 'I', 'Bet', 'My', 'Life', '/', 'Whatever', 'It', 'Takes', '/', 'Radioactive'], quiet=True, output_dir='D:/Desktop/Spotify/YTMDL/Done', song=None, choice=1, artist='Jared Halley', album=None, disable_metaadd=False, skip_meta=False, manual_meta=False, itunes_id=None, spotify_id='11empTcflLLXn41XHmitrW', disable_sort=False, ask_meta_name=False, on_meta_error=None, proxy=None, url=None, list=None, nolocal=False, format='mp3', trim=False, get_opts=False, keep_chapter_name=False, download_archive='Downloaded.txt', ignore_chapters=True, ytdl_config=None, dont_transcode=False, pl_start=None, pl_end=None, pl_items=None, ignore_errors=False, title_as_name=False, level='DEBUG', disable_file=False, list_level=False)
 ==> on_meta_error before:  None
 ==> on_meta_error after:  exit
 ==> itunes_country: US
 ==> ['Believer', '/', 'Gold', '/', 'Thunder', '/', 'Demons', '/', 'Its', 'Time', '/', 'Shots', '/', 'On', 'Top', 'of', 'the', 'World', '/', 'I', 'Bet', 'My', 'Life', '/', 'Whatever', 'It', 'Takes', '/', 'Radioactive']
 ==> verify title:  False
 ==> Believer / Gold / Thunder / Demons / Its Time / Shots / On Top of the World / I Bet My Life / Whatever It Takes / Radioactive
 ==> <_io.TextIOWrapper name='Downloaded.txt' mode='r+' encoding='cp1252'>
 ==> Searching to see if already present in D:/Desktop/Spotify/YTMDL/Done
 ==> proxy passed: None
 ==> Passed format: mp3
 ==> Quiet is enabled
 ==> Searching Youtube for Believer / Gold / Thunder / Demons / Its Time / Shots / On Top of the World / I Bet My Life / Whatever It Takes / Radioactive
 ==> Using 1 as choice
 ==> Downloading Imagine Dragons (ACAPELLA Medley) - Thunder, Whatever it Takes, Believer, Radioactive and MORE! in 320kbps
 ==> Saving the files to: C:\Users\SyndiShanX\.cache\ytmdl
 ==> C:\Users\SyndiShanX\.cache\ytmdl\Imagine#Dragons#(ACAPELLA#Medley)#-#Thunder,#Whatever#it#Takes,#Believer,#Radioactive#and#MORE!.mp3
 ==> args passed:  {'quiet': False, 'no_warnings': False, 'nocheckcertificate': True, 'source_address': '0.0.0.0', 'outtmpl': 'C:\\Users\\SyndiShanX\\.cache\\ytmdl\\Imagine#Dragons#(ACAPELLA#Medley)#-#Thunder,#Whatever#it#Takes,#Believer,#Radioactive#and#MORE!.mp3', 'format': 'bestaudio/best'}
[youtube] CojnI6ikXMg: Downloading webpage
[youtube] CojnI6ikXMg: Downloading android player API JSON
[info] CojnI6ikXMg: Downloading 1 format(s): 251
[download] Destination: C:\Users\SyndiShanX\.cache\ytmdl\Imagine#Dragons#(ACAPELLA#Medley)#-#Thunder,#Whatever#it#Takes,#Believer,#Radioactive#and#MORE!.mp3
[download] 100% of 6.02MiB in 00:12 at 475.37KiB/s
 ==> Downloaded!
[youtube] CojnI6ikXMg: Downloading webpage
[youtube] CojnI6ikXMg: Downloading android player API JSON
 ==> songs to download:  [{'title': 'Believer / Gold / Thunder / Demons / Its Time / Shots / On Top of the World / I Bet My Life / Whatever It Takes / Radioactive', 'is_original': True}]
 ==> is original:  True
 ==> Has the attribute
 ==> song_name:  Believer / Gold / Thunder / Demons / Its Time / Shots / On Top of the World / I Bet My Life / Whatever It Takes / Radioactive  song_meta:  Believer / Gold / Thunder / Demons / Its Time / Shots / On Top of the World / I Bet My Life / Whatever It Takes / Radioactive
 ==> <_io.TextIOWrapper name='Downloaded.txt' mode='r+' encoding='cp1252'>
 ==> None:None
 ==> Skip Meta: False
 ==> Direct Spotify lookup for 11empTcflLLXn41XHmitrW...
 ==> Setting data...
 ==> 1
 ==> 0
 ==> Preparing the album cover
 ==> Passed song release date:  2018-06-01
 ==> [WinError 3] The system cannot find the path specified: 'C:\\Users\\SyndiShanX\\.cache\\ytmdl\\Imagine#Dragons#(ACAPELLA#Medley)#-#Thunder,#Whatever#it#Takes,#Believer,#Radioactive#and#MORE!.mp3_new.mp3' -> "C:\\Users\\SyndiShanX\\.cache\\ytmdl\\Believer / Gold / Thunder / Demons / It's Time / Shots / On Top of the World / I Bet My Life / Whatever It Takes / Radioactive.mp3"
 ==> ================================
  || YEAR: 2018-06-01
  || TITLE: Believer / Gold / Thunder / Demons / It's Time / Shots / On Top of the World / I Bet My Life / Whatever It Takes / Radioactive
  || ARTIST: Jared Halley
  || ALBUM: Believer / Gold / Thunder / Demons / It's Time / Shots / On Top of the World / I Bet My Life / Whatever It Takes / Radioactive
  || GENRE:
  || TRACK NO: 1
  || ALBUM COVER ADDED
 ==> ================================
 ==> D:/Desktop/Spotify/YTMDL/Done
 ==> Moved to D:/Desktop/Spotify/YTMDL/Done...
 ==> Done

Description

Song gets named Imagine#Dragons#(ACAPELLA#Medley)#-#Thunder,#Whatever#it#Takes,#Believer,#Radioactive#and#MORE!.mp3_new.mp3 Instead of Believer / Gold / Thunder / Demons / Its Time / Shots / On Top of the World / I Bet My Life / Whatever It Takes / Radioactive.mp3

SyndiShanX commented 1 year ago

This also happened with a Song with a Shorter Name ytmdl -o D:/Desktop/Spotify/YTMDL/Done --ignore-chapters --spotify-id 0J3MfW6wwIBqC4zjp5AbQL --choice 1 --quiet --download-archive Downloaded.txt --artist "O.A.R." Shattered (Turn The Car Around)

deepjyoti30 commented 1 year ago

@SyndiShanX Thanks for reporting the issue.

One question here, can you confirm that the ~/.cache/ytmdl directory that ytmdl is using to download the song is empty? If not, can you empty the directory and try running the download command again?

Also, are you able to consistently reproduce this issue or does it only happen sometimes?

SyndiShanX commented 1 year ago

It does happen consistently, and from what I remember the folder was empty; I can check in a bit to confirm. Does running the command shown above produce the same error on your end?

deepjyoti30 commented 1 year ago

@SyndiShanX It doesn't create the same error on my end. This is why I asked you the questions as I am unable to reproduce them locally.

My guess was that the cache directory might have other files that are conflicting with the final created song (that is moved to the music directory)

SyndiShanX commented 1 year ago

Just tried updating YTMDL and both commands produced the same erroring filename, I also deleted .cache both times to no avail, are the some other cache directories?

deepjyoti30 commented 1 year ago

Okay, thanks for the update. There are no other cache directories. This error might be specific to the platform you're running ytmdl in which is Windows?

SyndiShanX commented 1 year ago

Yeah I’m on Windows 10, latest updates

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs for another 7 days. Thank you for your contributions.

SyndiShanX commented 1 year ago

Bump, Still not fixed

deepjyoti30 commented 1 year ago

@SyndiShanX The issue is fixed. I was able to reproduce the issue with the song name you had shared and I have added a fix.

Will be included in the next release.

SyndiShanX commented 1 year ago

Nice, thanks