plugin para bloquear la publicidad youtube

Publicado por gildope, Abril 21, 2013, 06:37:00 PM

Tema anterior - Siguiente tema

gildope

doubleclick.net.cpp

#include <iostream>
#include <cstring>
#include <vector>
#include "../utils.cpp"

using namespace std;

// use this line to compile
// g++ -I. -fPIC -shared -g -o doubleclick.net.so doubleclick.net.cpp
// regex
// http.{1,4}\w*google(\.\w|\w)*\.doubleclick\.net\/pagead\/ads\?.*

extern "C" resposta getmatch(const string url) {
    resposta r;
   
   string find = "";
   string find2 = "";
   int len;
   if(url.find("www.youtube.com") != string::npos) {
      if ( ( (find = regex_match("[\\?&]ad_type=skippablevideo($|&)",url)) != "" || (find = regex_match("[\\?&]ad_type=video($|&)",url)) != "" || (find = regex_match("[\\?&]ad_type=text_image_flash($|&)",url)) != "" || (find = regex_match("[\\?&]ad_type=text($|&)",url)) != "" || (find = regex_match("[\\?&]ad_type=image($|&)",url)) != "" ) && ( (find2 = regex_match("[\\?&]url=http.{2,15}www.youtube.com([a-zA-Z0-9]|%|-|_)*&?",url)) != "" ) ) {
         r.domain = "rewrite";
         r.file = "googleads.g.doubleclick.net/pagead/ads";
         r.match = true;
         return r;
      }
   }
   r.match = false;
    return r;
}

pancho_sc

hola amigo perdona mi ignorancia ya que soy nuevo donde se pega estos codigos?? saludos

willysantana

Cita de: gildope en Abril 21, 2013, 06:37:00 PM
doubleclick.net.cpp

#include <iostream>
#include <cstring>
#include <vector>
#include "../utils.cpp"

using namespace std;

// use this line to compile
// g++ -I. -fPIC -shared -g -o doubleclick.net.so doubleclick.net.cpp
// regex
// http.{1,4}\w*google(\.\w|\w)*\.doubleclick\.net\/pagead\/ads\?.*

extern "C" resposta getmatch(const string url) {
    resposta r;
   
   string find = "";
   string find2 = "";
   int len;
   if(url.find("www.youtube.com") != string::npos) {
      if ( ( (find = regex_match("[\\?&]ad_type=skippablevideo($|&)",url)) != "" || (find = regex_match("[\\?&]ad_type=video($|&)",url)) != "" || (find = regex_match("[\\?&]ad_type=text_image_flash($|&)",url)) != "" || (find = regex_match("[\\?&]ad_type=text($|&)",url)) != "" || (find = regex_match("[\\?&]ad_type=image($|&)",url)) != "" ) && ( (find2 = regex_match("[\\?&]url=http.{2,15}www.youtube.com([a-zA-Z0-9]|%|-|_)*&?",url)) != "" ) ) {
         r.domain = "rewrite";
         r.file = "googleads.g.doubleclick.net/pagead/ads";
         r.match = true;
         return r;
      }
   }
   r.match = false;
    return r;
}


hola amigo me podrías decir cual es la publicidad que elimina este plugin.

rogerio

Remember, this plugin is made for haarpcache - Licence GPL :)

luistec

Cita de: rogerio en Mayo 08, 2013, 09:30:22 AM
Remember, this plugin is made for haarpcache - Licence GPL :)

Este plugin es un fix de uno que ya habia en el thunder 3.1
Código (cpp) [Seleccionar]

/*
* (c) Copyright 2009 Rodrigo Medeiros (rodrigomanga) <rodrigomanga@yahoo.com.br>. Some Rights Reserved.
* @autor Rodrigo Medeiros (rodrigomanga) <rodrigomanga@yahoo.com.br>
*/

#include <iostream>
#include <cstring>
#include <vector>
#include "../utils.cpp"

// use this line to compile
// g++ -I. -fPIC -shared -g -o doubleclick.net.so doubleclick.net.cpp  

string rewriteurl(string url) {
string banner = "zion2.zionlanhouse.com.br:8080/msn.htm";

if ( url.find("doubleclick.net/pagead/ads?") != string::npos ){
url = banner;
return url;
} else
return "";
}

extern "C" resposta getmatch(const string url) {
   resposta r;
r.file = rewriteurl(url);
if (!r.file.empty()) {
r.match = true;
r.domain = "rewrite";
} else {
r.match = false;
}
return r;
}