I get an HTML response instead of JSON

Hi, I need to temporarily store a video. and get the URL from them. In order to combine several videos into one whole via ffmpeg. I found a service - https://tmpfiles.org /. But I only get an HTML response through the API. It works for other users, I don’t understand what’s wrong with me.

{
“nodes”: [
{
“parameters”: {
“method”: “POST”,
“url”: “https://tmpfiles.org/api/v1/upload”,
“sendBody”: true,
“contentType”: “multipart-form-data”,
“bodyParameters”: {
“parameters”: [
{
“parameterType”: “formBinaryData”,
“name”: “file”,
“inputDataFieldName”: “data”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
4000,
-1760
],
“id”: “e7dc99ba-7d2b-427f-bdd0-42fc106d4b84”,
“name”: “HTTP Request7”
}
],
“connections”: {},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “130995e3c555b924e109be581cebc85ec4d5ab45eb1cf62d2fae37c289053604”
}
}

1 Like

Hi @seddinnnss

That looks like a nice service,

After testing it, here is how it works:

1- You upload the file, then you get a link:

2- This link is not for a direct download, As you can see it redirects to an HTML page, and the actual download URL is inside this HTML:

3- You have to extract this link from the HTML, for example:

{{ $json.data.match(/href="(http:\/\/tmpfiles\.org\/dl\/[^"]+)"/)[1] }}

Or you can just add /dl/ to the link you get from first step.

Choose what suits you better, Here is the workflow as a guide:

Hi, I don’t know why, but after a while I started throwing videos, I don’t know what it’s related to, I didn’t really change anything. But okay.

An off-topic question arose, after generating the videos, I save them through the service, and throw the link to the user through the telegram bot, and from below there are 2 inline buttons, “Generate for”, “Publish”.

There was such a problem, as far as I understood, the trigger for the bot’s callback should be in a separate wkrkflow, and always be running, the question is How do I make sure that I accept the callback in workflow number 2 and generate it in workflow number 1. It’s not very convenient and it’s not clear how the callback will behave, as far as I understand, it works every time a callback arrives, and if I clicked on the old inline buttons? Do I have to manually run workflow number 2?