Closed Hish15 closed 2 years ago
Are you sure you followed the setup for ytmusicapi correctly? Step 5 in the instructions
Spotify tracks: 28/28
Traceback (most recent call last):
File "YouTube.py", line 190, in <module>
main()
File "YouTube.py", line 182, in main
videoIds = ytmusic.search_songs(playlist['tracks'])
File "YouTube.py", line 70, in search_songs
result = self.api.search(query)
File "C:\Users\Pavel\AppData\Local\Programs\Python\Python36\lib\site-packages\ytmusicapi\mixins\browsing.py", line 141, in search
response = self._send_request(endpoint, body)
File "C:\Users\Pavel\AppData\Local\Programs\Python\Python36\lib\site-packages\ytmusicapi\ytmusic.py", line 142, in _send_request
raise Exception(message + error)
Exception: Server returned HTTP 500: Internal Server Error.
Internal error encountered.
I followed the step 5 and attempted to get the headers from different browsers, but still get the error. Am I missing something else?
Your headers are almost certainly the issue. Try starting from scratch. I can try to debug for you if you send your headers to ytmusicapi@gmail.com
After further troubleshooting, I figured out why I was getting the Internal Server Error. In the settings.ini.example, I misunderstood the purpose of this line:
user_id =
I thought it was supposed to have my Google user_id, but that was not the case. The line needs to remain empty as specified in the example.
user_id
is used for brand accounts, which you can create under your main account. If you don't have one, it's fine to leave it empty. So that means everything is working for you?
That's helpful to know. Yes, after leaving the user_id
blank, everything started to work fine.
I was following Find your YouTube user & channel IDs guide to identify the user_id
value, however after entering the corresponding user id, I was getting that 500 error.
No, that's not related. See here for the correct procedure for brand accounts: https://ytmusicapi.readthedocs.io/en/latest/usage.html
But doesn't matter for you since you're not using a brand account.
After following every step of the Readme instructions, I get
Is there something more to do to avoid the Forbidden error message?