Skip to content

Commit c91be18

Browse files
committed
feat: Add Spotify playlist import functionality
- Add spotify_client_id and spotify_client_secret config options - Implement spotify command to import playlists from Spotify to TIDAL - Add pagination support to fetch all tracks from large Spotify playlists - Show helpful configuration instructions if credentials missing - Add spotipy dependency for Spotify API access - Improve progress display with single progress bar for all downloads - Skip printing individual track progress messages during spotify download - Show summary of tracks found/not found on TIDAL The spotify command allows importing Spotify playlists by searching for matching tracks on TIDAL. Requires configuring Spotify API credentials: tidal-dl-ng cfg spotify_client_id YOUR_CLIENT_ID tidal-dl-ng cfg spotify_client_secret YOUR_CLIENT_SECRET Usage: tidal-dl-ng spotify "spotify-playlist-url" Signed-off-by: Harvey Lynden
1 parent ff96847 commit c91be18

File tree

4 files changed

+301
-29
lines changed

4 files changed

+301
-29
lines changed

README.md

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ $ tidal-dl-ng --help
2323
│ --help -h Show this message and exit. │
2424
╰──────────────────────────────────────────────────────────────────────────────╯
2525
╭─ Commands ───────────────────────────────────────────────────────────────────╮
26-
│ cfg Print or set an option. If no arguments are given, all options will │
27-
│ be listed. If only one argument is given, the value will be printed │
28-
for this option. To set a value for an option simply pass the value │
29-
│ as the second argument │
26+
│ cfg Print or set an option. If no arguments are given, all options will │
27+
be listed. If only one argument is given, the value will be printed │
28+
for this option. To set a value for an option simply pass the value │
29+
as the second argument │
3030
│ dl │
31-
│ dl_fav Download from a favorites collection. │
32-
│ gui │
31+
│ dl_fav Download from a favorites collection. │
32+
│ gui
3333
│ login │
3434
logout
35+
│ spotify Download tracks from a Spotify playlist, album, or track by │
36+
│ searching for them on TIDAL. │
3537
╰──────────────────────────────────────────────────────────────────────────────╯
3638
```
3739

@@ -69,7 +71,13 @@ tidal-dl-ng dl_fav albums
6971
tidal-dl-ng dl_fav videos
7072
```
7173

72-
You can also use the GUI:
74+
You can also import content from Spotify (see the Spotify Import section below for details):
75+
76+
```bash
77+
tidal-dl-ng spotify https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M
78+
```
79+
80+
And you can use the GUI:
7381

7482
```bash
7583
tidal-dl-ng-gui
@@ -85,6 +93,7 @@ If you like to have the GUI version only as a binary, have a look at the
8593
## 🧁 Features
8694

8795
- Download tracks, videos, albums, playlists, your favorites etc.
96+
- Import Spotify playlists, albums, and tracks with ISRC-based track matching
8897
- Multithreaded and multi-chunked downloads
8998
- Metadata for songs
9099
- Adjustable audio and video download quality.
@@ -93,6 +102,41 @@ If you like to have the GUI version only as a binary, have a look at the
93102
- Creates playlist files
94103
- Can symlink tracks instead of having several copies, if added to different playlist
95104

105+
## 🎵 Spotify Import
106+
107+
You can import playlists, albums, and individual tracks from Spotify and download them from TIDAL:
108+
109+
```bash
110+
# Import a playlist
111+
tidal-dl-ng spotify https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M
112+
# Import an album
113+
tidal-dl-ng spotify https://open.spotify.com/album/1DFixLWuPkv3KT3TnV35m3
114+
# Import a single track
115+
tidal-dl-ng spotify https://open.spotify.com/track/4cOdK2wGLETKBW3PvgPWqT
116+
```
117+
118+
### Setting up Spotify API access
119+
120+
To use the Spotify import feature, you need to set up Spotify API credentials:
121+
122+
1. Go to the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard/) and log in with your Spotify account
123+
2. Click "Create app"
124+
3. Fill in the required fields:
125+
- App name: (any name, e.g., "TIDAL Downloader")
126+
- App description: (any description)
127+
- Redirect URI: http://localhost:8888/callback (this is not actually used but required)
128+
- Select the appropriate checkboxes and click "Save"
129+
4. After creating the app, you'll see your Client ID on the dashboard
130+
5. Click "Show client secret" to reveal your Client Secret
131+
6. Configure these credentials in tidal-dl-ng:
132+
133+
```bash
134+
tidal-dl-ng cfg spotify_client_id YOUR_CLIENT_ID
135+
tidal-dl-ng cfg spotify_client_secret YOUR_CLIENT_SECRET
136+
```
137+
138+
Once configured, you can import content from Spotify. The import process first attempts to match tracks by ISRC (International Standard Recording Code) for exact matching between services, then falls back to text search if needed.
139+
96140
## ▶️ Getting started with development
97141

98142
### 🚰 Install dependencies

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ typer = "^0.15.1"
4343
tidalapi = "^0.8.3"
4444
python-ffmpeg = "^2.0.12"
4545
pycryptodome = "^3.21.0"
46+
spotipy = "^2.23.0"
4647

4748
[project.optional-dependencies]
4849
gui = ["pyside6", "pyqtdarktheme-fork"]

0 commit comments

Comments
 (0)