{"id":16934007,"url":"https://github.com/lucas-c/youtube_playlist_watcher","last_synced_at":"2025-03-22T12:31:30.792Z","repository":{"id":35352101,"uuid":"39614601","full_name":"Lucas-C/youtube_playlist_watcher","owner":"Lucas-C","description":"Backup Youtube playlists and alert you on songs deletions","archived":false,"fork":false,"pushed_at":"2024-06-19T00:47:24.000Z","size":89,"stargazers_count":16,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T11:04:42.170Z","etag":null,"topics":["alert","playlist-changes-watched","python","python-script","youtube","youtube-api","youtube-playlist"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lucas-C.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2015-07-24T06:02:15.000Z","updated_at":"2024-07-21T06:48:55.000Z","dependencies_parsed_at":"2024-06-19T07:24:05.415Z","dependency_job_id":null,"html_url":"https://github.com/Lucas-C/youtube_playlist_watcher","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucas-C%2Fyoutube_playlist_watcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucas-C%2Fyoutube_playlist_watcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucas-C%2Fyoutube_playlist_watcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucas-C%2Fyoutube_playlist_watcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lucas-C","download_url":"https://codeload.github.com/Lucas-C/youtube_playlist_watcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244959429,"owners_count":20538625,"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":["alert","playlist-changes-watched","python","python-script","youtube","youtube-api","youtube-playlist"],"created_at":"2024-10-13T20:51:05.544Z","updated_at":"2025-03-22T12:31:30.278Z","avatar_url":"https://github.com/Lucas-C.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![build status](https://github.com/lucas-c/youtube_playlist_watcher/workflows/build/badge.svg)](https://github.com/lucas-c/youtube_playlist_watcher/actions?query=branch%3Amaster)\n[![Known Vulnerabilities](https://snyk.io/test/github/lucas-c/youtube_playlist_watcher/badge.svg)](https://snyk.io/test/github/lucas-c/youtube_playlist_watcher)\n\nDo you get frustrated by videos disappearing from your Youtube playlist,\nbecause of copyright infringement, new region restrictions or just because the guy who uploaded them removed it ?\nWith no way for you to find out which where those clips:\nbecause Youtube does not keep trace of those dead videos,\nyour only chance to recall what were their names is a Google search based on their video ids.\n\nBut no more !\n\nThis Python script will keep JSON backups of your playlists on your computer,\ndetect changes like disappearing videos,\nand alert you with console messages or emails like this:\n\n    SUBJECT: [YPW] Change detected in Youtube playlist FLF8xTv55ZmwikWWmWLPEAZQ\n    Playlist: https://www.youtube.com/playlist?list=FLF8xTv55ZmwikWWmWLPEAZQ\n    REGION RESTRICTIONS CHANGED for Sade - The Best Of Sade | Full Album : {\"blocked\": [\"DE\"]}-\u003e {} https://www.youtube.com/watch?v=zX8nZI8U9XY\n    -\u003e find another video named like that: https://www.youtube.com/results?search_query=Sade+-+The+Best+Of+Sade+%7C+Full+Album\n    BECAME PRIVATE: https://www.youtube.com/watch?v=T4ZCJzjufYs\n    -\u003e find another video named like that: https://www.youtube.com/results?search_query=Patrick+Bruel+%22J%27te+l%27dis+quand+m%C3%AAme%22\n    DELETED: The Cure - Burn 1994 HQ (The Crow)\n    -\u003e find another video named like that: https://www.youtube.com/results?search_query=The+Cure+-+Burn+1994+HQ+%28The+Crow%29\n\n![](https://chezsoi.org/lucas/wwcb/photos/NinjaTurtlesPowerRangers.gif)\n\n\n## Requirements\nA computer with:\n\n- Python 3.7 at least\n- a [Youtube Data API key](https://developers.google.com/youtube/v3/getting-started) (it's free)\n- and either:\n    * the ability to run daily jobs (e.g. standard Linux cron jobs) + `mail`, `mutt` or any other command-line email client\n    * a Bash-based console (Cygwin is ok) that you open frequently, so you'll see the reports inside\n\n\n## Installation in .bashrc to get reports in your temrinal\n\nIf installed this way, YPW will do the following:\n- each time you'll open a new terminal, it'll check if it has already been executed today,\nand else launch a background task to dump \u0026 check your playlist for changes.\n- the next time you'll open a console after this task completed,\nyou'll see the report at the top of your terminal (it can be empty if no changes were detected).\n\nTo install it, run the following in a console (just remember to substitute the `...` on the last line by real values) :\n\n    cd /path/to/your/installation/directory # the JSON dumps will be stored there by default\n    wget https://rawgit.com/Lucas-C/youtube_playlist_watcher/master/youtube_playlist_watcher.py\n    wget https://rawgit.com/Lucas-C/youtube_playlist_watcher/master/install_bashrc_banner.sh\n    wget https://rawgit.com/Lucas-C/youtube_playlist_watcher/master/requirements.txt\n    chmod u+x *.sh *.py\n    pip install -r requirements.txt\n    ./install_bashrc_banner.sh YOUTUBE_API_KEY=... PLAYLIST_ID=...\n\nThis last script will append some lines to your ~/.bashrc, that implement the logic detailed above.\nIt will also define a `ypw_check` shell function that you can invoke manually if you want.\n\nIf you want to watch multiple playlists, keep more or less JSON dumps in history\nor change the kind of playlist changes watched, simply edit this section of your ~/.bashrc manually.\n\n\n## Installation as a cron job sending emails\n\nRun the following in a console (just remember to substitute the `...` on the last line by real values) :\n\n    cd /path/to/your/installation/directory # the JSON dumps will be stored there by default\n    wget https://rawgit.com/Lucas-C/youtube_playlist_watcher/master/youtube_playlist_watcher.py\n    wget https://rawgit.com/Lucas-C/youtube_playlist_watcher/master/install_crontask.sh\n    wget https://rawgit.com/Lucas-C/youtube_playlist_watcher/master/requirements.txt\n    chmod u+x *.sh *.py\n    pip install -r requirements.txt\n    ./install_crontask.sh YOUTUBE_API_KEY=... PLAYLIST_ID=... EMAIL_DEST=...\n\nThis last script will generate a `youtube_playlist_watcher_crontask.sh` script that will be invoked by a cron job,\nrunning every day at midnight.\n\nIf you want to watch multiple playlists, use another email client command (the default is `mail`),\nkeep more or less JSON dumps in history or change the kind of playlist changes watched,\nsimply edit this file manually.\n\n\n## Python script manual usage\n\nTo compare a dump taken at any date with the latest one:\n\n    ./youtube_playlist_watcher.py --playlist $playlist_id compare 2015-01-01 LATEST\n\nWant to find more secret features ? The `--help` flag is your friend.\n\nOr use the power Luke: READ THE SOURCE !\n\n\n## Removing \"ghost\" playlist items\n\nIf you repeatedly get reports like this:\n\n    IS PRIVATE: AURORA - All Is Soft Inside - LYRICS https://www.youtube.com/watch?v=tUiWQiUvWas (217th video in the playlist)\n     -\u003e find another video named like that: https://www.youtube.com/results?search_query=AURORA+-+All+Is+Soft+Inside+-+LYRICS\n    DELETED: Deleted video https://www.youtube.com/watch?v=Y9QHak8h1AQ (437th video in the playlist)\n     -\u003e find another video named like that: https://www.youtube.com/results?search_query=Nujabes+-+Lady+Brown\n\nUse Youtube Data API web \"shooter\" to remove the corresponding playlist items:\nhttps://developers.google.com/youtube/v3/docs/playlistItems/delete\n\nYou can extract all `playlistItemId` of deleted videos from a `youtube-playlist-$playlist_id-$timestamp.json` file\nusing the following [jq](https://stedolan.github.io/jq/) command:\n\n    jq '.[] | select(.snippet.title==\"Deleted video\") | .id' $json_file\n\nIt cannot easily be done with a script, as this API endpoint also requires an OAuth2 access token.\n\n\n## Contributing\n\nBug reports or features suggestions are warmly welcome !\n\nFor the devs:\n\n    pip install -r dev-requirements.txt\n    pre-commit install\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucas-c%2Fyoutube_playlist_watcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucas-c%2Fyoutube_playlist_watcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucas-c%2Fyoutube_playlist_watcher/lists"}