imputnet / cobalt

best way to save what you love
https://cobalt.tools
GNU Affero General Public License v3.0
17.58k stars 1.45k forks source link

Provide a sane configuration to avoid fetch fail #966

Closed j1cs closed 1 day ago

j1cs commented 3 days ago

problem description

Dear Developers,

I am encountering an issue with my self-hosted instance where I consistently receive the error error.api.fetch.fail when trying to get content from Instagram and X.com. My instance is not exposed to the internet, and I have configured the cookies properly. However, I still receive a 400 error from the API with the message error.api.fetch.fail.

Could you please provide a recommended configuration (including the proper setup of cookies) to resolve this error for Instagram and X.com? Any guidance or sample configuration would be greatly appreciated.

Additionally, when attempting to create an issue, I noticed the following message:

Discord Community

Ask questions and discuss Cobalt with others at any time. Usually faster responses as more people are there to help.

However, upon joining the Discord server, I couldn't find any channels dedicated to questions or support. Could you clarify if there is a support channel available? If not, it might be helpful to update the guidance to reflect the current support options.

Thank you for your assistance.

your instance configuration

service:
  cobalt:
    image: ghcr.io/imputnet/cobalt:10.4.1-47804f4
    init: true
    read_only: true
    restart: unless-stopped
    ports:
      - 9015:9015
    volumes:
      - ./cobalt/cookies.json:/app/cookies.json
    environment:
      - COOKIE_PATH=/app/cookies.json
      - API_URL=http://localhost:9015/
      - API_PORT=9015
wukko commented 3 days ago

I am encountering an issue with my self-hosted instance where I consistently receive the error error.api.fetch.fail when trying to get content from Instagram and X.com.

do absolutely all links not work? even those from our tests? does cobalt log a message saying that cookies were loaded? do other services work?

However, upon joining the Discord server, I couldn't find any channels dedicated to questions or support

read the #hey channel

wukko commented 3 days ago

also: please don't use a llm to talk to people. it's disrespectful.

j1cs commented 2 days ago

However, upon joining the Discord server, I couldn't find any channels dedicated to questions or support

read the #hey channel

duh. i'm a moron

also: please don't use a llm to talk to people. it's disrespectful.

i wanted to be very clear. english ain't my native language but ok will never use it again.

Answering your questions:

I am encountering an issue with my self-hosted instance where I consistently receive the error error.api.fetch.fail when trying to get content from Instagram and X.com.

do absolutely all links not work? even those from our tests? does cobalt log a message saying that cookies were loaded? do other services work?

1.- pretty much with all links. works only few times. 2.- i didn't try the test. now i'm going to and see. 2.- yes. it shows a message saying that cookies were loaded correctly.

j1cs commented 2 days ago

OK this is what i found: after made a POST

{
  "url": "https://www.instagram.com/p/DCpeVbKSBXR"
}

which ends here: https://github.com/imputnet/cobalt/blob/main/api/src/processing/services/instagram.js#L291 with data as undefined and the cookie is being delivered: image

POST:

{
  "url": "https://x.com/OldInternetFeel/status/1861881374820421849"
}

in the case of x.com ends: https://github.com/imputnet/cobalt/blob/main/api/src/processing/services/twitter.js#L118 then here https://github.com/imputnet/cobalt/blob/main/api/src/processing/match.js#L299 this is because cookie isn't being provide the first time and the the status code got 404 image

thank for answering

hextor1 commented 2 days ago

@j1cs Hello Use proxy it will be solve

j1cs commented 1 day ago

i just realized that my cookies had changed for some reason. i got the new ones from my browser and now everything seems to work. but i think the twitter part has false positives, some messages get the speed limit. then i should try again using the cookie. i will open PR if you guys find it ok.

hextor1 commented 1 day ago

but i think the twitter part has false positives, some messages get

are you using cookies for youtube?