Openload to VLC(recursion)

Opens VLC from Openload stream

目前為 2017-10-24 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Openload to VLC(recursion)
// @namespace    http://tampermonkey.net/
// @version      0.6
// @description  Opens VLC from Openload stream
// @author       mattiadr, giuseppe-dandrea
// @match        http*://openload.co/*
// @match        http*://turbovid.me/*
// @match        http*://www.flashx.to/*
// @match        http*://www.rapidvideo.com/*
// @match        http*://wstream.video/*
// @grant        window.close
// @grant        GM_openInTab
// ==/UserScript==

var url = null;

if (window.location.href.indexOf('openload.co') != -1) {
    $('#videooverlay').trigger('click');
    url = $('#olvideo_html5_api')[0].src;
}

else if (window.location.href.indexOf('turbovid.me') != -1) {
    $('html').removeClass(" js ");
    if ($('#video-content').size() === 0) {
        $('#container > h2').append("<h1 style=\"color:red;\">WAIT AND CLICK ON BUTTON</h1>");
        //new Promise((resolve) => setTimeout(resolve, 9000)).then(() => {
        //    $('#btn_download').trigger('click');
        //});
    } else {
        $('#content > h2').append("<h1 style=\"color:red;\">CLICK ON VIDEO TO START VLC</h1>");
        wait_until_video_click();
        }
    }

else if (window.location.href.indexOf('flashx.to') != -1) {
    if ($('video').size() === 0) {
        $('#main > center > h2').append("<h1 style=\"color:red;\">WAIT, THE BUTTON WILL BE PRESSED AUTOMATICALLY</h1>");
        new Promise((resolve) => setTimeout(resolve, 6000)).then(() => {
            $('#btn_download').trigger('click');
        });
    } else {
        new Promise((resolve) => setTimeout(resolve, 2000)).then(() => {
            url = $('video')[0].src;
            play_url(url);
        });
    }
}
else if (window.location.href.indexOf('rapidvideo.com') != -1) {
    url = $('video')[0].src;
}

else if (window.location.href.indexOf('wstream.video') != -1) {
    $('#video-content > table > tbody > tr > td:nth-child(1) > h3').append("<h1 style=\"color:red;\">CLICK ON VIDEO TO START VLC</h1>");
    wait_until_video_click();
}


play_url(url);

function play_url(url) {
    if (url !== null) {
        window.open('vlcs:' + url, '_self');
        new Promise((resolve) => setTimeout(resolve, 200)).then(() => {
            //Comment the next line to be able  authorize xdg-open
            window.close();
        });
    }
}

function wait_until_video_click() {
    new Promise((resolve) => setTimeout(resolve, 1000)).then(() => {
        if ($('video')[0].src.indexOf('http') != -1) {
            url = $('video')[0].src;
            play_url(url);
        } else {
              wait_until_video_click();
        }
        });
}