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

UnicodeEncodeError: 'latin-1' codec can't encode character '\u2026' #29

Open
Cactism opened this issue Oct 26, 2024 · 0 comments
Open

Comments

@Cactism
Copy link

Cactism commented Oct 26, 2024

I've completed the steps correctly in a virtual machine (Windows Sandbox) and, unfortunately, I have the following error:

Full Log
Traceback (most recent call last):
  File "C:\Users\WDAGUtilityAccount\Downloads\Spotify-To-Youtube-main\Spotify-To-Youtube-main\runLocally.py", line 35, in <module>
    ytmusic = spotifyToYoutube.login_to_google('ytmusic_headers.json')
  File "C:\Users\WDAGUtilityAccount\Downloads\Spotify-To-Youtube-main\Spotify-To-Youtube-main\spotifyToYoutube.py", line 17, in login_to_google
    ytmusic = YTMusic(ytmusic_headers, requests_session=session)
  File "C:\Users\WDAGUtilityAccount\AppData\Local\Programs\Python\Python313\Lib\site-packages\ytmusicapi\ytmusic.py", line 96, in __init__
    self.headers.update(get_visitor_id(self._send_get_request))
                        ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\WDAGUtilityAccount\AppData\Local\Programs\Python\Python313\Lib\site-packages\ytmusicapi\helpers.py", line 63, in get_visitor_id
    response = request_func(YTM_DOMAIN)
  File "C:\Users\WDAGUtilityAccount\AppData\Local\Programs\Python\Python313\Lib\site-packages\ytmusicapi\ytmusic.py", line 146, in _send_get_request
    response = self._session.get(url, params=params, headers=self.headers, proxies=self.proxies)
  File "C:\Users\WDAGUtilityAccount\AppData\Local\Programs\Python\Python313\Lib\site-packages\requests\sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\WDAGUtilityAccount\AppData\Local\Programs\Python\Python313\Lib\site-packages\requests\sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\WDAGUtilityAccount\AppData\Local\Programs\Python\Python313\Lib\site-packages\requests\sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\WDAGUtilityAccount\AppData\Local\Programs\Python\Python313\Lib\site-packages\requests\adapters.py", line 486, in send
    resp = conn.urlopen(
        method=request.method,
    ...<9 lines>...
        chunked=chunked,
    )
  File "C:\Users\WDAGUtilityAccount\AppData\Local\Programs\Python\Python313\Lib\site-packages\urllib3\connectionpool.py", line 715, in urlopen
    httplib_response = self._make_request(
        conn,
    ...<5 lines>...
        chunked=chunked,
    )
  File "C:\Users\WDAGUtilityAccount\AppData\Local\Programs\Python\Python313\Lib\site-packages\urllib3\connectionpool.py", line 416, in _make_request
    conn.request(method, url, **httplib_request_kw)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\WDAGUtilityAccount\AppData\Local\Programs\Python\Python313\Lib\site-packages\urllib3\connection.py", line 244, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\WDAGUtilityAccount\AppData\Local\Programs\Python\Python313\Lib\http\client.py", line 1336, in request
    self._send_request(method, url, body, headers, encode_chunked)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\WDAGUtilityAccount\AppData\Local\Programs\Python\Python313\Lib\http\client.py", line 1377, in _send_request
    self.putheader(hdr, value)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "C:\Users\WDAGUtilityAccount\AppData\Local\Programs\Python\Python313\Lib\site-packages\urllib3\connection.py", line 224, in putheader
    _HTTPConnection.putheader(self, header, *values)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\WDAGUtilityAccount\AppData\Local\Programs\Python\Python313\Lib\http\client.py", line 1309, in putheader
    values[i] = one_value.encode('latin-1')
                ~~~~~~~~~~~~~~~~^^^^^^^^^^^
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2026' in position 512: ordinal not in range(256)

Is there anyway to fix this? If it's of any use, here are my playlist IDs: ["3dyLmdZHqM7hYkeHl7JBW0", "4BxnUH5hp1ft97uIDY0l4U"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant