Last active
December 21, 2021 03:18
-
-
Save seanconrad1/31ade5c258ec3d626763b79da8130528 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let params = args.queryParameters; | |
let input = params["input"]; | |
let wv = new WebView(); | |
await wv.loadURL(input); | |
await wv.waitForLoad(); | |
let js = ` | |
document.querySelector('video').src; | |
` | |
let output = await wv.evaluateJavaScript(js); | |
let data = Data.fromString(output); | |
let base64 = data.toBase64String(); | |
let baseURL = params["x-success"]; | |
let url = baseURL + "?base64=" + encodeURI(base64); | |
Safari.open(url); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment