Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

youtube to mp4 stackoverflow

var links = new String();
var downlink = new String();
var has22 = new Boolean();
has22 = false;
var Marked = false;

var FMT_DATA = fmt_url_map;//This is html text that you have to grab. In case of extension it was readily available through:document.getElementsByTagName('script');

var StrSplitter1 = '%2C', StrSplitter2 = '%26', StrSplitter3 = '%3D';
if (FMT_DATA.indexOf(',') > -1) { //Found ,
    StrSplitter1 = ',';
    StrSplitter2 = (FMT_DATA.indexOf('&') > -1) ? '&' : 'u0026';
    StrSplitter3 = '=';
}

var videoURL = new Array();
var FMT_DATA_PACKET = new Array();
var FMT_DATA_PACKET = FMT_DATA.split(StrSplitter1);

for (var i = 0; i < FMT_DATA_PACKET.length; i++) {
    var FMT_DATA_FRAME = FMT_DATA_PACKET[i].split(StrSplitter2);
    var FMT_DATA_DUEO = new Array();

    for (var j = 0; j < FMT_DATA_FRAME.length; j++) {
        var pair = FMT_DATA_FRAME[j].split(StrSplitter3);
        if (pair.length == 2) {
            FMT_DATA_DUEO[pair[0]] = pair[1];
        }
    }

    var url = (FMT_DATA_DUEO['url']) ? FMT_DATA_DUEO['url'] : null;

    if (url == null) continue;
    url = unescape(unescape(url)).replace(///g, '/').replace(/u0026/g, '&');
    var itag = (FMT_DATA_DUEO['itag']) ? FMT_DATA_DUEO['itag'] : null;
    var itag = (FMT_DATA_DUEO['itag']) ? FMT_DATA_DUEO['itag'] : null;
    if (itag == null) continue;
    var signature = (FMT_DATA_DUEO['sig']) ? FMT_DATA_DUEO['sig'] : null;
    if (signature != null) {
        url = url + "&signature=" + signature;
    }
    if (url.toLowerCase().indexOf('http') == 0) { // validate URL 

        if (itag == '5') {
            links += '<a href="' + url + '&title=' + username + title + quality240 + '"style="text-decoration:none"><span class="yt-uix-button-menu-item" id="v240p">FLV (240p)</span></a>';
        }
        if (itag == '18') {
            links += '<a href="' + url + '&title=' + username + title + quality360 + '"style="text-decoration:none"><span class="yt-uix-button-menu-item" id="v360p">MP4 (360p)</span></a>';
        }
        if (itag == '35') {
            links += '<a href="' + url + '&title=' + username + title + quality480 + '"style="text-decoration:none"><span class="yt-uix-button-menu-item" id="v480p">FLV (480p)</span></a>';
        }
        if (itag == '22') {
            links += '<a href="' + url + '&title=' + username + title + quality720 + '"style="text-decoration:none"><span class="yt-uix-button-menu-item" id="v720p">MP4 HD (720p)</span></a>';
        }
        if (itag == '37') {
            links += ' <a href="' + url + '&title=' + username + title + quality1080 + '"style="text-decoration:none"><span class="yt-uix-button-menu-item" id="v1080p">MP4 HD (1080p)</span></a>';
        }
        if (itag == '38') {
            links += '<a href="' + url + '&title=' + username + title + quality4k + '"style="text-decoration:none"><span class="yt-uix-button-menu-item"  id="v4k">MP4 HD (4K)</span></a>';
        }

        FavVideo();
        videoURL[itag] = url;
        console.log(itag);
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: coin flip random java 
Java :: add new item to array java 
Java :: print zpl from java 
Java :: ex: java loop 
Java :: list in list 
Java :: sum of no 
Java :: java mcq test 
Java :: enable GPS inside of application 
Java :: int in double umwandeln java 
Java :: java test coverage 
Java :: pack in swing 
Java :: Java TestNG Data Provider 
Java :: jmonkey shapes 
Java :: springBoot Register a Custom Auto-Configuration 
Java :: zweidimensionales array erstellen java 
Java :: printing array in descending order 
Java :: gradle project load test data json file with jackson 
Java :: conexion a mysql java 
Java :: java.lang.String cannot be cast to java.util.Map 
Java :: java how to slit a dtring and trim at the same time 
Java :: hybrid inheritance in java 
Java :: sorted hashmap java 
Java :: aabb collision java 
Java :: android studio bring keyboard up 
Java :: 13 live 
Java :: calculate values of array 
Java :: Java 8 merge multiple collections. 
Java :: time in java 
Java :: find center of screen graphic g 
Java :: How to pass ArrayList of Objects from one to another activity using Intent in android? 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =