Monitor YouTube for new videos

What I’m trying to do:
This isn’t a specific code question, more of a conceptual one.

I’m wondering if it’s possible for Anvil to listen for a new video uploaded to a specific YouTube channel and then upload that video to S3? I tried using Zapier, IFTTT and Integromat to do it, but Zapier’s process is currently broken (per Zapier customer support), IFTTT is unreliable, and it’s dubious whether Integromat even supports YouTube at all.

I’m trying to find a way around it by building a web app in Anvil.

There are 3 steps here I think:

  1. YouTube has an API that can facilitate the downloading of the video. I can use the PyTube module for this. No problem with this step.
  2. Getting Anvil to communicate with S3 (to store the downloaded video) is the easy part, that’s just a matter of creating a Boto3 client on the Anvil server side. No problem with this step.
  3. It’s the “listening for a new video” part I’m unsure of. How would an Anvil app know when a new video has been uploaded?

What I’ve tried and what’s not working:

  1. Using a Zap in Zapier.
  2. IFTTT.
  3. Integromat.

I figured this would be very quick and easy, I was wrong. Does anyone have any experience with this?

Code Sample:

# this is a formatted code snippet.
# paste your code between ``` 

Clone link:
share a copy of your app

You could use a Scheduled Task and run it every hr/day etc. to check the channel(s) in question. It wouldn’t be completely in sync and would be as stale as the frequency at which the task runs, but this is the only way I can think of to do what you want.

Alternatively, you could use the Youtube server push notifications pub/sub API to connect to an Anvil HTTP Endpoint you create that adds the new video to your Boto3:

2 Likes