sigma67 / ytmusicapi

Unofficial API for YouTube Music
https://ytmusicapi.readthedocs.io
MIT License
1.71k stars 194 forks source link

Can't start YTMusic instance with an auth argument #536

Closed ashish-yadav11 closed 8 months ago

ashish-yadav11 commented 8 months ago

Describe the bug I can't launch YTMusic instance by say: ytmusic = YTMusic(oauthfile). It gives the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.11/site-packages/ytmusicapi/ytmusic.py", line 138, in __init__
    self._token = RefreshingToken(
                  ^^^^^^^^^^^^^^^^
TypeError: RefreshingToken.__init__() got an unexpected keyword argument 'filepath'

This error started coming in after the update to version 1.4.

To Reproduce Steps to reproduce the behavior:

  1. Launch python.
  2. Run:
    from ytmusicapi import YTMusic
    oauthfile = 'path to oauth file'
    ytmusic = YTMusic(auth=oauthfile)
  3. See error.

Additional context It works fine without the auth argument.

ashish-yadav11 commented 8 months ago

nevermind, I guess the format was changed, got it fixed, just had to remove filepath from the dict (or just rerun ytmusicapi auth)!