godeezer / lib

Deezer API implementation in Go
ISC License
5 stars 3 forks source link

Validate Arl in NewClient #6

Open toniz4 opened 3 years ago

toniz4 commented 3 years ago

when passing a invalid arl to deezer.NewClient it returns no errors, maybe it should return one if the arl is invalid. Or there would be a better/faster way of handling that? example:

client, err := deezer.NewClient("123")
if err != nil {
    log.Fatal(err)
}

that returns no errors.

samhza commented 3 years ago

I'm not sure if all ARLs are a specific size, but it would be a good idea to check that it only includes a specific character set/is a specific length. It also might be possible for NewClient to make some sort of "test" request to check if the ARL is valid, though I'm not sure what that endpoint that request would hit.