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
Save lekoOwO/9496093f3c5ada563ce2b616932dbf9e to your computer and use it in GitHub Desktop.
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