{"action":"created","issue":{"url":"https://api.github.com/repos/czp3009/bilibili-api/issues/4","repository_url":"https://api.github.com/repos/czp3009/bilibili-api","labels_url":"https://api.github.com/repos/czp3009/bilibili-api/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/czp3009/bilibili-api/issues/4/comments","events_url":"https://api.github.com/repos/czp3009/bilibili-api/issues/4/events","html_url":"https://github.com/czp3009/bilibili-api/issues/4","id":300462929,"number":4,"title":"小电视抽奖, 丰收庆典, 新春抽奖 等的执行过程","user":{"login":"czp3009","id":17246126,"avatar_url":"https://avatars1.githubusercontent.com/u/17246126?v=4","gravatar_id":"","url":"https://api.github.com/users/czp3009","html_url":"https://github.com/czp3009","followers_url":"https://api.github.com/users/czp3009/followers","following_url":"https://api.github.com/users/czp3009/following{/other_user}","gists_url":"https://api.github.com/users/czp3009/gists{/gist_id}","starred_url":"https://api.github.com/users/czp3009/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/czp3009/subscriptions","organizations_url":"https://api.github.com/users/czp3009/orgs","repos_url":"https://api.github.com/users/czp3009/repos","events_url":"https://api.github.com/users/czp3009/events{/privacy}","received_events_url":"https://api.github.com/users/czp3009/received_events","type":"User","site_admin":false},"labels":[{"id":742969141,"url":"https://api.github.com/repos/czp3009/bilibili-api/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":742969150,"url":"https://api.github.com/repos/czp3009/bilibili-api/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":83,"created_at":"2018-02-27T01:44:07Z","updated_at":"2018-03-13T06:42:36Z","closed_at":null,"author_association":"OWNER","body":"在弹幕推送 socket 中, 小电视抽奖通知对应 SYS_MSG, 数据包差不多如下\r\n```\r\n{\r\n  \"cmd\": \"SYS_MSG\",\r\n  \"msg\": \"\\u3010\\u5e7d\\u5c0f\\u591c\\u5929\\u5c0f\\u52ab\\u3011:?\\u5728\\u76f4\\u64ad\\u95f4:?\\u3010392\\u3011:?\\u8d60\\u9001 \\u5c0f\\u7535\\u89c6\\u4e00\\u4e2a\\uff0c\\u8bf7\\u524d\\u5f80\\u62bd\\u5956\",\r\n  \"msg_text\": \"\\u3010\\u5e7d\\u5c0f\\u591c\\u5929\\u5c0f\\u52ab\\u3011:?\\u5728\\u76f4\\u64ad\\u95f4:?\\u3010392\\u3011:?\\u8d60\\u9001 \\u5c0f\\u7535\\u89c6\\u4e00\\u4e2a\\uff0c\\u8bf7\\u524d\\u5f80\\u62bd\\u5956\",\r\n  \"rep\": 1,\r\n  \"styleType\": 2,\r\n  \"url\": \"http:\\/\\/live.bilibili.com\\/392\",\r\n  \"roomid\": 392,\r\n  \"real_roomid\": 71084,\r\n  \"rnd\": 44332151,\r\n  \"tv_id\": \"29349\"\r\n}\r\n```\r\n\r\n丰收庆典以及新春抽奖等普通抽奖对应 SYS_GIFT\r\n```\r\n{\r\n  \"cmd\": \"SYS_GIFT\",\r\n  \"msg\": \"sakamakiryoryo\\u5728\\u76f4\\u64ad\\u95f471084\\u5f00\\u542f\\u4e86\\u4e30\\u6536\\u796d\\u5178\\uff0c\\u4e00\\u8d77\\u6765\\u5206\\u4eab\\u6536\\u83b7\\u7684\\u798f\\u5229\\u5427\\uff01\",\r\n  \"msg_text\": \"sakamakiryoryo\\u5728\\u76f4\\u64ad\\u95f471084\\u5f00\\u542f\\u4e86\\u4e30\\u6536\\u796d\\u5178\\uff0c\\u4e00\\u8d77\\u6765\\u5206\\u4eab\\u6536\\u83b7\\u7684\\u798f\\u5229\\u5427\\uff01\",\r\n  \"tips\": \"sakamakiryoryo\\u5728\\u76f4\\u64ad\\u95f471084\\u5f00\\u542f\\u4e86\\u4e30\\u6536\\u796d\\u5178\\uff0c\\u4e00\\u8d77\\u6765\\u5206\\u4eab\\u6536\\u83b7\\u7684\\u798f\\u5229\\u5427\\uff01\",\r\n  \"url\": \"http:\\/\\/live.bilibili.com\\/71084\",\r\n  \"roomid\": 71084,\r\n  \"real_roomid\": 71084,\r\n  \"giftId\": 102,\r\n  \"msgTips\": 0\r\n}\r\n```\r\n\r\nACTIVITY_EVENT 带有某种活动的进度信息\r\n```\r\n{\r\n  \"cmd\": \"ACTIVITY_EVENT\",\r\n  \"data\": {\r\n    \"keyword\": \"newspring_2018\",\r\n    \"type\": \"cracker\",\r\n    \"limit\": 300000,\r\n    \"progress\": 158912\r\n  }\r\n}\r\n```\r\n\r\n小电视和普通抽奖的通知都会带有一个 URL, 在 web 上进入这个 URL, 点击悬浮窗即可抽奖.\r\n\r\n尚不明确 Android 上看直播时有没有 SYS_MSG 和 SYS_GIFT 的提示(印象中好像没见到过).\r\n\r\n尚不明确 Android 上参与抽奖的 API(是一个 Restful API, 不是发弹幕, 发弹幕只是副作用)(不太清楚 Android 上能不能抽奖).\r\n\r\n抽奖之后开奖有两种, 一种是 socket 内直接推送的大奖获得者信息(例如 TV_END)(不明确除了小电视抽奖, 其他普通抽奖会不会有类似的大奖推送).\r\n\r\n另一种是通过 Restful API 拉取的奖励(参与抽奖至少有辣条, 所以人人都有), 这在 Android 上的 API 是怎么样的也不明确(如果 Android 不能抽奖的话那这个 API 也肯定是没有的).\r\n\r\n以上问题尚未解决, 先留存案.\r\n"},"comment":{"url":"https://api.github.com/repos/czp3009/bilibili-api/issues/comments/372562832","html_url":"https://github.com/czp3009/bilibili-api/issues/4#issuecomment-372562832","issue_url":"https://api.github.com/repos/czp3009/bilibili-api/issues/4","id":372562832,"user":{"login":"czp3009","id":17246126,"avatar_url":"https://avatars1.githubusercontent.com/u/17246126?v=4","gravatar_id":"","url":"https://api.github.com/users/czp3009","html_url":"https://github.com/czp3009","followers_url":"https://api.github.com/users/czp3009/followers","following_url":"https://api.github.com/users/czp3009/following{/other_user}","gists_url":"https://api.github.com/users/czp3009/gists{/gist_id}","starred_url":"https://api.github.com/users/czp3009/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/czp3009/subscriptions","organizations_url":"https://api.github.com/users/czp3009/orgs","repos_url":"https://api.github.com/users/czp3009/repos","events_url":"https://api.github.com/users/czp3009/events{/privacy}","received_events_url":"https://api.github.com/users/czp3009/received_events","type":"User","site_admin":false},"created_at":"2018-03-13T06:42:36Z","updated_at":"2018-03-13T06:42:36Z","author_association":"OWNER","body":"说起来, 我以前也是先研究的 Web API.\r\n\r\nWeb API 中的 socket, 是固定端口 778, 客户端的可能是有 CDN 的, 端口要从房间的信息里面拿.\r\n\r\n然后 Socket 里面的数据包的结构, 和 Web 端的, 有些是不一样的, 具体哪些是不一样的我也没特别统计, 但是我可以确定有一些是不一样的."}}
{"actor":{"display_login":"czp3009"}}