Skip to content

Instantly share code, notes, and snippets.

@acollierr17
Forked from Godimas/yt2d.md
Last active February 7, 2023 00:09
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acollierr17/4ca990ab76bc6b2afe95fe77ee82ec37 to your computer and use it in GitHub Desktop.
Save acollierr17/4ca990ab76bc6b2afe95fe77ee82ec37 to your computer and use it in GitHub Desktop.
YouTube to Discord via IFTTT (Updated 2020)

Navigate to: Twitter via IFTTT, Twitter via Zapier, Reddit or GitHub.

YouTube to Discord via IFTTT and webhook

You just posted a video. You want everyone on your server to know this, eh?

Step 1 - Register on IFTTT

  1. Go to the IFTTT website and create an account (if you don't already have one).

Step 2 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send YouTube videos.

  2. In the settings for the channel, find the "Integrations" option and look for the "Webhooks" tab. If you have no webhooks set up for that channel, then click "Create Webhook." Otherwise, click "View Webhooks" to open the webhook pane. From there, click "New Webhook" to create your webhook.

WebhookDiscord

  1. You can name the webhook whatever you want and give it any image; for this tutorial, we override them later. Please keep track of the URL; we'll need it later.

Step 3 - Make an Applet

  1. Head to My Applets on IFTTT to start creating your new applet
  2. Scroll down, and under the "My Applets" list, you should see the "Create" card. Keep in mind if you're on the free plan, you only have access to the maximum of 3 applets. You'll need to review your current applets and make some choices if this applies to you.
  3. Click "Add" next to the "If This" button
  4. (Step 1/5) Search for "YouTube" in the "Search services" box and select it when it pops up
  5. (Step 2/5) Select the "New public video uploaded by you" trigger. You can only connect YouTube channels and brand accounts that are accessible by you. Not someone you follow, such as MrBeast. Proceed to link your YouTube channel.
  6. (Step 3/5) Click "Add" next to the "Then That" button
  7. (Step 4/5) Search for "Webhooks" in the "Search services" box and select it when it pops up
  8. (Step 5/5) Select the "Make a web request" trigger (the only action)

Step 4 - Setup the webhook

Complete action fields (Image too big, so I'm not adding it to this gist)

  1. Paste your webhook URL in the "URL" box.
  2. Select "POST" as the request method.
  3. Select application/json as the Content Type
  4. Paste the following json body below in the "Body" textbox. Edit it as you wish. Click "Add ingredient" to see the different parameters you can use.
{
  "username":"IFTTT YouTube Test",
  "avatar_url":"https://blog.eu.playstation.com/files/avatars/avatar_4364447.jpg",
  "content":"**{{AuthorName}}** uploaded **{{Title}}** at {{CreatedAt}}: {{Url}}"
}

If you wish to send the message as an embed, use this format. Edit it as you want to.

{
   "embeds":[
      {
         "title":"{{Title}}",
         "color":16711680,
         "url":"{{Url}}",
         "fields":[
            {
               "name":"<<Link>>",
               "value":"{{Url}}",
               "inline":false
            },
            {
               "name":"<<Published>>",
               "value":"{{CreatedAt}}",
               "inline":false
            },
            {
               "name":"<<Author>>",
               "value":"{{AuthorName}}",
               "inline":false
            }
         ]
      }
   ]
}

Step 5 - Profit

Now what you have to do is click "Create Action." It will start to run immediately. You can shut it down using the power button. If there's any error, it'll appear in the logs. The "Check now" button updates the applet in case it is not automatically updated. Overall, use it for troubleshooting. It should be the first thing you use if your applet is having issues.

Suppose you have errors that you cannot solve after googling or looking through IFTTT support forums. In that case, contact anthony#8577 on Discord. Preferably via my Discord server.

@navinor
Copy link

navinor commented Nov 17, 2020

pog

@DummyC
Copy link

DummyC commented Jan 12, 2021

How about if I use "New public video from subscriptions" instead, does it works with other YouTube channels?

@acollierr17
Copy link
Author

How about if I use "New public video from subscriptions" instead, does it works with other YouTube channels?

Go ahead and give it a shot! Let me know how it goes if you do. Can update this guide based on it.

@DummyC
Copy link

DummyC commented Jan 12, 2021

Go ahead and give it a shot! Let me know how it goes if you do. Can update this guide based on it.

It seems like it works, the trigger ran and the parameters have the contents but it's "action failed" on the webhook with the failure message "Too many requests to this host.". Probably because of testing lol. I'll test it again some other time.

Edit: I often get "There was a problem with the trigger" error

@Bred4Gaming
Copy link

Any way of making a trigger for a livestream when the channel goes live? It currently will trigger when the stream is over as the livestream is now a "video" and is new, but that defeats the purpose of the livestream...

I know there is tags in youtubes coding for it, and the functionality exists for twitch, I just can't figure it out.

note your discord invite expired hence the comment on this post and not a dm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment