diff --git a/mopidy_ytmusic/command.py b/mopidy_ytmusic/command.py index 757c37a..e767cd5 100644 --- a/mopidy_ytmusic/command.py +++ b/mopidy_ytmusic/command.py @@ -17,27 +17,20 @@ class SetupCommand(commands.Command): help = "Generate auth.json" def run(self, args, config): - from ytmusicapi import YTMusic + from ytmusicapi.setup import setup_oauth filepath = input( "Enter the path where you want to save auth.json [default=current dir]: " ) if not filepath: filepath = os.getcwd() - path = Path(filepath + "/auth.json") + path = Path(filepath + "/oauth.json") print('Using "' + str(path) + '"') if path.exists(): print("File already exists!") return 1 - print( - "Open Youtube Music, open developer tools (F12), go to Network tab," - ) - print( - 'right click on a POST request and choose "Copy request headers".' - ) - print("Then paste (CTRL+SHIFT+V) them here and press CTRL+D.") try: - print(YTMusic(filepath=str(path))) + setup_oauth(filepath=str(path)) except Exception: logger.exception("YTMusic setup failed") return 1 diff --git a/setup.py b/setup.py index 4dce818..2c75924 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ install_requires = [ "Mopidy>=3,<4", - "pytube>=12.1.0,<13.0.0", + "pytube>=12.1.0", "ytmusicapi>=0.22.0,<2.0.0", ]