Skip to content

Instantly share code, notes, and snippets.

@yoga1290
Created July 11, 2016 18:13
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save yoga1290/cb26d0020af213662a95ace91b4bc5fa to your computer and use it in GitHub Desktop.
Save yoga1290/cb26d0020af213662a95ace91b4bc5fa to your computer and use it in GitHub Desktop.
Youtube video downloader script
// go to the youtube video page using iPhone as user-agent and run the following script:
var xhr=new XMLHttpRequest();
xhr.open("GET",location.href,true);
xhr.onload=function(){
var r=xhr.responseText;
r=r.substring(r.indexOf('url_encoded_fmt_stream_map'),r.length);
r=r.substring(r.indexOf('url=http')+4,r.length);
r=r.split('url=');
location.href=
decodeURIComponent(r[0].substring(0,r[0].indexOf('\\\\')));
};
xhr.send();
@HyunGyu-Lee
Copy link

Is this work now?

@temurih
Copy link

temurih commented Oct 20, 2018

I don't think it works anymore

@dcts
Copy link

dcts commented May 18, 2020

doesnt work anymore ^^

@sumitkawale
Copy link

not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment