Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 response on each request for method getStationByUrl #109

Open
lorenzovianello-vivaldigroup opened this issue Sep 14, 2022 · 4 comments

Comments

@lorenzovianello-vivaldigroup
Copy link

lorenzovianello-vivaldigroup commented Sep 14, 2022

Hi,
I'm using the package with mpc in linux, and i'm trying to fetch webradio's favicon with the following code

///url is the field urlResolved of Station
async function getFaviconFromPlayback(url:string):Promise<string>{
    api = new RadioBrowserApi("generic-api", true)
    return await api.getStationByUrl(url).then((stations)=>{
        if(stations.length>0){
            return stations[0].favicon
        }else{
            return ""
        }
    }).catch(e => {
        console.error(e)
        return ""
    })
}

After each call its return the same error

Sep 14 15:11:16 PIETRO node[16014]: Response {
Sep 14 15:11:16 PIETRO node[16014]:   size: 0,
Sep 14 15:11:16 PIETRO node[16014]:   timeout: 0,
Sep 14 15:11:16 PIETRO node[16014]:   [Symbol(Body internals)]: {
Sep 14 15:11:16 PIETRO node[16014]:     body: PassThrough {
Sep 14 15:11:16 PIETRO node[16014]:       _readableState: [ReadableState],
Sep 14 15:11:16 PIETRO node[16014]:       _events: [Object: null prototype],
Sep 14 15:11:16 PIETRO node[16014]:       _eventsCount: 2,
Sep 14 15:11:16 PIETRO node[16014]:       _maxListeners: undefined,
Sep 14 15:11:16 PIETRO node[16014]:       _writableState: [WritableState],
Sep 14 15:11:16 PIETRO node[16014]:       allowHalfOpen: true,
Sep 14 15:11:16 PIETRO node[16014]:       [Symbol(kCapture)]: false,
Sep 14 15:11:16 PIETRO node[16014]:       [Symbol(kCallback)]: null
Sep 14 15:11:16 PIETRO node[16014]:     },
Sep 14 15:11:16 PIETRO node[16014]:     disturbed: false,
Sep 14 15:11:16 PIETRO node[16014]:     error: null
Sep 14 15:11:16 PIETRO node[16014]:   },
Sep 14 15:11:16 PIETRO node[16014]:   [Symbol(Response internals)]: {
Sep 14 15:11:16 PIETRO node[16014]:     url: 'https://de1.api.radio-browser.info/json/stations/byurl/http://149.13.0.81/bgestrada',
Sep 14 15:11:16 PIETRO node[16014]:     status: 404,
Sep 14 15:11:16 PIETRO node[16014]:     statusText: 'Not Found',
Sep 14 15:11:16 PIETRO node[16014]:     headers: Headers { [Symbol(map)]: [Object: null prototype] },
Sep 14 15:11:16 PIETRO node[16014]:     counter: 0
Sep 14 15:11:16 PIETRO node[16014]:   }
Sep 14 15:11:16 PIETRO node[16014]: }

The error persists even if using different urls of WORKING radios

Any idea about?

@ivandotv
Copy link
Owner

@svedue Would you like to submit a PR?

@svedue
Copy link
Contributor

svedue commented Mar 29, 2024

@svedue Would you like to submit a PR?

sure. Just lacking permissions. Fixed it in fork over here: https://github.com/svedue/radio-browser-api

@ivandotv
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants