-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
"UnicodeEncodeError: 'charmap' codec can't encode character" when trying to download a song. #291
Comments
Windows 11 (64-bit) Tried two songs, both of them return similar errors User@User MINGW64 ~
$ ytmdl https://music.youtube.com/watch?v=uw9ABw6-gis&si=CV8OFdMd7qtSkHx4
[1] 131
User@User MINGW64 ~
$ ==> Searching to see if already present in C:\Users\User\Music
==> Searching Youtube for https://music.youtube.com/watch?v=uw9ABw6-gis
==> Choose One (One with [M] is verified music)
[1] Channel 1 by The Chainsmokers with dur 3:20
[2] ▒The Chainsmokers - Channel 1 (Nightcore)▒ by Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Scripts\ytmdl.exe\__main__.py", line 7, in <module>
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\ytmdl\main.py", line 614, in entry
extract_data()
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\ytmdl\main.py", line 609, in extract_data
main(args)
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\ytmdl\main.py", line 275, in main
link, yt_title = search(song_name=song_name, args=args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\ytmdl\core.py", line 63, in search
choice = song.getChoice(data, 'mp3')
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\ytmdl\song.py", line 166, in getChoice
print_choice(beg, results, SONG_INFO, type)
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\ytmdl\song.py", line 105, in print_choice
print(SONG_INFO[beg]['author_name'], end='')
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\colorama\ansitowin32.py", line 47, in write
self.__convertor.write(text)
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\colorama\ansitowin32.py", line 177, in write
self.write_and_convert(text)
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\colorama\ansitowin32.py", line 205, in write_and_convert
self.write_plain_text(text, cursor, len(text))
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\colorama\ansitowin32.py", line 210, in write_plain_text
self.wrapped.write(text[start:end])
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\colorama\ansitowin32.py", line 47, in write
self.__convertor.write(text)
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\colorama\ansitowin32.py", line 177, in write
self.write_and_convert(text)
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\colorama\ansitowin32.py", line 205, in write_and_convert
self.write_plain_text(text, cursor, len(text))
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\colorama\ansitowin32.py", line 210, in write_plain_text
self.wrapped.write(text[start:end])
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\colorama\ansitowin32.py", line 47, in write
self.__convertor.write(text)
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\colorama\ansitowin32.py", line 177, in write
self.write_and_convert(text)
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\colorama\ansitowin32.py", line 205, in write_and_convert
self.write_plain_text(text, cursor, len(text))
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\colorama\ansitowin32.py", line 210, in write_plain_text
self.wrapped.write(text[start:end])
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-5: character maps to <undefined> |
Hello? It's been 2 weeks and you've commented on all recent issues except this one. What's wrong man. |
Hey @SaqinNoor I am not sure why I might have skipped this one earlier but looking back at the issue, I am afraid I might have skipped it because it's an Windows specifc issue. Also, the issue seems specific to the usage of the As an alternative, you could try WSL as multiple users have reported in the past that it works fine for them on there. |
Bug report
Checklist
Version Info
v2023.11.26
latest
How Ytmdl was installed?
pip install ytmdl --upgrade
Console Log
Description
UnicodeEncodeError: 'charmap' codec can't encode character '\uff01' in position 21: character maps to when trying to download a song (https://music.youtube.com/watch?v=R4wbjdrbDa4&si=Bgu1QI__9JIyMjG1)
Username replaced with "User" for privacy.
The text was updated successfully, but these errors were encountered: