sigma67 / spotify_to_ytmusic

Clone a Spotify playlist to YouTube Music
MIT License
895 stars 67 forks source link

key error: Youtube when importing headers #21

Closed babutzc closed 3 years ago

babutzc commented 3 years ago

I am trying to copy-paste the headers using the Setup.py

Steps to reproduce

Headers i try to copy paste

User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
X-Goog-AuthUser: 0
X-Origin: https://music.youtube.com
Connection: keep-alive
Cookie: <<Cookie header>> 

Terminal

python3 setup.py youtube 
Please paste the request headers from Firefox and press Ctrl-D to continue:
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
X-Goog-AuthUser: 0
X-Origin: https://music.youtube.com
Connection: keep-alive
Cookie: <<Cookie header>> 

I Get the error:

Traceback (most recent call last):
  File "Setup.py", line 8, in <module>
    settings['youtube']['headers'] = api.setup()
  File "/home/mike/Documents/spotifyplaylist_to_ytmusic/settings.py", line 14, in __getitem__
    return config[key]
  File "/usr/lib/python3.8/configparser.py", line 960, in __getitem__
    raise KeyError(key)
KeyError: 'youtube'

So am i doing the copy-pasting wrong or ? If i copy 1 header it works fine, but if i try to copy paste them all i get the key error.

babutzc commented 3 years ago

Fixed it; I forgot to paste the [youtube] header.