{"id":23535698,"url":"https://github.com/marcelrobitaille/bbyen","last_synced_at":"2025-04-23T04:26:33.278Z","repository":{"id":40327256,"uuid":"290000763","full_name":"MarcelRobitaille/bbyen","owner":"MarcelRobitaille","description":"Bring Back YouTube Email Notifications! YouTube upload email notification replacement","archived":false,"fork":false,"pushed_at":"2025-01-03T12:58:44.000Z","size":508,"stargazers_count":19,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-18T18:18:16.442Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MarcelRobitaille.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-24T17:58:14.000Z","updated_at":"2025-03-29T19:31:23.000Z","dependencies_parsed_at":"2024-11-09T18:17:49.367Z","dependency_job_id":"1ce0ef5d-2351-4e49-bbba-fc2f4d581801","html_url":"https://github.com/MarcelRobitaille/bbyen","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelRobitaille%2Fbbyen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelRobitaille%2Fbbyen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelRobitaille%2Fbbyen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelRobitaille%2Fbbyen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarcelRobitaille","download_url":"https://codeload.github.com/MarcelRobitaille/bbyen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250369055,"owners_count":21419177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-26T01:19:27.036Z","updated_at":"2025-04-23T04:26:33.261Z","avatar_url":"https://github.com/MarcelRobitaille.png","language":"TypeScript","funding_links":["https://www.paypal.com/donate/?hosted_button_id=RU2HM3LYLQG34"],"categories":[],"sub_categories":[],"readme":"# Bring Back YouTube Email Notifications!\n\n[Homepage](https://github.com/MarcelRobitaille/bbyen)\n\n## Why?\n\nIn August 2020, YouTube removed the feature of sending email notifications when a subscriber uploads a video. Many watchers, myself included, prefer email notifications to app notifications. Here are some reasons why email notifications so great:\n\n- Save videos for later\n- Delete emails of videos you never want to watch\n- Define filtering rules to automatically delete certain emails\n- YouTube has been known to not always send notifications for all subscribers\n\nThis project aims to provide a replacement to YouTube's email notifications. Running this small program checks all your subscribers and sends emails with the links to new videos.\n\n## How it works\n\nIt uses the [YouTube Data API](https://developers.google.com/youtube/v3/) to get a list of your subscribers and uses [RSS feeds](https://support.google.com/youtube/answer/6224202?hl=en) to get each channel's recent uploads. A database of videos for which an email has already been sent is kept in order to not notify about the same video twice. To send emails, the program connects to an email account through SMTP.\n\n## Requirements\n\n- [Docker](https://www.docker.com/)\n\nor\n\n- [node.js](https://nodejs.org/en/) \u003e= 16 (20 recommended)\n- [git](https://git-scm.com/) (used during setup to download the project)\n\n## Installation and setup\n\nThere are two methods to run this software.\nYou may run it on bare metal, or take advantage of the Docker image published to Docker Hub.\n\n### Bare metal\n\n1. Download the source code\n\n\t```\n\tgit clone https://github.com/MarcelRobitaille/bbyen.git\n\t```\n\n1. Download packages\n\n\t```\n\tnpm install --production\n\t```\n\n1. Copy the template configuration file and save it as `config.json`\n\t```\n\tcp config.example.json config.json\n\t```\n\n1. [Perform the initial configuration](#initial-configuration)\n\n### Docker\n\n1. Create an empty folder on your computer\n\t```\n\tmkdir -p ~/docker/bbyen\n\tcd ~/docker/bbyen\n\t```\n1. Copy the `docker-compose.yml` from this repository to that folder\n\t```\n\twget https://raw.githubusercontent.com/MarcelRobitaille/bbyen/master/docker-compose.yml\n\t```\n1. Copy the configuration file template and save it as `config.json`\n\t```\n\twget https://raw.githubusercontent.com/MarcelRobitaille/bbyen/master/config.example.json \\\n\t  -O config.json\n\t```\n1. [Perform the initial configuration](#initial-configuration)\n\n## Initial Configuration\n\nAfter installing the software using either the bare metal or Docker method,\nit is mandatory to configure certain values and to set up Google API credentials.\n\n1. Populate the `config.json` file\n\n\tUpdate `email.host`, `email.auth`, and `email.sendingContact`. These are the settings to send email over SMTP.\n\n\tChange `email.destination` to the email address where videos should be sent.\n\n\tOptionally change `timers.subscriptions` and `timers.videos` to configure how often your list of subscriptions is updated and how often new videos are checked for emailed about respectively.\n\n1. Set up Google API credentials\n\n\tThe credentials have to be made on your personal account. This is the source of your subscriptions.\n\n\t1. Go to https://console.developers.google.com and create a new project\n\n\t1. Go to https://console.developers.google.com/apis/credentials and create OAuth 2.0 Client credentials\n\n\t\t1. Click \"Create Credentials\" and then \"OAuth client ID\"\n\t\t![Create Credentials Options](./docs/oauth_create_credentials.png)\n\n\t\t1. Select \"Desktop app\" for \"Application type\"\n\t\t![Create Credentials Application Type](./docs/oauth_application_type.png)\n\n\t\t1. Click \"Create\"\n\n\t1. Click the download button next to the new OAuth 2.0 Client ID.\n\tDownload the credentials JSON file and save it as `google-credentials.json` in the folder where you downloaded the project.\n\t![OAuth Credentials Download](./docs/oauth_download.png)\n\n\t1. Go to https://console.developers.google.com/apis/library, search for and click \"YouTube Data API v3\", and enable this api.\n\n## Running\n\n### Bare Metal\n\n```\nnpm start\n```\n\n### Docker\n```\nsudo docker-compose up\n```\n\n## Authentication\n\nOn the first run, you will need to authenticate the app, tying it to your Google account (the subscriptions will come from whatever account you use):\n1. A browser window should open automatically. If not, or if the system is headless, the URL will be printed in the console. Copy/paste it into a new tab.\n1. Follow the instructions on this page.\n1. You may have to click \"Advanced\" and \"Got to bbyen (unsafe)\". This is because the app hasn't been verified, but the server is trustworthy (you are running it).\n1. After authenticating in the website, Google should automatically redirect you to your server, which will transfer the authentication code. In this case you will see a message \"Authorization successful. You may now close this tab.\".\nIf this does not work (if you see \"Unable to connect\"), please copy/paste the URL from the browser address bar into the console.\n\n## Advanced Configuration\n\n### Channel Whitelist and Blacklist\n\nIn some instances, you may want to stop receiving notifications from a list of channels (blacklist)\nor only receive notifications from a list of channels (whitelist).\nUnfortunately, there is no way to check the notification status (bell icon set to \"all\", \"personalized\", or \"none\") from the API.\nThus, blacklist and whitelist options were added to the configuration file.\n\nYou can use the keys `blacklistedChannelIds` and `whitelistedChannelIds` in the top level of `config.json`.\nThese should be arrays of the channel IDs you want to include/exclude.\nFor example:\n```json\n{\n\t\"email\": {},\n\t...\n\t\"blacklistedChannelIds\": [ \"xxx\", \"yyy\" ],\n\t\"whitelistedChannelIds\": [ \"zzz\" ]\n}\n```\nIf the key `whitelistedChannelIds` is present, notifications will only be sent for those channels.\nIf `blacklistedChannelIds` is present, any notifications that would be sent for channels are skipped.\n\nThe channel ID is usually at the end of the URL of the channel's page.\nHowever, sometimes this is not the true ID but some customized shorter and readable string.\nIn this case, you may:\n- Paste the entire channel page URL into the config. Note that the next time you run the software, this will be replaced with the channel ID so this conversion only has to happen once (it uses the API so there is a small cost to this).\n- Run `copy(window.ytInitialData.metadata.channelMetadataRenderer.externalId)` in the developer console. On the channel page, press F12, click \"Console\", and paste this command. The channel ID will get copied to your clipboard.\n- You may also find the channel ID by looking in the database file.\n\nThis is admittedly a manual and complicated process.\nThat is because this feature is indented for advanced users.\nIf there is demand, I will consider a more user-friendly implementation.\n\nPlease see #6 for more information on this.\n\n## Alternatives\n\nIt is possible to manually set up RSS feeds for each channel you are interested in. It is a very lengthy process.\n\n1. Find the id of the channel.\n1. Get the URL to the RSS feed: https://www.youtube.com/feeds/videos.xml?channel_id=\u003cchannelId\\\u003e\n1. Put this URL in an RSS reader (such as [blogtrottr.com](https://blogtrottr.com))\n\nHere are some advantages of BBYEN over manually configuring RSS feeds:\n\n- No ads.\n- You don't have to manually go through all your subscriptions. It will automatically find all subscriptions you have notifications for.\n- It will automatically detect new subscriptions and unsubscriptions.\n\n## Contributing\n\nPull requests welcome.\n\nI also accept donations, but please consider other, more worthy causes.\n\n[![PayPal](https://img.shields.io/badge/PayPal-00457C?style=for-the-badge\u0026logo=paypal\u0026logoColor=white)](https://www.paypal.com/donate/?hosted_button_id=RU2HM3LYLQG34)\n\n## Development\n\n### Docker\n\nBuilding the docker image:\n```\nsudo docker build . -t marcel/bbyen\n```\n\nI had to use `--network host` to have `npm install` work correctly without timing out:\n```\nsudo docker build . -t marcel/bbyen --network host\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelrobitaille%2Fbbyen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcelrobitaille%2Fbbyen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelrobitaille%2Fbbyen/lists"}