{"id":19703617,"url":"https://github.com/monibuca/plugin-hook","last_synced_at":"2025-04-29T14:30:56.805Z","repository":{"id":57709538,"uuid":"490590000","full_name":"Monibuca/plugin-hook","owner":"Monibuca","description":"WebHook For Monibuca","archived":false,"fork":false,"pushed_at":"2024-04-03T09:41:54.000Z","size":30,"stargazers_count":1,"open_issues_count":2,"forks_count":6,"subscribers_count":1,"default_branch":"v4","last_synced_at":"2025-04-05T17:51:10.006Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/Monibuca.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}},"created_at":"2022-05-10T07:34:11.000Z","updated_at":"2023-02-02T07:42:28.000Z","dependencies_parsed_at":"2024-11-11T21:18:37.616Z","dependency_job_id":"4db7de66-c96c-43f6-a87a-ea67d7bd4eaf","html_url":"https://github.com/Monibuca/plugin-hook","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monibuca%2Fplugin-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monibuca%2Fplugin-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monibuca%2Fplugin-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monibuca%2Fplugin-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Monibuca","download_url":"https://codeload.github.com/Monibuca/plugin-hook/tar.gz/refs/heads/v4","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251518891,"owners_count":21602231,"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-11-11T21:18:28.827Z","updated_at":"2025-04-29T14:30:55.183Z","avatar_url":"https://github.com/Monibuca.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hook 插件\n\nWebHook For Monibuca\n\n## 插件地址\n\nhttps://github.com/Monibuca/plugin-hook\n\n## 插件引入\n\n```go\nimport (\n    _ \"m7s.live/plugin/hook/v4\"\n)\n```\n\n## 配置\n\n```yaml\nhook:\n  keepalive: 0 # 定时发送心跳请求，单位秒，默认0不开启\n  retrytimes: 3 # 重试次数\n  baseurl: \"\" # url前缀\n  header: {} # 自定义HTTP请求头\n  requestlist: {} # 请求列表\n  extra: {} # 额外自定义传输数据\n```\n### 简单配置\n\n```yaml\nhook:\n  requestlist:\n    \"*\": \"http://www.example.com\" # 任意时间均会发送请求\n    startup: \"http://www.example.com\" # m7s启动时发送请求\n    publish: \"http://www.example.com/publish\" # 发布时发送请求\n    subscribe: \"http://www.example.com/subscribe\" # 订阅时发送请求\n    unsubscribe: \"http://www.example.com/unsubscribe\" # 取消订阅时发送请求\n    streamClose: \"http://www.example.com/streamClose\" # 流关闭时发送请求\n    keepalive: \"http://www.example.com/keepalive\" # 心跳时发送请求\n```\n\n### 完整配置\n\n```yaml\nhook:\n  requestlist:\n    \"*\":\n      method: GET\n      header:\n        referer: http://www.example.com\n      url: \"http://www.example.com\"\n```\n\n## 发送请求数据\n\n默认使用 POST 发送一个 json 数据：\n\n```json\n{\n  \"stream\": {\n    \"StartTime\": \"0001-01-01T00:00:00Z\",\n    \"WaitTimeout\": 10000000000,\n    \"PublishTimeout\": 10000000000,\n    \"WaitCloseTimeout\": 0,\n    \"Path\": \"live/test\",\n    \"Publisher\": {\n      \"ID\": \"\",\n      \"Type\": \"RTMPReceiver\",\n      \"StartTime\": \"2022-05-03T13:00:22.5353264+08:00\",\n      \"Args\": {},\n      \"StreamID\": 1\n    },\n    \"State\": 1,\n    \"Subscribers\": [\n      {\n        \"ID\": \"\",\n        \"Type\": \"RTSPSubscriber\",\n        \"StartTime\": \"2022-05-03T13:00:23.8753554+08:00\",\n        \"Args\": {}\n      }\n    ],\n    \"Tracks\": {\n      \"aac\": {\n        \"Name\": \"aac\",\n        \"BPS\": 72480,\n        \"SampleRate\": 44100,\n        \"SampleSize\": 16,\n        \"CodecID\": 10,\n        \"Channels\": 2,\n        \"AVCCHead\": \"rwE=\",\n        \"Profile\": 2\n      },\n      \"h264\": {\n        \"Name\": \"h264\",\n        \"BPS\": 2226142,\n        \"SampleRate\": 90000,\n        \"SampleSize\": 0,\n        \"CodecID\": 7,\n        \"SPSInfo\": {\n          \"ProfileIdc\": 66,\n          \"LevelIdc\": 31,\n          \"MbWidth\": 80,\n          \"MbHeight\": 45,\n          \"CropLeft\": 0,\n          \"CropRight\": 0,\n          \"CropTop\": 0,\n          \"CropBottom\": 0,\n          \"Width\": 1280,\n          \"Height\": 720\n        },\n        \"GOP\": 27\n      }\n    },\n    \"AppName\": \"live\",\n    \"StreamName\": \"test\"\n  },\n  \"extra\": {},\n  \"event\": \"publish\",\n  \"time\": 1257894000\n}\n```\n\n如果指定为 GET 方法，则不会发送 json\n而是将 event 和 streamPath 加在 url 后面\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonibuca%2Fplugin-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonibuca%2Fplugin-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonibuca%2Fplugin-hook/lists"}