Para todos los amigos y visitantes del foro de Alterserv, posteo el plugin de http://promodj.com, el cual tiene mucha musica en mp3 y videos de cualquier tipo de musica, creo que les gustara:
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include "../utils.cpp"
using namespace std;
// use this line to compile
// g++ -I. -fPIC -shared -g -o promodj.com.so promodj.com.cpp
// regex
// http.*\.promodj\.com.*(\.jpg|\.png|\.gif|\.mp3|\.swf|\.flv|\.exe|\.rar|\.zip|\.wav|\.mp4|\.m4v|\.x-m4v)
// http.*promodj\.com.*(\.jpg|\.png|\.gif|\.mp3|\.swf|\.flv|\.exe|\.rar|\.zip|\.wav|\.mp4|\.m4v|\.x-m4v)
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(".promodj.com/") != string::npos)
) {
r.file = get_filename(url);
if (!r.file.empty()) {
r.match = true;
r.domain = "promodj";
} else {
r.match = false;
}
}
else if ( (url.find("promodj.com/") != string::npos) and ((url.find(".jpg") != string::npos) or (url.find(".png") != string::npos))
) {
r.file = get_filename(url);
if (!r.file.empty()) {
r.match = true;
r.domain = "promodj.com";
} else {
r.match = false;
}
}
else
{
r.match = false;
}
return r;
}
Disfrutenlo, Saludos
Gracias a nuestro moderador Luistec, se hizo cambio en algunos regex, siendo este el caso del plugin de promodj.com, que dando de este modo:
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include "../utils.cpp"
using namespace std;
// use this line to compile
// g++ -I. -fPIC -shared -g -o promodj.com.so promodj.com.cpp
// regex
// http.*(promodj|\.promodj)\.com/.*(\.jpg|\.png|\.gif|\.mp3|\.swf|\.flv|\.exe|\.rar|\.zip|\.wav|\.mp4|\.m4v|\.x-m4v)
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(".promodj.com/") != string::npos)
) {
r.file = get_filename(url);
if (!r.file.empty()) {
r.match = true;
r.domain = "promodj";
} else {
r.match = false;
}
}
else if ( (url.find("promodj.com/") != string::npos) and ((url.find(".jpg") != string::npos) or (url.find(".png") != string::npos))
) {
r.file = get_filename(url);
if (!r.file.empty()) {
r.match = true;
r.domain = "promodj.com";
} else {
r.match = false;
}
}
else
{
r.match = false;
}
return r;
}
Saludos
Plugin funcionando sin problemas, pero siempre y cuando halla problemas favor reportar, Saludos