-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
268 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
# gotidal | ||
|
||
A Go library for interacting with the Tidal API. | ||
<p align="center" width="100%"> | ||
<img width="33%" src="assets/gotidal.png"> | ||
</p> | ||
|
||
A Go library for interacting with the TIDAL streaming service API. | ||
|
||
## Official Documentation | ||
|
||
<https://developer.tidal.com/> | ||
|
||
## Installation | ||
|
||
```bash | ||
go get -u github.com/tomjowitt/gotidal | ||
``` | ||
|
||
## Usage | ||
|
||
## Credits | ||
|
||
Logo created with Gopher Konstructor <https://github.com/quasilyte/gopherkon> based on original artwork | ||
by Renee French. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package gotidal | ||
|
||
type Album struct { | ||
Resource Resource `json:"resource"` | ||
ID string `json:"id"` | ||
Status int `json:"status"` | ||
Message string `json:"message"` | ||
} | ||
|
||
type Resource struct { | ||
ID string `json:"id"` | ||
BarcodeID string `json:"barcodeID"` | ||
Title string `json:"title"` | ||
Artists []Artist `json:"artists"` | ||
Duration int `json:"duration"` | ||
ReleaseDate string `json:"releaseDate"` | ||
ImageCover []Image `json:"imageCover"` | ||
VideoCover []Image `json:"videoCover"` | ||
NumberOfVolumes int `json:"numberOfVolumes"` | ||
NumberOfTracks int `json:"numberOfTracks"` | ||
NumberOfVideos int `json:"numberOfVideos"` | ||
Type string `json:"type"` | ||
Copyright string `json:"copyright"` | ||
MediaMetadata MediaMetaData `json:"mediaMetadata"` | ||
Properties Properties `json:"properties"` | ||
TidalURL string `json:"tidalUrl"` | ||
} | ||
|
||
type MediaMetaData struct { | ||
Tags []string `json:"tags"` | ||
} | ||
|
||
type Properties struct { | ||
Content []string `json:"content"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package gotidal | ||
|
||
type Artist struct { | ||
ID string `json:"id"` | ||
Name string `json:"name"` | ||
Picture []Image `json:"picture"` | ||
Main bool `json:"main"` | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,35 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"log" | ||
"os" | ||
|
||
"github.com/tomjowitt/gotidal" | ||
) | ||
|
||
func main() { | ||
clientId := os.Getenv("TIDAL_CLIENT_ID") | ||
ctx := context.Background() | ||
|
||
clientID := os.Getenv("TIDAL_CLIENT_ID") | ||
clientSecret := os.Getenv("TIDAL_CLIENT_SECRET") | ||
|
||
client, err := gotidal.NewClient(clientId, clientSecret) | ||
client, err := gotidal.NewClient(clientID, clientSecret) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
params := gotidal.SearchParams{ | ||
Query: "Black Flag", | ||
CountryCode: "AU", | ||
} | ||
|
||
results, err := client.Search(ctx, params) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
client.Search("searchQuery") | ||
for _, album := range results.Albums { | ||
log.Printf("%s - %s", album.Resource.Title, album.Resource.Artists[0].Name) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module github.com/tomjowitt/gotidal | ||
|
||
go 1.21.6 | ||
go 1.22.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package gotidal | ||
|
||
type Image struct { | ||
URL string `json:"url"` | ||
Width int `json:"width"` | ||
Height int `json:"height"` | ||
} |
Oops, something went wrong.