Fri. Nov 8th, 2019

Host your Website

Read and learn

FatCow Plan for $3.15/mo. only

Downloading Youtube video via Javascript

1 min read



go to the youtube video page using iPhone as user-agent and run the following script:

https://gist.github.com/yoga1290/cb26d0020af213662a95ace91b4bc5fa

2 thoughts on “Downloading Youtube video via Javascript

  1. Is this working?

    var xhr=new XMLHttpRequest();
    xhr.open("GET", prompt("url", 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=");

    console.log("Best Cuality");
    console.log(decodeURIComponent(r[0].substring(0, r[0].indexOf("\\"))));
    console.log("Lower Cuality");
    console.log(decodeURIComponent(r[0].substring(0, r[1].indexOf("\\"))));
    console.log("Lower Cuality");
    console.log(decodeURIComponent(r[0].substring(0, r[2].indexOf("\\"))));
    };
    xhr.send();

Comments are closed.

Copyright © All rights reserved. | Newsphere by AF themes.