Sprijin Bază de date filme (The Movie Database)

Hi TMDB,

I'm having some issues with connecting my Discord bot to the TMDB API. It connects and runs as intended whenever I'm running the bot locally but I'm trying to host it on Cybrancee and API connection keeps getting refused and coming back with the following error:

code: 'ECONNREFUSED',

errors: [ Error: connect ECONNREFUSED ::1:443

    at createConnectionError (node:net:1634:14)

    at afterConnectMultiple (node:net:1664:40) {

  errno: -111,

  code: 'ECONNREFUSED',

  syscall: 'connect',

  address: '::1',

  port: 443

I raised a query with Cybrancee but was told that this is a connection problem at your end. Any idea why the connection is being blocked? Thanks!

3 răspunsuri (pe pagina 1 din 1)

Jump to last post

Hi @pepper_head, the address "::1" is the ipv6 local loopback address. Somewhere in your code you are trying to connect to the local system for some reason, and it is not configured properly on the hosting service you are using.

Hi robbie3999, thanks for getting back to me.

This is the code that is connecting to the API:

try {

    const response = await axios.get('https://api.themoviedb.org/3/authentication', {

        headers: {

            'accept': 'application/json',

            'Authorization': `Bearer ${process.env.TMDB_API_TOKEN}`

        }

    });



    console.log('API connection successful');

    console.log('TMDB API response:', response.data);



} catch (error) {

    console.error('API connection failed:', error);

}

});

I haven't configured anything in the code to specifically connect to the local system.

Well, I'm just reading what the error information shows, its clearly calling out an address and port. Keep in mind that the error may not be coming from the try/catch code you listed. Perhaps someone else will come along and have more ideas.

Nu găsiți un film sau un serial? Autentificați-vă pentru a-l crea.

Globale

s focalizează bara de căutare
p deschide meniul profilului
esc închide o fereastră deschisă
? deschide fereastra cu scurtături de la tastatură

Pe paginile media

b mergi înapoi (sau la părinte atunci când este cazul)
e mergi la pagina de editare

Pe paginile sezoanelor filmelor seriale

(săgeată dreapta) mergi la sezonul următor
(săgeată stânga) mergi la sezonul precedent

Pe paginile episoadelor filmelor seriale

(săgeată dreapta) mergi la episodul următor
(săgeată stânga) mergi la episodul precedent

Pe toate paginile de imagini

a deschide fereastra pentru adăugarea de imagini

Pe toate paginile de editare

t deschide selectorul de traduceri
ctrl+ s trimite formularul

Pe paginile de discuții

n crează o discuție nouă
w comută starea de vizionare
p comută publică/privată
c comută închisă/deschisă
a deschide activitatea
r răspunde la discuție
l mergi la ultimul răspuns
ctrl+ enter trimite mesajul
(săgeată dreapta) pagina următoare
(săgeată stânga) pagina precedentă

Setări

Doriți să evaluați sau să adăugați acest articol într-o listă?

Autentificare