You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from ytmusicapi import YTMusic
ytmusic = YTMusic()
x = ytmusic.get_charts('ZZ')
print(x)
i get this error
Traceback (most recent call last):
File "c:\Users\Arnav\OneDrive\Dokumen\GitHub\music\1.py", line 4, in <module>
print(x)
File "C:\Users\Arnav\AppData\Local\Programs\Python\Python311\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 5598-5600: character maps to <undefined>
so i need to encode it explicitly
from ytmusicapi import YTMusic
ytmusic = YTMusic()
x = ytmusic.get_charts('ZZ')
print(str(x).encode('utf-8'))
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
when i try to get top charts by using this code-
i get this error
so i need to encode it explicitly
and it returns in a weird manner
is there any issue from my end?
please let me know.
Beta Was this translation helpful? Give feedback.
All reactions