Collecting all Library Names and Videos from Bunny.net Stream, adding to Google Sheets

Describe the problem/error/question

Hello,

I’m having an issue creating a workflow that will extract the library and video data from my Bunny.net account.

The Bunny.net API documentation is here: List Videos

The issue I’m having is that each library has its own Api Key (AccessKey) and with that I need to loop through each page of returned results and execute the request until all data is retrieved. (See “Get All Videos Test” node)

I can’t figure out a good way to pass the Library ID and Api Key beyond the first iteration.

Or, maybe there is a better way I can approach this. I’ve spent many hours trying various approaches, but can’t figure this one out!

What is the error message (if any)?

The error with the node, “Get All Videos Test” is the below. It’s complaining about the zLibraryid. I’ve also tried to use the input json.Id (which would alleviate me from using the Set node to set the zLibraryId, zLibraryApiKey which are just some temporary parameters that I set so I can use them in some subsequent nodes), but that won’t work either.

Error:

The resource you are requesting could not be found [item 0]

https://video.bunnycdn.com/library/{{ $json.zLibraryId }}/videos?orderBy=date&page={{ $runIndex + 1 }}

Share the output returned by the last node

Note that each video library contains the libraryId and Api Key (AccessKey) that is then used in the “Get All Videos Test” node.

For the node “Get All Videos Test”, it loops through the first iteration correctly, but then the second iteration I can’t figure out how to pass in the libraryId and Api Key (AccessKey).

Information on your n8n setup

  • n8n version: 1.41.1
  • Database (default: SQLite): sqlite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Manual
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu

Thank you for the help!!!

I can’t paste my n8n workflow code since it’s past the number of allowed characters.

Here is a link to the n8n code: SHARED-TEMP-Videos Spreadsheet (Master): Update Bunny Videos

Screenshot/Image:

Hi @chicagogregg, good to have you back in the forum!
The error The resource you are requesting could not be found [item 0] seems to indicate that there’s nothing to iterate over. The http node should iterate over incoming items unless you need to handle pagination. You can find how to handle pagination here. Otherwise, could you maybe try this without using the looping logic?

Hey there @aya , thanks for the reply and information.

The funny thing is, is THAT is what I was originally trying to do! (with the approach you posted).

However, for some reason it STOPS at 420 rows returned and does not proceed further. It doesn’t matter which library I have listed first (hence one reason why I added the Sort node), it always returns 420 rows. In the first library, with the output of a Sort node of mine, has 1400+ videos.

I think this is a tricky one to solve… I’m sure there’s a fix for this in order to do this dynamically.

Any other ideas?

Thanks!

-gregg

I performed some additional troubleshooting. Now I see what’s happening!

The “Items List” node is receiving the correct number of rows PER those 7 libraries (see “7 items” in screenshot below). I see the 1446 videos on one of the libraries.

However, it’s only outputting the 420 items into the Google Sheets node.

I can’t find any option in the Items List node, or anywhere else, that limits it to 420. Not any workflow settings for this, etc.

Is it hard-coded? Defined outside, elsewhere, for the workflow?

Perplexed! :slight_smile:

Thanks,

-gregg

Hi @chicagogregg, it’s hard for me to reproduce this without access to your dataset, but populating a few thousand rows on Google Sheet sounds doable and I don’t think 420 is hardcoded. Maybe instead of fetching all videos from 7 libraries at once, you can fetch them from one library at a time to see if that changes anything?

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