Skip to content

Commit

Permalink
Update the authentication according to library update
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcdo29 committed Apr 15, 2023
1 parent b1e6cb8 commit e075007
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mopidy_ytmusic/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SetupCommand(commands.Command):
help = "Generate auth.json"

def run(self, args, config):
from ytmusicapi.ytmusic import YTMusic
from ytmusicapi import setup

filepath = input(
"Enter the path where you want to save auth.json [default=current dir]: "
Expand All @@ -37,7 +37,7 @@ def run(self, args, config):
)
print("Then paste (CTRL+SHIFT+V) them here and press CTRL+D.")
try:
print(YTMusic.setup(filepath=str(path)))
print(setup(filepath=str(path)))
except Exception:
logger.exception("YTMusic setup failed")
return 1
Expand All @@ -54,7 +54,7 @@ class ReSetupCommand(commands.Command):
help = "Regenerate auth.json"

def run(self, args, config):
from ytmusicapi.ytmusic import YTMusic
from ytmusicapi import setup

path = config["ytmusic"]["auth_json"]
if not path:
Expand All @@ -69,7 +69,7 @@ def run(self, args, config):
)
print("Then paste (CTRL+SHIFT+V) them here and press CTRL+D.")
try:
print(YTMusic.setup(filepath=str(path)))
print(setup(filepath=str(path)))
except Exception:
logger.exception("YTMusic setup failed")
return 1
Expand Down

0 comments on commit e075007

Please sign in to comment.