Skip to content

Commit 7385f1c

Browse files
committed
better filenames, less installation steps and binary
1 parent cf8eaa7 commit 7385f1c

6 files changed

Lines changed: 42 additions & 17 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ config.cfg
33
playlists/
44
Pipfile
55
Pipfile.lock
6+
dist/
7+
build/
8+
*.spec

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# exportify-cli
2-
![](exportify.png?raw=true "exportify-cli") \
2+
![](image.png?raw=true "exportify-cli") \
33
Export Spotify playlists to CSV directly from the terminal, inspired by [pavelkomarov/exportify](https://github.com/pavelkomarov/exportify).
44

55
This tool can export all saved playlists, including liked songs.
66

77
## Installation:
8+
**If you use Windows, you can use the binary in [releases](https://github.com/donmerendolo/exportify-cli/releases/latest) and skip steps 1 and 2.**
89
1. **Clone this repository:**
910
```bash
1011
$ git clone https://github.com/donmerendolo/exportify-cli.git
@@ -17,18 +18,17 @@ $ pip install -r requirements.txt
1718
```
1819
(recommended to use a virtual environment)
1920

20-
3. **Create an app on Spotify Developer Dashboard:**
21-
- Go to [Spotify Developer Dashboard](https://developer.spotify.com/dashboard).
22-
- Set a name and description for your app.
23-
- In the "Redirect URIs" field, use: `http://localhost:3000/callback` (for example).
21+
3. **Set up Client ID, Client Secret and Redirect URI:**
2422

25-
4. **Configure your credentials:**
26-
- Replace `CLIENT_ID`, `CLIENT_SECRET`, and `REDIRECT_URI` in the `config.cfg.RENAME` file.
27-
- These values can be found in the "Settings" section of your app on the Spotify Developer Dashboard.
28-
29-
6. **Rename `config.cfg.RENAME` to `config.cfg`**
23+
The first time you run exportify-cli, it will guide you through the setup:
24+
```
25+
1. Go to Spotify Developer Dashboard (https://developer.spotify.com/dashboard).
26+
2. Create a new app.
27+
3. Set a name and description for your app.
28+
4. Add a redirect URI (e.g. http://localhost:8080).
29+
```
3030

31-
After running `python exportify.py` the first time, it should keep you authenticated so you don't have to log in each time. If you wish to log out, simply remove the `.cache` file.
31+
After running `python exportify-cli.py` or `exportify-cli.exe` the first time, it should keep you authenticated so you don't have to log in each time. If you wish to log out, simply remove the `.cache` file.
3232

3333
---
3434

config.cfg.RENAME

Lines changed: 0 additions & 4 deletions
This file was deleted.

exportify.py renamed to exportify-cli.py

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,29 @@
1212
# Load configuration from config.cfg
1313
config = configparser.ConfigParser()
1414
config.read('config.cfg')
15+
if not os.path.exists('config.cfg'):
16+
print("""config.cfg not found. Let's create it.
17+
18+
1. Go to Spotify Developer Dashboard (https://developer.spotify.com/dashboard).
19+
2. Create a new app.
20+
3. Set a name and description for your app.
21+
4. Add a redirect URI (e.g. http://localhost:8080).
22+
23+
Now after creating the app, press the Settings button on the upper right corner.
24+
Copy the Client ID, Client Secret and Redirect URI and paste them below.
25+
""")
26+
client_id = input("Client ID: ")
27+
client_secret = input("Client Secret: ")
28+
redirect_uri = input("Redirect URI: ")
29+
30+
config['spotify'] = {
31+
'client_id': client_id,
32+
'client_secret': client_secret,
33+
'redirect_uri': redirect_uri
34+
}
35+
36+
with open('config.cfg', 'w') as configfile:
37+
config.write(configfile)
1538

1639
client_id = config.get('spotify', 'client_id')
1740
client_secret = config.get('spotify', 'client_secret')
@@ -160,9 +183,12 @@ def main():
160183
parser.add_argument('-l', '--list', action='store_true', help="List all playlists")
161184

162185
args = parser.parse_args()
163-
186+
164187
output_dir = args.output
165-
188+
189+
# This line opens the Spotify authorization page in the browser
190+
sp.current_user()
191+
166192
if args.list:
167193
list_playlists()
168194
elif args.all:

exportify.png

-18.5 KB
Binary file not shown.

image.png

19.9 KB
Loading

0 commit comments

Comments
 (0)