可否给猫抓增加一个 External API?

#1049 · open · 4 comments

View on GitHub ↗

luvchippy

** 详细描述想要添 加/修改/增强 的功能 ** 例如: chrome.runtime.sendMessage( CAT_CATCH_EXTENSION_ID, { action: "getCurrentVideo" } )

Comments

xifangczy

getCurrentVideo ?你想返回啥

luvchippy

感谢回复!我的想法是让其他浏览器扩展可以通过 External API 获取猫抓在当前 Tab 已经捕获到的视频/音频资源信息,不需要猫抓帮忙下载或处理视频。 getCurrentVideo 这个名字可能不够准确,也可以叫 getCurrentMedia。

luvchippy

我期望类似: chrome.runtime.sendMessage( CAT_CATCH_EXTENSION_ID, { action: "getCurrentMedia" }, (result) => { console.log(result) } ) 返回值可以类似: { "tabId": 123, "pageUrl": "https://www.bilibili.com/video/xxx", "title": "视频标题", "media": [ { "url": "https://xxx/video.m4s", "type": "video", "mimeType": "video/mp4", "ext": "m4s", "size": 12345678, "referer": "https://www.bilibili.com/", "origin": "https://www.bilibili.com" }, { "url": "https://xxx/audio.m4s", "type": "audio", "mimeType": "audio/mp4" } ] }