{"id":19295815,"url":"https://github.com/waldoj/moonstriker","last_synced_at":"2025-04-22T08:30:54.579Z","repository":{"id":65949911,"uuid":"585940524","full_name":"waldoj/moonstriker","owner":"waldoj","description":"Turn a video into per-caption clips and periodically post clips to Mastodon.","archived":false,"fork":false,"pushed_at":"2024-03-24T15:00:01.000Z","size":54,"stargazers_count":7,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-17T03:02:29.445Z","etag":null,"topics":["mastodon","video"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/waldoj.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}},"created_at":"2023-01-06T14:01:12.000Z","updated_at":"2024-05-31T01:13:28.000Z","dependencies_parsed_at":"2024-01-13T17:13:17.734Z","dependency_job_id":"95873cd0-7b4e-45fc-8983-b09e385d450b","html_url":"https://github.com/waldoj/moonstriker","commit_stats":{"total_commits":52,"total_committers":1,"mean_commits":52.0,"dds":0.0,"last_synced_commit":"86aefe8d072be8c5db092ef7e979fd117e6a2a60"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waldoj%2Fmoonstriker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waldoj%2Fmoonstriker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waldoj%2Fmoonstriker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waldoj%2Fmoonstriker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waldoj","download_url":"https://codeload.github.com/waldoj/moonstriker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250206053,"owners_count":21392175,"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":["mastodon","video"],"created_at":"2024-11-09T22:44:31.248Z","updated_at":"2025-04-22T08:30:54.326Z","avatar_url":"https://github.com/waldoj.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Moonstriker\nA pair of Bash scripts to divide up a video into chunks—one per caption—and then post them to Mastodon, e.g. as a bot. This is designed to post MP4s, but with some tweaks it can post any asset (e.g. images, audio). It was created for excerpts of _Moonstruck,_ hence the name.\n\nThe video processor iterates through each caption in an SRT file and, for each one, saves that clip from the associated video. The Mastodon bot gets a file listing from an S3 bucket, randomly selects one of the files, and posts it to Mastodon.\n\n## Setup\n\n### Video processor\n\n* Prerequisite: a video file that contains captions and an SRT file of those captions\n* Ensure that ffmpeg is installed\n* If running this on macOS 13.1 or older, the version of `date` that ships with it doesn't support sub-second accuracy. Install GNU date via `brew install coreutils` and change the `date` reference in `processor.sh` to `gdate`.\n* Configure `processor.sh` to use the correct filenames for the two files (or name them `video.m4v` and `captions.srt`)\n\n### Mastodon bot\n\n* Ensure that ffmpeg, cURL, and AWS CLI are installed, and that the account is configured to have permission to retrieve files from S3\n* Create a new application in your Mastodon account’s settings, giving it `write:statuses` and `write:media` permissions (no other permissions are required), and note the application’s access token\n* Put your video clips into a dedicated S3 bucket (or a dedicated directory within an S3 bucket)\n* Configure the three variables in the header of `mastobot.sh`: `MASTODON_SERVER`, `MASTODON_TOKEN`, and `S3_BUCKET`\n* Create a new cron task to run `mastobot.sh` periodically\n\n## Use\n* Run `processor.sh` and `clips/` will be filled up with incrementally numbered files, which must be uploaded to an S3 bucket to be accessible to the bot\n* Run `mastobot.sh` and it will post a single video clip to Mastodon\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaldoj%2Fmoonstriker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaldoj%2Fmoonstriker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaldoj%2Fmoonstriker/lists"}