Plugin soundowl.com

Publicado por firecold, Noviembre 21, 2013, 01:59:35 PM

Tema anterior - Siguiente tema

firecold

Este sitio soundowl.com, genera mucho trafico en mi red, ya que es un hosting de musica en mp3:

Código (cpp) [Seleccionar]
#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 soundowl.com.so soundowl.com.cpp
// Regex
// http.*\.soundowl\.com.*(\.swf|\.jpg|\.png|\.gif|\.mp3)

string get_filename(string url) {
                vector<string> resultado;
        string retorna = "";
        stringexplode(url, "/", &resultado);
        retorna = resultado.at(resultado.size()-2) + "-"+resultado.at(resultado.size()-1);
        return retorna;
}

extern "C" resposta getmatch(const string url) {
        resposta r;       
               
  if ( (url.find("soundowl.com/") != string::npos)
     ) {
      r.file = get_filename(url);
      if (!r.file.empty()) {
         r.match = true;
         r.domain = "soundowl";       
      } else {
         r.match = false;
      }
   }
   else
   {
      r.match = false;
   }
   return r;
}


Saludos