mirror of
https://github.com/c0de-archive/spotipy.git
synced 2024-11-05 07:27:47 +00:00
Merge pull request #139 from delucks/master
Swap use of subprocess.call for webbrowser.open in util.py
This commit is contained in:
commit
6b39372dca
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import os
|
import os
|
||||||
import subprocess
|
|
||||||
from . import oauth2
|
from . import oauth2
|
||||||
import spotipy
|
import spotipy
|
||||||
|
import webbrowser
|
||||||
|
|
||||||
def prompt_for_user_token(username, scope=None, client_id = None,
|
def prompt_for_user_token(username, scope=None, client_id = None,
|
||||||
client_secret = None, redirect_uri = None):
|
client_secret = None, redirect_uri = None):
|
||||||
@ -67,8 +67,8 @@ def prompt_for_user_token(username, scope=None, client_id = None,
|
|||||||
''')
|
''')
|
||||||
auth_url = sp_oauth.get_authorize_url()
|
auth_url = sp_oauth.get_authorize_url()
|
||||||
try:
|
try:
|
||||||
subprocess.call(["open", auth_url])
|
webbrowser.open(auth_url)
|
||||||
print("Opening %s in your browser" % auth_url)
|
print("Opened %s in your browser" % auth_url)
|
||||||
except:
|
except:
|
||||||
print("Please navigate here: %s" % auth_url)
|
print("Please navigate here: %s" % auth_url)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user