Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions spotify2tidal/tidal.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
import requests
import tidalapi
import webbrowser


class Tidal:
Expand Down Expand Up @@ -169,17 +170,15 @@ def _create_playlist(self, playlist_name, delete_existing=False):
return r.json()["uuid"]

def _connect(self, username, password):
"""Connect to tidal and return a session object.

Parameters
----------
username: str
Tidal username
password: str
Tidal password
"""
"""Connect to tidal and return a session object."""
tidal_session = tidalapi.Session()
tidal_session.login(username, password)
login, future = tidal_session.login_oauth()
print('Login with the webbrowser: ' + login.verification_uri_complete)
url = login.verification_uri_complete
if not url.startswith('https://'):
url = 'https://' + url
webbrowser.open(url)
future.result()
return tidal_session

def _delete_playlist(self, playlist_id):
Expand Down