Download videos from URLs in Google Sheets to Google Drive

What a great piece of software and community. I am so impressed by n8n and have been consuming any information I can since I found it. However I’m stuck. I know just enough myself in trouble. Thank you in advance.

Describe the issue/error/question

Cannot download these videos to google drive.

I am trying download the videos from the urls and send them to my google drive. I have tried two scenarios.

#1 When I try to go directly from ‘sheets’ to ‘drive’ it just uploads Google doc files with the link as the text. I know that this isn’t the right way but this does get me some movement between the two and will accept an expression without giving me an error.

#2 I believe this is the right way but cannot get this to work either. It never gets past the HTTP stage I get the error “execution process crashed for unknown reason” However, if I just put the plain url in the URL input, instead of the expression it will download the video and put it on drive… But I want to download all the videos on the sheet. I’m a little confuse… I think I might need to use a move binary but I can’t get that working either… Thank you for any help…

What is the error message (if any)?

Problem Executing Workflow Workflow execution process did crash for an unknown reason

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 0.216.1
  • Database you’re using (default: SQLite): Default
  • Running n8n with the execution process [own(default), main]: I don’t know.
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]:`Docker

Hi @wtheory,

Welcome to the community :raised_hands:

The second approach is the correct method so you would download the data first so that you can upload it, The crash though I am not sure why that is happening but it could be related to the memory available to the container. If you check the docker logs does it show anything?

Hi Jon, thanks for your help. That’s what I thought. I was just so frustrated that I thought it was correct and it still wasn’t working. I think the problem is in my links. I have shortened them to have nothing past the first “/” and it seems to be processing them now. I thought about the memory issue too and adjusted it. I really appreciate you jumping in so quickly thank you.

1 Like

UPDATE

So it was in fact my links and the way I was processing them. I was initially sending formatting them in google sheets and using the new row trigger to send them to HTTP and then Google Drive. It was un reliable and not working very well after about 5 videos. I was able to use the code module and JavaScript (Run once for each item) to automatically strip all the junk from my links and send them directly to a HTTP module and then on to Google Drive… Its working quickly and consistently for 71+ videos. Its exactly what I was hoping for. What an awesome tool!!

// Define the removeQueryString function
function removeQueryString(url) {
  var index = url.indexOf("?");
  if (index !== -1) {
    return url.substring(0, index);
  }
  return url;
}

// Get the original URL from the input data
var originalUrl = $json.data.hdplay;

// Call the removeQueryString function to strip the URL
var strippedUrl = removeQueryString(originalUrl);

// Output the stripped URL as an output of this node
return { json: { strippedUrl: strippedUrl } };
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.