{"id":18035524,"url":"https://github.com/pawurb/yt-sub-rs","last_synced_at":"2025-08-03T07:31:01.315Z","repository":{"id":257826124,"uuid":"870880863","full_name":"pawurb/yt-sub-rs","owner":"pawurb","description":"A simple CLI for subscribing to YouTube RSS feeds without a YouTube account.","archived":false,"fork":false,"pushed_at":"2024-10-21T15:14:04.000Z","size":363,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-22T01:46:43.203Z","etag":null,"topics":["cli","rss","rust","youtube"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/pawurb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2024-10-10T20:48:41.000Z","updated_at":"2024-10-18T08:05:02.000Z","dependencies_parsed_at":"2024-10-21T19:39:52.920Z","dependency_job_id":null,"html_url":"https://github.com/pawurb/yt-sub-rs","commit_stats":null,"previous_names":["pawurb/yt-sub-rs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawurb%2Fyt-sub-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawurb%2Fyt-sub-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawurb%2Fyt-sub-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawurb%2Fyt-sub-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pawurb","download_url":"https://codeload.github.com/pawurb/yt-sub-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228535809,"owners_count":17933254,"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":["cli","rss","rust","youtube"],"created_at":"2024-10-30T12:08:31.718Z","updated_at":"2024-12-06T22:57:59.523Z","avatar_url":"https://github.com/pawurb.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yt-sub-rs [![Latest Version](https://img.shields.io/crates/v/yt-sub.svg)](https://crates.io/crates/yt-sub) [![GH Actions](https://github.com/pawurb/yt-sub-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/pawurb/yt-sub-rs/actions)\n\nyt-sub is a simple CLI for subscribing to YouTube RSS feeds without using a YouTube account. Receive Slack notifications about fresh videos based on the configurable schedule.\n\n## Usage\n\n```text\nYouTube RSS subscription CLI\n\nUsage: ytsub \u003cCOMMAND\u003e\n\nCommands:\n  init          Initialize config file [aliases: i]\n  settings      Display current settings [aliases: s]\n  run           Check and notify about fresh videos [aliases: r]\n  channel-data  Get a channel data based on its handle [aliases: d]\n  follow        Subscribe to a channel [aliases: f]\n  unfollow      Unsubscribe [aliases: u]\n  list          List followed channels [aliases: l]\n  register      Register remote account [aliases: re]\n  unregister    Remove remote account [aliases: un]\n  sync          Update remote settings to match local [aliases: sc]\n  help          Print this message or the help of the given subcommand(s)\n\nOptions:\n  -h, --help     Print help\n  -V, --version  Print version\n```\n\nInstall CLI:\n\n```bash\ncargo install yt-sub\n```\n\nInitialize the settings file at `~/.config/yt-sub-rs/config.toml`:\n\n```bash\nytsub init\n```\n\n`~/.config/yt-sub-rs/config.toml`\n```toml\nchannels = []\n\n[[notifiers]]\nLog = []\n```\n\nFollow preferred channels based on [their URL handle](https://support.google.com/youtube/answer/11585688?sjid=4360661106629707574-EU):\n\n```bash\nytsub follow --handle @ManofRecaps\n```\n\nDisplay the list of your channels by typing:\n\n```bash\nytsub list\n\n# You are following:\n#\n# name: Man of Recaps\n# handle: @ManofRecaps\n# channel_id: UCNCTxLZ3EKKry-oWgLlsYsw\n# channel_url: https://www.youtube.com/@ManofRecaps\n# RSS feed: https://www.youtube.com/feeds/videos.xml?channel_id=UCNCTxLZ3EKKry-oWgLlsYsw\n\n```\n\nNow you can run: \n\n```bash\nytsub run\n\n# New video - Man of Recaps Rings of Power RECAP: Season 2 https://www.youtube.com/watch?v=CjeUx_HHtF0\n```\n\nto trigger notifications about freshly released videos from your observed channels. The first `run` invocation will notify you about videos released in the last 7 days. Subsequent runs will inform about videos released since the previous `run` event.\n\nYou can customize this period by appending the `--hours-offset` option:\n\n```bash\n# notify about videos published in the last 24 hours\nytsub run --hours-offset 24 \n```\n\nThe time of the last run is stored in the `~/.yt-sub-rs/last_run_at.txt` file.\n\nYou can unfollow a channel by typing:\n\n```bash\nytsub unfollow --handle @ManofRecaps\n```\n\n## Remote account\n\nBy registering a remote account, you'll receive Slack notifications about new videos without executting the CLI locally.\n\nTo do it run:\n\n```bash\nytsub register\n```\n\nit will persist your API key in the config file. You must configure Slack notifications to use this feature. \n\nIf your account is registered `follow` and `unfollow` commands will automatically update your remote data. If you change the config file manually, you have to run:\n\n```bash\nytsub sync\n```\n\nBy default, new videos are checked once every hour. Optionally, you can define a notification schedule like this:\n\n`~/.config/yt-sub-rs/config.toml`\n\n```toml\nschedule = [8, 20]\n```\n\nNumbers represent UTC hours when notifications should be sent.\n\nDon't forget to run `sync` after updating this config.\n\nYou can remove all your remote data by running:\n\n```bash\nytsub unregister\n```\n\n## Notifiers configuration\n\nBy default, CLI is configured to log to the `stdout`. You can configure Slack notifications like this:\n\n`~/.config/yt-sub-rs/config.toml`\n\n```toml\n[[notifiers]]\n\n[notifiers.Slack]\nwebhook_url = \"https://hooks.slack.com/services/XXX/XXX/XXX\"\nchannel = \"yt-videos\"\n```\n\n![Slack notification](https://github.com/pawurb/yt-sub-rs/raw/main/assets/slack-notification.png)\n\nYou can obtain the `webhook_url` value as described [in the Slack docs](https://api.slack.com/messaging/webhooks).\n\n## Manually finding an RSS `channel_id`\n\nCLI will try to find the matching `channel_id` based on the URL handle. But proxied YouTube API calls are sometimes throttled. So if the `follow` command fails, you have to obtain this data manually. Go to the [channel videos tab](https://www.youtube.com/@ManofRecaps/videos) and run this JS in the console to extract the RSS `channel_id`:\n\n```javascript\ndocument.querySelector('link[rel=\"alternate\"][type=\"application/rss+xml\"]').href.match(/channel_id=([^\u0026]+)/)[1];\n```\nThis snippet works on Firefox. Alternatively, you can look for this value manually in the source code: \n\n![RSS feed](https://github.com/pawurb/yt-sub-rs/raw/main/assets/youtube-rss.png)\n\nNow you can subscribe by providing all the data like this:\n\n```bash\nytsub follow --handle @ManofRecaps --channel-id UCNCTxLZ3EKKry-oWgLlsYsw --desc 'Man of Recaps'\n```\n\n\n## CRON invocation\n\nAlternatively, you can use the CLI via the CRON scheduler to receive notifications without a remote account. By appending the `--cron` flag to the `run` command CLI will output the logs with timestamps:\n\n```\nRUST_LOG=info ytsub run --cron\n\n# [2024-10-14T13:03:58Z INFO  yt_sub::logger] New video - Man of Recaps Rings of Power RECAP: Season 2 https://www.youtube.com/watch?v=CjeUx_HHtF0\n```\n\nThis mode of execution is the most useful with Slack notifications configured.\n\n## Status\n\nThis project is in the early stages of development, so feedback and PRs are welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawurb%2Fyt-sub-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpawurb%2Fyt-sub-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawurb%2Fyt-sub-rs/lists"}