[READ-ONLY] Mirror of https://github.com/probablykasper/yt-email-notifier. macOS menubar app for YouTube upload notification emails
email menubar notifications tray youtube
0

Configure Feed

Select the types of activity you want to include in your feed.

Prevent email threading

+15 -2
+2 -2
README.md
··· 32 32 4. Now you've got your API key. Optionally, you can restrict the key to only work on the `YouTube Data API v3` and only work for requests coming from your IP 33 33 - `From email`: When you receive emails from YTEM, this will be the email you receive it from. If you own `example.com`, you could for instance put in `noreply@ytem.example.com`. If you don't own a domain name, you should be able to just use `example.com`. This doesn't actually have to be a real email, and you don't need to prove it's yours 34 34 3. Whatever your `From email` is, go to your email app and create a filter that makes sure emails from that email don't end up in the spam filter. We're not doing much to prove our emails are legit, so they will likely get stuck in the spam filter (In fact, I've even noticed Google putting itself in the spam filter sometimes) 35 - 4. Click `Save` and then `New email`. Enter your actual email, and how often you'd like YTEM to check for new videos. You may add multiple emails 35 + 4. Click `Save` and then `New email`. Enter your actual email, and how often you'd like YTEM to check for new videos 36 36 5. Now click `Add channel`, then 37 37 1. Select the email you'd like to be notified on 38 38 2. Enter the channel URL. Because of YouTube API limitations, this URL needs to either have `/channel/` or `/user/` in it, other types won't work. If you got a wrong URL, try clicking on a video from the channel, and then go to the channel page from there 39 39 3. Choose the starting time for what videos you'd like to receive email notifications. For example, if you choose 7 days ago, YTEM will notify you about all the videos uploaded since then (maximum the last 50 videos). You'll only be notified for videos uploaded only after the time you set 40 - 6. That's all, hopefully it's worth it! 40 + 6. Done 41 41 42 42 ### Menubar options 43 43
+13
src/server.js
··· 1 1 const http = require('http') 2 2 const fs = require('fs') 3 3 const path = require('path') 4 + const crypto = require('crypto') 4 5 const connect = require('connect') 5 6 const serveStatic = require('serve-static') 6 7 const WebSocket = require('ws') ··· 222 223 .replace('"', '&quot;') 223 224 } 224 225 226 + function generateRandomReference() { 227 + const randomId = [2, 2, 2, 6].reduce( 228 + // crux to generate UUID-like random strings 229 + (prev, len) => prev + '-' + crypto.randomBytes(len).toString('hex'), 230 + crypto.randomBytes(4).toString('hex'), 231 + ) 232 + return '<'+randomId+'@random-id-to-prevent-threading.example.com>' 233 + } 234 + 225 235 function sendMail(fromEmail, toEmail, videoDoc, channel) { 226 236 const emailTitle = videoDoc.channelTitle+' just uploaded a video' 227 237 let thumbnailUrl = videoDoc.thumbnails.high ··· 320 330 to: toEmail, 321 331 subject: emailTitle, 322 332 html: html, 333 + headers: { 334 + References: generateRandomReference(), // prevent email threading 335 + }, 323 336 }, (err, info) => { 324 337 if (err) { 325 338 logger.error(` ${videoDoc._id} Mail error sending:`, err)