What is a Media Item ID in Google Photos when Connecting to Raindrop?

This topic was automatically generated from Slack. You can find the original thread here.

Morning. Trying to connect Raindrop to Google Photos when I add a new image to a certain category it adds the image to my Google Photos album. I’m stuck at this step, confused by what a Media Item ID is. I’d expect more of a “file to upload” prompt.

It seems like I need to:
• Download the file to /tmp
• Upload the file to Google Photos
• Then add the uploaded media item via its ID to the gallery. Does that sound right? If so I’m having trouble with the download step.
Would someone know the right snippet to use to download steps.trigger.event.file.name ?

I did get the download step working with this:

import { pipeline } from "stream/promises";
import fs from "fs";
import got from "got";

export default defineComponent({
  async run({ steps, $ }) {
    try {
      await pipeline(
        got.stream(steps.trigger.event.link),
        fs.createWriteStream(`/tmp/filename.png`)
      );
    } catch (error) {
      console.error("Pipeline failed", error);
      throw error; // Rethrow the error to make sure Pipedream catches it and marks the step as failed.
    }
  },
});

and got a MediaItemID:

But passing this through to Google Photos to add to an album still throws an INVALID_ARGUMENT error :disappointed:

’s actually done some great tutorials on using Pipedream with Google Photos:

I believe one of the tricky parts is that you’ll have to first create the Google Photos album via Pipedream before you can upload photos

you’ll have to first create the Google Photos album via Pipedream
Ah ha!! That was the missing piece. My workflow is now working :slightly_smiling_face:

Thank you!

Woot :slightly_smiling_face:

I do keep running into this error sometimes. It does look like my NodeJS code is “promisified” so I’m not sure what’s up here:

The 403 seems to be the root cause right? Have you looked into that URL passed within the Inputs tab in the step?

Ah yes, that does seem to be the case.

Raindrop is annoying since depending on how you bookmark an image, sometimes it lives on Raindrop’s CDN and othertimes it lives on some other host

You could do a conditional check, and upload the image to the PD project’s File Store for quick hosting:

Then getting a public URL would be simple:

const url = await $.files.open('my-image.png').toUrl()

I think the problem in my case is Pipedream having the access to download the image so I can upload it to file-store. The only link Raindrop knows to give me for all images from, say, Midjourney is in this format: https://cdn.midjourney.com/79b83438-e6bb-4e13-b4bd-a43346db1cd7/0_0.webp and

wget https://cdn.midjourney.com/79b83438-e6bb-4e13-b4bd-a43346db1cd7/0_0.webp

always results in a 403

I think downloading images prior to uploading to Raindrop would work since it would force files to save to their CDN, but that’s an annoying extra step

Sorry, I’m not following exactly.

I can open the image in the browser, but you’re right, wget’ing the image via CLI results in a 403.

I’m not sure how the same image URL isn’t working with two different channels, because potentially the CDN blocking non-browser user agents.

Yeah, it must be something to that effect. I think I’ll just modify my workflow to “Download → Raindrop”. Not too bad since I can upload in batches. It works!

Nice, glad to hear you found a solution