junhoyeo / threads-api

Unofficial, Reverse-Engineered Node.js/TypeScript client for Meta's Threads. Web UI Included.
https://threads.junho.io
MIT License
1.59k stars 134 forks source link

Request failed with status code 404 (configure_text_only_post) #144

Open Ferenus opened 1 year ago

Ferenus commented 1 year ago

in version 1.4.1 after running publish function:

{"errorType":"TypeError","errorMessage":"(intermediate value)(intermediate value).replaceAll is not a function","stack":["TypeError: (intermediate value)(intermediate value).replaceAll is not a function"," at /var/task/index.js:14465:67"," at /var/task/index.js:14383:25"," at Object.next (/var/task/index.js:14392:12)"," at a (/var/task/index.js:14300:24)"," at i2 (/var/task/index.js:14313:13)"," at processTicksAndRejections (internal/process/task_queues.js:95:5)"]} {"errorType":"TypeError","errorMessage":"(intermediate value)(intermediate value).replaceAll is not a function","trace":["TypeError: (intermediate value)(intermediate value).replaceAll is not a function"," at /var/task/index.js:14465:67"," at /var/task/index.js:14383:25"," at Object.next (/var/task/index.js:14392:12)"," at a (/var/task/index.js:14300:24)"," at i2 (/var/task/index.js:14313:13)"," at processTicksAndRejections (internal/process/task_queues.js:95:5)"]}

AnthonyASanchez commented 1 year ago

That is stemming from your version of node, you will have to update your version so the replaceAll function is supported

junhoyeo commented 1 year ago

I'll try to lower the minimal required node version someday...

Ferenus commented 1 year ago

You were right. After upgrading to node 16 now I have a different error:

{"message":"Request failed with status code 404","name":"AxiosError","stack":"AxiosError: Request failed with status code 404\n at settle (/var/task/index.js:11843:16)\n at IncomingMessage.handleStreamEnd (/var/task/index.js:12639:15)\n at IncomingMessage.emit (node:events:525:35)\n at endReadableNT (node:internal/streams/readable:1358:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":60000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{"Blob":null},"headers":{"Accept":"application/json, text/plain, /","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8","User-Agent":"Barcelona 291.0.0.31.111 Android","Authorization":"Bearer IGT:2:eyJkc191c2VyX2lkIjoiNjAwNDQ3NDEwNDIiLCJzZXNzaW9uaWQiOiI2MDA0NDc0MTA0MiUzQU9iWGFINW5ZVzZWa1ZVJTNBNSUzQUFZZThQb04wdlNUMmZxeGllMFRYZk9QaGMweU5tdDdwSkpSNFpxWmNfUSJ9","Content-Length":"387","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"https://i.instagram.com/api/v1/media/configure_text_only_post/","data":"signed_body=SIGNATURE.%7B%22text_post_app_info%22%3A%7B%22reply_control%22%3A0%2C%22reply_id%22%3A%223146508123133373634%22%7D%2C%22timezone_offset%22%3A%220%22%2C%22source_type%22%3A%224%22%2C%22_uid%22%3A%2260044741042%22%2C%22device_id%22%3A%22android-1ie0btgxhvfk0000%22%2C%22caption%22%3A%22%F0%9F%92%99%22%2C%22upload_id%22%3A1689318462536%2C%22publish_mode%22%3A%22text_post%22%7D"},"code":"ERR_BAD_REQUEST","status":404}

threadsAPI.getThreads() works fine for the same post id, so I'm assuming that post id is correct and exists.