Skip to content

Instantly share code, notes, and snippets.

@lekoOwO
Last active June 29, 2021 20:21
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Get m3u8 link for a youtube stream
javascript:(async()=>{try{const t=await fetch(location.href),a=await t.text(),r=/"hlsManifestUrl":"([^"]+)/,e=a.match(r)[1];navigator.clipboard.writeText(e),alert("Copied!")}catch(t){console.error(t),alert("Error!")}})();
(async () => {
try {
const resp = await fetch(location.href);
const html = await resp.text()
const regex = /"hlsManifestUrl":"([^"]+)/;
const match = html.match(regex);
const result = match[1];
navigator.clipboard.writeText(result);
alert("Copied!")
} catch (e) {
console.error(e)
alert("Error!")
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment