This commit is contained in:
parent
f6b708b247
commit
601ff195ff
@ -7,8 +7,9 @@
|
||||
"48": "icon-48.png",
|
||||
"128": "icon-128.png"
|
||||
},
|
||||
"version": "102.0",
|
||||
"version": "104.0",
|
||||
"manifest_version": 3,
|
||||
"host_permissions": ["http://127.0.0.1:8083/jsonrpc", "http://127.0.0.1:8080/jsonrpc"],
|
||||
"permissions": ["tabs"],
|
||||
"action": {
|
||||
"default_title": "Proxy Stream",
|
||||
|
@ -40,7 +40,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
newurl = new URL("plugin://plugin.video.youtube")
|
||||
search.append("action", "play_video")
|
||||
let video_id = oldurl.searchParams.get("v");
|
||||
if(newpath) {
|
||||
if(video_id) {
|
||||
search.append("videoid", video_id)
|
||||
}
|
||||
}
|
||||
@ -49,18 +49,35 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
let req = {
|
||||
jsonrpc: "2.0",
|
||||
method: "Player.Open",
|
||||
id: secrets.token_hex(),
|
||||
id: 12345,
|
||||
params: {
|
||||
item: {
|
||||
file: newurl.href
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
fetch("http://127.0.0.1:8080/jsonrpc", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(req),
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8"
|
||||
}
|
||||
}).then(resp => console.log(resp))
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
}
|
||||
try {
|
||||
fetch("http://127.0.0.1:8083/jsonrpc", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(req)
|
||||
body: JSON.stringify(req),
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8"
|
||||
}
|
||||
}).then(resp => console.log(resp))
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user