Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exports.url = "https://kinox.sx";
- exports.req = require("request");
- exports.cheerio = require("cheerio");
- exports.name = "kinox";
- exports.hasSleep = false;
- exports.setDefault = function() {
- this.req = this.req.defaults({
- jar: true,
- headers: {
- "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
- "Accept-Encoding": "gzip,deflate,sdch",
- "Accept-Language": "de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4,nl;q=0.2",
- "Cache-Control": "max-age=0",
- "Connection": "keep-alive",
- "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36"
- },
- gzip: true,
- followRedirect: true,
- followAllRedirects: true
- });
- };
- exports.setCredentials = function($user, $pass) {
- ////console.log("KINOX CRED");
- this.userName = $user.trim();
- this.password = $pass.trim();
- }
- exports.counter = 0;
- exports.resetCounter = function() {
- this.counter = 0;
- }
- exports.increment = function() {
- this.counter++;
- }
- exports.login = function(obj, movieCallback) {
- if(!obj.mainData.isSeries) {
- return movieCallback('Is n Film, Bypass#);
- }
- this.setDefault();
- var that = this;
- if (this.loggedIn) {
- return this.sendTo(obj, movieCallback);
- }
- this.req.get({
- url: this.url
- }, function(a, b, c) {
- that.req.get({
- url: that.url + "/aSET/Login/UseThis.php?Method=Login&Login=" + encodeURIComponent(that.userName) + "&Secret=" + encodeURIComponent(that.password) + "&UseCookie=Y"
- }, function(a, b, c) {
- that.loggedIn = true;
- that.sendTo(obj, movieCallback);
- });
- });
- }
- exports.createMovie = function(obj, movieCallback) {
- console.log("CREATE MOVIE");
- var that = this;
- that.req("http://kinox.sx/AddEntry.html", function(a,b,c){
- that.req.post({
- url: "http://kinox.sx/AddEntry.html",
- formData: {
- type: "movie",
- language: "1",
- imdb: obj.mainData.imdb,
- title: obj.mainData.title,
- description: ""
- }
- }, function(a,b,c){
- if(a)
- return obj.callback(obj, movieCallback);
- return that.sendTo(obj, movieCallback);
- })
- });
- }
- exports.sendTo = function(obj, movieCallback) {
- var links = obj.chunk[obj.currentPos];
- var that = this;
- var firstForm = {
- search_title: obj.mainData.imdb,
- search_language: 1,
- search_subtitle: 1
- }
- var form = {
- "iid": "",
- "quality": (obj.mainData.quality == "55") ? "4" : obj.mainData.quality,
- "links[]": "",
- "Season": obj.mainData.season,
- "Episode": obj.mainData.episode,
- "rls_title": "",
- "mode": 1
- };
- var keys = [];
- console.log("KINOX");
- for ($_x = 0; $_x < links.length; $_x++) {
- keys.push(links[$_x].replace("bitvid.sx", "videoweed.es").replace("https://streamango.com", "http://streamango.com").replace("https://openload.co", "http://openload.co").replace("https://vidzi.tv", "http://vidzi.tv").replace("https://www.flashx.to", "http://www.flashx.tv").replace("https://www.flashx.tv", "http://www.flashx.tv").replace("https://www.rapidvideo.com", "http://www.rapidvideo.com").replace("https://www.streamango.com", "http://wwww.streamango.com").replace("https://thevideo.me", "http://thevideo.me").replace("https://vidlox.tv", "http://vidlox.tv").replace("https://www.bitporno.com", "http://bitporno.com"));
- }
- form["links[]"] = keys;
- ////console.log(keys);
- this.req(that.url, function(a, b, c) {
- that.req(that.url + "/Upload.html", function(a, b, c) {
- that.req.post({
- url: that.url + "/Upload.html",
- formData: firstForm
- }, function(a, b, c) {
- var $ = that.cheerio.load(c);
- var iid = ($("select[name='iid'] option").first().val());
- if(typeof iid == "undefined") {
- return movieCallback(["Musst Film erstmal per hand anlegen!"]);
- }
- form.iid = iid;
- that.req.post({
- url: that.url + "/Upload.html",
- formData: form
- }, function(a, b, c) {
- var $ = that.cheerio.load(c);
- var success = $("div.successBox").html();
- var error1 = $("div.errorBox").html();
- var msg = [];
- if(success != null ) {
- var suc = (success.split("<br>"));
- for(var i=0; i < suc.length; i++)
- msg.push(suc[i]);
- }
- if(error1 != null) {
- var suc = (error1.split("<br>"));
- for(var i=0; i < suc.length; i++)
- msg.push(suc[i]);
- }
- console.log(msg);
- return movieCallback(msg);
- //console.log("KINOX");
- /*
- if(success != null) {
- //console.log("SUCCESS "+currentReq);
- //console.log(success);
- }
- if(error1 != null) {
- //console.log("ERROR "+ currentReq);
- //console.log(error1);
- }
- that.increment();
- if ($("div.successBox").length > 0) {
- cb(true, "kinox");
- } else {
- cb(false, "kinox");
- }
- if(that.counter == maxReq) {
- that.resetCounter();
- return _doneCB(that.name);
- }
- */
- });
- });
- });
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement