Runs: Every evening

Get new videos from your favourite YouTube channels by email

One email a day with new uploads from the channels you choose, in order, without the recommendations pulling you in.

Every YouTube channel quietly publishes a feed of its newest videos. Point a small script at the channels you actually care about and you get their uploads in your inbox, without opening the app and losing an hour to the sidebar.

  1. Collect channel IDs

    For each channel, open its page on YouTube, click the more link in the channel description, then Share channel and Copy channel ID. The ID starts with UC.

  2. Start a new script

    Go to script.google.com, click New project and name it New videos.

  3. Paste the script

    Replace everything in the editor with this, and put your channel IDs in the list:

    const CHANNELS = [
      'UCxxxxxxxxxxxxxxxxxxxxxx',
    ];
    
    function sendNewVideos() {
      const atom = XmlService.getNamespace('http://www.w3.org/2005/Atom');
      const since = new Date(Date.now() - 24 * 60 * 60 * 1000);
      let html = '';
      for (const id of CHANNELS) {
        const url = 'https://www.youtube.com/feeds/videos.xml?channel_id=' + id;
        const feed = XmlService.parse(UrlFetchApp.fetch(url).getContentText()).getRootElement();
        const channel = feed.getChildText('title', atom);
        for (const entry of feed.getChildren('entry', atom)) {
          if (new Date(entry.getChildText('published', atom)) < since) continue;
          const link = entry.getChild('link', atom).getAttribute('href').getValue();
          html += '<p><b>' + channel + '</b>: <a href="' + link + '">' +
            entry.getChildText('title', atom) + '</a></p>';
        }
      }
      if (html) {
        MailApp.sendEmail({
          to: Session.getActiveUser().getEmail(),
          subject: 'New videos today',
          htmlBody: html,
        });
      }
    }
    
  4. Run it once and allow access

    Click Run and allow access. If any channel uploaded in the last day, an email arrives; if not, nothing is sent, which is also correct.

  5. Run it every evening

    Open Triggers, click Add trigger, choose sendNewVideos, Time-driven, Day timer, 6 pm to 7 pm, and save.

Things that trip people up

  • The feed includes Shorts as well as full videos. The agent version can filter them out.
  • The feed only lists a channel's most recent uploads, so this tells you what's new; it isn't a full archive.