Skip to content

Commit

Permalink
spotify integration works tested
Browse files Browse the repository at this point in the history
  • Loading branch information
raleighlittles committed Nov 26, 2024
1 parent 1c676dd commit c5245ba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions spotify_integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ After running the iTunesDB parser application on an iTunesDB file, you end up wi

If you want to use this tool with your _own_ CSV files, see `test.csv` for an example of the format.

## Usage info
## Code usage

Install dependencies

```bash
$ pip install requirements.txt
```

```
usage: spotify_integration.py [-h] -f CSV_FILE [-t TRACK_COLUMN] -a API_CREDENTIALS_FILE
Expand All @@ -27,7 +33,9 @@ options:
# API instructions

See `spotify_api_credentials.json` for example of format
Both are 32-character alphanumeric values

Both client_id and client_secret are 32-character alphanumeric values

See: https://developer.spotify.com/documentation/web-api/concepts/apps
for instructions on how to generate!

Expand Down
4 changes: 2 additions & 2 deletions spotify_integration/spotify_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ def create_playlist_from_tracks(spotify_tracks: list, playlist_name: str, playli
spotify_tracks_and_track_ids = get_track_ids_from_csv(
argparse_args.csv_file, api_obj)

playlist_description = f"Playlist created on {
datetime.datetime.now().isoformat()} \n Created by {socket.gethostname()}"
# Cannot have newline in playlist description
playlist_description = f"Playlist created on {datetime.datetime.now().isoformat()} Created by {socket.gethostname()}"

new_playlist_id = create_playlist_from_tracks(
spotify_tracks_and_track_ids, "Test Playlist", playlist_description, api_obj)
Expand Down

0 comments on commit c5245ba

Please sign in to comment.