{"id":22691919,"url":"https://github.com/cmst0us/awslplayer","last_synced_at":"2026-04-29T17:39:46.723Z","repository":{"id":162874464,"uuid":"196742494","full_name":"CmST0us/AWSLPlayer","owner":"CmST0us","description":"iOS DD 播放器","archived":false,"fork":false,"pushed_at":"2019-08-29T16:33:34.000Z","size":320,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-04T17:52:16.917Z","etag":null,"topics":["awsl","bilibili","dd","h264","hibiki-radio","ios","line-live","multimedia","niconico","vtuber","youtube"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","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/CmST0us.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":"2019-07-13T16:23:15.000Z","updated_at":"2023-04-26T05:14:01.000Z","dependencies_parsed_at":"2023-09-02T06:45:06.286Z","dependency_job_id":null,"html_url":"https://github.com/CmST0us/AWSLPlayer","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/CmST0us%2FAWSLPlayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CmST0us%2FAWSLPlayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CmST0us%2FAWSLPlayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CmST0us%2FAWSLPlayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CmST0us","download_url":"https://codeload.github.com/CmST0us/AWSLPlayer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246215816,"owners_count":20741894,"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":["awsl","bilibili","dd","h264","hibiki-radio","ios","line-live","multimedia","niconico","vtuber","youtube"],"created_at":"2024-12-10T01:12:55.212Z","updated_at":"2026-04-29T17:39:46.670Z","avatar_url":"https://github.com/CmST0us.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 我永远喜欢...\n这是一款iOS播放器，最主要的功能就是同屏播放多个直播。\n人之初，性本D，誰でも大好き！\n项目正在开发中...\n\n当前版本`0.1`\n\nfeature:\n- [x] BiliBili 拉流逻辑\n- [ ] hls播放组件\n- [x] Youtube 拉流逻辑\n- [x] Hibiki Radio 拉流逻辑\n- [ ] NicoNico 拉流逻辑\n- [x] LineLive拉流逻辑\n- [ ] 录屏\n- [ ] 弹幕\n\n## 各大直播平台流拉取逻辑\n\n### BiliBili \n\n1. 首先获取真实房间号\nGET `https://api.live.bilibili.com/room/v1/Room/room_init?id=${roomId}`\n这里需要说明的是为什么会存在一个真实房间号。其实主要是B站大主播直播间通常是一些短房间号，需要通过请求获取真实的长房间号。其实就是类似手机长号短号的情况。\n\n2. 获取流\nGET `https://api.live.bilibili.com/api/playurl?cid=${realRoomId}\u0026otype=json\u0026quality=0\u0026platform=web`\n\n3. 拉取流\n\n### NicoNico *WIP*\n1. HTML请求获取页面配置\nGET `http://live2.nicovideo.jp/watch/lv${videoId}`\n\n2. HTML解析\n使用选择器`$('#embedded-data').attr('data-props')`获取配置JSON\n\n3. 创建WebSocket\n通过第二步获取到的JSON中的WebSocket URL`site.relive.webSocketUrl`和广播ID`program.broadcastId`创建WebSocket。\n\n4. 发送请求\n创建成功WebSocket之后发送JSON\n```JSON\n\n{\n      type: 'watch',\n      body: {\n        command: 'getpermit',\n        requirement: {\n          ${broadcastId},\n          route: '',\n          stream: {\n            protocol: 'hls',\n            requireNewStream: true,\n            priorStreamQuality: 'high',\n            isLowLatency: true\n          },\n          room: {\n            isCommentable: true,\n            protocol: 'webSocket'\n          }\n        }\n      }\n}\n\n```\n5. 接收数据\n发送请求JSON成功之后开始接收数据。收到的数据为JSON格式\n\n5.1. 收到心跳包\n当WebSocket收到对方的包的type为ping时，发送pong包作为心跳。发送的pong包格式为\n```JSON\n{\n  types: 'pong',\n  body: {}\n}\n```\n\n5.2. 收到非心跳消息包\n如果`body.command`为servertime\n发送JSON\n\n```JSON\n{\n            type: 'watch',\n            body: {\n              command: 'watching',\n              params: [${broadcastId}, '-1', '0']\n            }\n}\n```\n\n如果`body.command`为currentstream\n即可获取流地址`body.currentStream.uri`\n\n### Youtube \n1. 打开直播页面，加载Javascript引擎\nvar config = JSON.parse(ytplayer.config.args.player_response)\n得到的结果中config.streamingData.hlsManifestUrl即播放地址\n\n\n### Hibiki\n1. 请求VideoID\nGET `https://vcms-api.hibiki-radio.jp/api/v1/programs/${accessID}`\n请求中需要添加HTTP头域\n```\nX-Requested-With: XMLHttpRequest\n```\n返回JSON中的episode.video.id即为videoID\n\n2. 请求播放地址\nGET `https://vcms-api.hibiki-radio.jp/api/v1/videos/play_check?video_id=${videoID}`\n\n同样需要带上头域\n\n返回JSON中的\"playlist_url\"为播放地址\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmst0us%2Fawslplayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmst0us%2Fawslplayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmst0us%2Fawslplayer/lists"}