Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/alterser/public_html/foros/Sources/Subs.php on line 3847

Notice: Trying to access array offset on value of type null in /home/alterser/public_html/foros/Sources/Load.php on line 168

Deprecated: Function create_function() is deprecated in /home/alterser/public_html/foros/Sources/Load.php on line 178

Deprecated: Function create_function() is deprecated in /home/alterser/public_html/foros/Sources/Load.php on line 183

Deprecated: Function create_function() is deprecated in /home/alterser/public_html/foros/Sources/Load.php on line 184

Deprecated: Function create_function() is deprecated in /home/alterser/public_html/foros/Sources/Load.php on line 220

Deprecated: Function create_function() is deprecated in /home/alterser/public_html/foros/Sources/Load.php on line 223

Deprecated: Function create_function() is deprecated in /home/alterser/public_html/foros/Sources/Load.php on line 235

Deprecated: Function create_function() is deprecated in /home/alterser/public_html/foros/Sources/Load.php on line 250

Deprecated: Function create_function() is deprecated in /home/alterser/public_html/foros/Sources/Load.php on line 268
Video not cache for xhamster

  Video not cache for xhamster

Desconectado th30nly

  • Newbie
  • *
  • Mensajes: 3
  • Ubicación: Indonesia
    • Ver Perfil
    • ComStuff
  • Me Gusta: 0
Video not cache for xhamster
« : diciembre 23, 2013, 05:34:10 am »
Hello everyone,
i'm asking if anyone have fix for my problem.
currently i'm writing a plugin to cache xhamster video.
i'm using thundercache engine and raptorcache engine for another server.
the problem is, images cached but video isn't.
below my source plugin.

Código: [Seleccionar]
#include <iostream>
#include <cstring>
#include <vector>
#include <regex.h>
#include "../utils.cpp"

using namespace std;

// use this line to compile
// g++ -I. -fPIC -shared -g -o xhamster.com.so xhamster.com.cpp
// Regex
// http.*\.xhamster\.com.*(\.swf|\.jpg|\.png|\.gif|\.flv|\.mp4)
// http.*\.xhcdn\.com.*(\.swf|\.jpg|\.png|\.gif|\.flv|\.mp4)
// http.*192\.96\.200\.\d{1,3}\/.*(\.swf|\.jpg|\.png|\.gif|\.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()-2) + "_" +resultado.at(resultado.size()-1);
        }
}
 
extern "C" resposta getmatch(const string url) {
    resposta r;
 
if ( (url.find("xhamster.com/") != string::npos) or
(url.find("xhcdn.com/") != string::npos) or
(regex_match("192\\.96\\.200\\.\\d{1,3}\\/", url) != "")
   ) {
     
       r.file = get_filename(url);
      if (!r.file.empty()) {
         r.match = true;       
         r.domain = "xhamster";
      } else {
         r.match = false;
      }
   } else {
      r.match = false;
   }
   return r;
}

any help is really apreciated.