Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d90c5bac41 | ||
|
|
e62a8a80cb | ||
|
|
a5afd975f0 | ||
|
|
03e0396ac0 |
@@ -2,7 +2,7 @@ spotify:
|
|||||||
client_id: your_client_id
|
client_id: your_client_id
|
||||||
client_secret: your_client_secret
|
client_secret: your_client_secret
|
||||||
username: your_spotify_username
|
username: your_spotify_username
|
||||||
redirect_uri: http://localhost:8888/callback
|
redirect_uri: http://127.0.0.1:8888/callback
|
||||||
open_browser: True # Set to False if using a headless server environment
|
open_browser: True # Set to False if using a headless server environment
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ requires-python = ">= 3.10"
|
|||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"spotipy~=2.24.0",
|
"spotipy~=2.24.0",
|
||||||
"tidalapi==0.7.6",
|
"tidalapi==0.8.8",
|
||||||
"pyyaml~=6.0",
|
"pyyaml~=6.0",
|
||||||
"tqdm~=4.64",
|
"tqdm~=4.64",
|
||||||
"sqlalchemy~=2.0",
|
"sqlalchemy~=2.0",
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ Setup
|
|||||||
Usage
|
Usage
|
||||||
----
|
----
|
||||||
To synchronize all of your Spotify playlists with your Tidal account run the following from the project root directory
|
To synchronize all of your Spotify playlists with your Tidal account run the following from the project root directory
|
||||||
|
Windows ignores python module paths by default, but you can run them using `python3 -m spotify_to_tidal`
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
spotify_to_tidal
|
spotify_to_tidal
|
||||||
|
|||||||
@@ -184,7 +184,11 @@ async def get_tracks_from_spotify_playlist(spotify_session: spotipy.Spotify, spo
|
|||||||
print(f"Loading tracks from Spotify playlist '{spotify_playlist['name']}'")
|
print(f"Loading tracks from Spotify playlist '{spotify_playlist['name']}'")
|
||||||
items = await repeat_on_request_error( _fetch_all_from_spotify_in_chunks, lambda offset: _get_tracks_from_spotify_playlist(offset=offset, playlist_id=spotify_playlist["id"]))
|
items = await repeat_on_request_error( _fetch_all_from_spotify_in_chunks, lambda offset: _get_tracks_from_spotify_playlist(offset=offset, playlist_id=spotify_playlist["id"]))
|
||||||
track_filter = lambda item: item.get('type', 'track') == 'track' # type may be 'episode' also
|
track_filter = lambda item: item.get('type', 'track') == 'track' # type may be 'episode' also
|
||||||
sanity_filter = lambda item: 'album' in item and 'name' in item['album'] and 'artists' in item['album'] and len(item['album']['artists']) > 0
|
sanity_filter = lambda item: ('album' in item
|
||||||
|
and 'name' in item['album']
|
||||||
|
and 'artists' in item['album']
|
||||||
|
and len(item['album']['artists']) > 0
|
||||||
|
and item['album']['artists'][0]['name'] is not None)
|
||||||
return list(filter(sanity_filter, filter(track_filter, items)))
|
return list(filter(sanity_filter, filter(track_filter, items)))
|
||||||
|
|
||||||
def populate_track_match_cache(spotify_tracks_: Sequence[t_spotify.SpotifyTrack], tidal_tracks_: Sequence[tidalapi.Track]):
|
def populate_track_match_cache(spotify_tracks_: Sequence[t_spotify.SpotifyTrack], tidal_tracks_: Sequence[tidalapi.Track]):
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ def test_open_spotify_session(mocker):
|
|||||||
"username": "test_user",
|
"username": "test_user",
|
||||||
"client_id": "test_client_id",
|
"client_id": "test_client_id",
|
||||||
"client_secret": "test_client_secret",
|
"client_secret": "test_client_secret",
|
||||||
"redirect_uri": "http://localhost/",
|
"redirect_uri": "http://127.0.0.1/",
|
||||||
"open_browser": True,
|
"open_browser": True,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ def test_open_spotify_session(mocker):
|
|||||||
scope=SPOTIFY_SCOPES,
|
scope=SPOTIFY_SCOPES,
|
||||||
client_id="test_client_id",
|
client_id="test_client_id",
|
||||||
client_secret="test_client_secret",
|
client_secret="test_client_secret",
|
||||||
redirect_uri="http://localhost/",
|
redirect_uri="http://127.0.0.1/",
|
||||||
requests_timeout=2,
|
requests_timeout=2,
|
||||||
open_browser=True,
|
open_browser=True,
|
||||||
)
|
)
|
||||||
@@ -64,7 +64,7 @@ def test_open_spotify_session_oauth_error(mocker):
|
|||||||
"username": "test_user",
|
"username": "test_user",
|
||||||
"client_id": "test_client_id",
|
"client_id": "test_client_id",
|
||||||
"client_secret": "test_client_secret",
|
"client_secret": "test_client_secret",
|
||||||
"redirect_uri": "http://localhost/",
|
"redirect_uri": "http://127.0.0.1/",
|
||||||
}
|
}
|
||||||
|
|
||||||
# Mock sys.exit to prevent the test from exiting
|
# Mock sys.exit to prevent the test from exiting
|
||||||
|
|||||||
Reference in New Issue
Block a user