Alterserv

ThunderCache 3.1.x => Plugins para ThunderCache 3.1.2 => Plugins de música & videos => Mensaje publicado por: gildope en Enero 31, 2013, 08:02:14 PM

Título: Plugin Tube8.com
Publicado por: gildope en Enero 31, 2013, 08:02:14 PM
#include <iostream>
#include <cstring>
#include <vector>
#include "../utils.cpp"

// use this line to compile
// g++ -I. -fPIC -shared -g -o tube8.com.so tube8.com.cpp
//regex
//http.*\.tube8\.com.*(\.flv|\.mp4)

string get_filename(string url) {
vector<string> resultado;
if (url.find("?") != string::npos) {
stringexplode(url, "?", &resultado);
stringexplode(resultado.at(resultado.size()-2), "/", &resultado);
return resultado.at(resultado.size()-1);           
} else {
stringexplode(url, "/", &resultado);
return resultado.at(resultado.size()-1);
}
}

extern "C" resposta getmatch(const string url) {
    resposta r;

if ( (url.find(".tube8.com/") != string::npos)  and
(url.find(".mp4") != string::npos) and (url.find("?start=") == string::npos) // tirar start para nao fazer cache de file incompleto
) {

    r.file = get_filename(url);
if (!r.file.empty()) {
r.match = true;
r.domain = "tube8";
} else {
r.match = false;
}
} else {
r.match = false;
}
return r;
}
Título: Re:Plugin Tube8.com
Publicado por: willysantana en Febrero 01, 2013, 11:22:44 AM
hola amigo, este plugin esta probado?

mil gracias.
Título: Re:Plugin Tube8.com
Publicado por: gildope en Febrero 01, 2013, 03:07:46 PM
Sí, funciona.