{"id":30659195,"url":"https://github.com/cmenon12/birdbox-livestream","last_synced_at":"2025-08-31T12:44:29.011Z","repository":{"id":42064824,"uuid":"442492103","full_name":"cmenon12/birdbox-livestream","owner":"cmenon12","description":"Collection of Python scripts designed for livestreaming a birdbox from a Raspberry Pi to YouTube!","archived":false,"fork":false,"pushed_at":"2025-08-23T02:20:33.000Z","size":4975,"stargazers_count":3,"open_issues_count":14,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-23T04:23:13.864Z","etag":null,"topics":["birdbox","livestream","pi","python","raspberry-pi","youtube"],"latest_commit_sha":null,"homepage":"https://www.youtube.com/channel/UCikUXkTwFvyrHlajBRQwvuw/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cmenon12.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null}},"created_at":"2021-12-28T14:42:03.000Z","updated_at":"2025-07-01T06:54:05.000Z","dependencies_parsed_at":"2024-03-28T22:22:45.888Z","dependency_job_id":"ac9889f7-0cd8-493f-b50f-667abcfb3a77","html_url":"https://github.com/cmenon12/birdbox-livestream","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cmenon12/birdbox-livestream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmenon12%2Fbirdbox-livestream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmenon12%2Fbirdbox-livestream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmenon12%2Fbirdbox-livestream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmenon12%2Fbirdbox-livestream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmenon12","download_url":"https://codeload.github.com/cmenon12/birdbox-livestream/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmenon12%2Fbirdbox-livestream/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272982772,"owners_count":25025984,"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","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["birdbox","livestream","pi","python","raspberry-pi","youtube"],"created_at":"2025-08-31T12:44:28.321Z","updated_at":"2025-08-31T12:44:28.939Z","avatar_url":"https://github.com/cmenon12.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg align=\"left\" width=\"65\" height=\"65\" alt=\"Logo cartoon of birdbox with CCTV inside\" src=\"/assets/logo.png\"\u003e\n\n# birdbox-livestream\n\nThis is a small collection of Python scripts designed for livestreaming a birdbox from a Raspberry Pi to YouTube!\n\n### **[Check out the channel on YouTube!](https://www.youtube.com/channel/UCikUXkTwFvyrHlajBRQwvuw)**\n\n**(unfortunately no birds have shown up yet 😢)**\n\n[\u003cimg src=\"/assets/my-birdbox.png\" alt=\"Photo of wooden birdbox on a red brick wall with a CCTV warning on the side\" width=\"500\" /\u003e](https://www.youtube.com/channel/UCikUXkTwFvyrHlajBRQwvuw)\n\n[![GitHub license](https://img.shields.io/github/license/cmenon12/birdbox-livestream?style=flat)](https://github.com/cmenon12/birdbox-livestream/blob/master/LICENSE)\n\n## The Python Scripts\n\n#### [`yt_livestream.py`](yt_livestream.py)\n\nThis script has the livestreaming capability. When run directly, it connects to the YouTube API and creates a livestream\nwith a RTMP URL. Once it detects that you've started sending data to the livestream, it schedules broadcasts for every\nsix hours. These have complete titles, descriptions, tags, etc., and are arranged into weekly playlists. Each broadcast\nis started \u0026 stopped on schedule.\n\nThe `YouTube` class manages the connection to the API. The `YouTubeLivestream` class inherits `YouTube`, and provides\nthe full livestreaming functionality. This separation allows other scripts to use the YouTube API without directly\nmanaging any livestreams.\n\nThis runs indefinitely, and will send an email if any errors occur. Fluctuations in your internet connection (e.g. those\nthat might cause some sort of `IOError`) are handled with a delay \u0026 retry.\n\n#### [`motion_detection.py`](motion_detection.py)\n\nThis script performs motion detection on the completed broadcasts. Once a broadcast completes (new broadcasts are polled\nfor regularly) it's downloaded in 144p, motion detection is run on it, and the result is appended to the video's title \u0026\ndescription. If any motion is detected, the timestamps are added to the description and emailed to the user.\n\nThis script relies on `yt_livestream.py` for connecting to the YouTube API and sending error emails.\n\n#### [`yt_cleanup.py`](yt_cleanup.py)\n\nThis script is used to clean up old videos and weekly playlists, either by deleting them or making them private. It can\nclean up a subset of them between two specified dates. Be careful not to exceed\nthe [daily YouTube API quota](https://developers.google.com/youtube/v3/getting-started#quota) using this tool.\n\n#### [`reauth_token.py`](reauth_token.py)\n\nThis is just used to force a reauthorisation with the YouTube API and generate a brand-new refresh token.\n\n## Other Scripts\n\n#### [`stream.sh`](stream.sh)\n\nThis little bash script runs the livestreaming. It asks for the RTMP URL, and then starts capturing video\nwith `raspivid`, piping that into `ffmpeg` where it's combined with an audio file and output to the RTMP URL. If the\ncommand exits for any reason (e.g. some sort of IO error because the internet drops) it restarts after 30 seconds.\n\n## License \u0026 Attributions\n\n[GNU GPLv3](https://choosealicense.com/licenses/gpl-3.0/)\n\n[Nest icon created by iconixar - Flaticon.](https://www.flaticon.com/free-icons/nest) [CCTV icon created by Freepik - Flaticon.](https://www.flaticon.com/free-icons/cctv)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmenon12%2Fbirdbox-livestream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmenon12%2Fbirdbox-livestream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmenon12%2Fbirdbox-livestream/lists"}