Skip to content
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

Windows "|" in song name issue again #283

Closed
2 tasks done
ELEPOT opened this issue Nov 17, 2023 · 1 comment
Closed
2 tasks done

Windows "|" in song name issue again #283

ELEPOT opened this issue Nov 17, 2023 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@ELEPOT
Copy link

ELEPOT commented Nov 17, 2023

Bug report

Checklist

  • I have searched for similar bugs in the issues.
  • I will add the bug label to this issue.

Version Info

  • Ytmdl version: 2023.7.27
  • Youtube-dl version: 2023.10.13

How Ytmdl was installed?

git clone https://github.com/deepjyoti30/ytmdl
pip install -e ytmdl

Console Log

Command runned:

ytmdl Aathadi Manasudhan (From "Kazhugoo") -q --skip-meta --artist "Yuvan Shankar Raja;Priya Hemesh" -o "D:/data/dataset/raw_music" --level DEBUG

Log:

 ==> Logger running in DEBUG mode 
 ==> Passed args: Namespace(SONG_NAME=['Aathadi', 'Manasudhan', '(From', 'Kazhugoo)'], quiet=True, output_dir='D:/data/dataset/raw_music', song=None, choice=None, artist='Yuvan Shankar Raja;Priya Hemesh', album=None, disable_metaadd=False, skip_meta=True, manual_meta=False, itunes_id=None, spotify_id=None, 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=None, ignore_chapters=False, ytdl_config=None, dont_transcode=False, filename=None, 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
 ==> ['Aathadi', 'Manasudhan', '(From', 'Kazhugoo)']
 ==> verify title:  False
 ==> Aathadi Manasudhan (From Kazhugoo)
 ==> None
 ==> Searching to see if already present in D:/data/dataset/raw_music
 ==> proxy passed: None
 ==> Passed format: mp3
 ==> Quiet is enabled
 ==> Searching Youtube for Aathadi Manasudhan (From Kazhugoo)
 ==> Query used:  Aathadi Manasudhan (From Kazhugoo)
 ==> Downloading Kazhugoo - Aathadi Manasudhan Video | Krishna, Bindhu | Yuvan in 320kbps 
 ==> Saving the files to: C:\Users\elepo\.cache\ytmdl
 ==> C:\Users\elepo\.cache\ytmdl\Kazhugoo#-#Aathadi#Manasudhan#Video#|#Krishna,#Bindhu#|#Yuvan.mp3
 ==> args passed:  {'quiet': False, 'no_warnings': False, 'nocheckcertificate': True, 'source_address': '0.0.0.0', 'outtmpl': 'C:\\Users\\elepo\\.cache\\ytmdl\\Kazhugoo#-#Aathadi#Manasudhan#Video#|#Krishna,#Bindhu#|#Yuvan.mp3', 'format': 'bestaudio/best'}
[youtube] Extracting URL: https://youtube.com/watch?v=vw1YxqeOvHU 
[youtube] vw1YxqeOvHU: Downloading webpage
[youtube] vw1YxqeOvHU: Downloading ios player API JSON 
[youtube] vw1YxqeOvHU: Downloading android player API JSON 
[youtube] vw1YxqeOvHU: Downloading m3u8 information 
[info] vw1YxqeOvHU: Downloading 1 format(s): 251 
[download] Destination: C:\Users\elepo\.cache\ytmdl\Kazhugoo#-#Aathadi#Manasudhan#Video###Krishna,#Bindhu###Yuvan.mp3 
[download] 100% of    4.87MiB in 00:00:01 at 4.21MiB/s
 ==> Downloaded! 
[youtube] Extracting URL: https://youtube.com/watch?v=vw1YxqeOvHU 
[youtube] vw1YxqeOvHU: Downloading webpage
[youtube] vw1YxqeOvHU: Downloading ios player API JSON 
[youtube] vw1YxqeOvHU: Downloading android player API JSON 
[youtube] vw1YxqeOvHU: Downloading m3u8 information 
 ==> songs to download:  [{'title': 'Aathadi Manasudhan (From Kazhugoo)', 'is_original': True}]
 ==> is original:  True
 ==> Has the attribute
 ==> song_name:  Aathadi Manasudhan (From Kazhugoo)  song_meta:  Aathadi Manasudhan (From Kazhugoo)
 ==> None
 ==> None:None
 ==> Skip Meta: True 
 ==> ext: mp3
 ==> Moving to: D:/data/dataset/raw_music
 ==> [Errno 22] Invalid argument: 'C:\\Users\\elepo\\.cache\\ytmdl\\Kazhugoo#-#Aathadi#Manasudhan#Video#|#Krishna,#Bindhu#|#Yuvan.mp3_new.mp3'
 ==> Getting song data for Aathadi Manasudhan (From Kazhugoo)...
 ==> Searching metadata with itunes
 ==> Searching metadata with spotify 
 ==> Using US for Spotify country
 ==> Searching metadata with gaana 
 ==> ext: mp3 
 ==> Moving to: D:/data/dataset/raw_music
 ==> [Errno 22] Invalid argument: 'C:\\Users\\elepo\\.cache\\ytmdl\\Kazhugoo#-#Aathadi#Manasudhan#Video#|#Krishna,#Bindhu#|#Yuvan.mp3_new.mp3'
 ==> No metadata found for `Aathadi Manasudhan (From Kazhugoo)` . Pass `--ignore-errors` or `on-meta-error` to ignore this.

Description

I'm running this on a windows machine, and every time the song name has the character "|" in it, it will fail with
"[Errno 22] Invalid argument: C:\Users\username\.cache\ytmdl\{song_name}"
I fixed the issue by modifying line 60 in stringutils.py from return re.sub(r" |/", "#", string) to return re.sub(r"[ |/]", "#", string)
I haven't tested it out that much so it could break at some point idk
It seems like you have code to prevent unwanted characters in path, but the regex expression isn't working.
I'm using regex version 2023.10.3 btw

@ELEPOT ELEPOT added the bug Something isn't working label Nov 17, 2023
@ELEPOT ELEPOT changed the title [Errno 22] Invalid argument Windows "|" in song name issue again Nov 17, 2023
@deepjyoti30
Copy link
Owner

@ELEPOT Thanks for reporting the issue. Above mentioned commit fixes this issue. I will let you know once a release is added with the fix.

@deepjyoti30 deepjyoti30 added this to the Next Release milestone Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants