Advertisement
Guest User

Untitled

a guest
Dec 7th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.06 KB | None | 0 0
  1. exports.url = "https://kinox.sx";
  2. exports.req = require("request");
  3. exports.cheerio = require("cheerio");
  4. exports.name = "kinox";
  5. exports.hasSleep = false;
  6.  
  7. exports.setDefault = function() {
  8. this.req = this.req.defaults({
  9. jar: true,
  10. headers: {
  11. "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
  12. "Accept-Encoding": "gzip,deflate,sdch",
  13. "Accept-Language": "de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4,nl;q=0.2",
  14. "Cache-Control": "max-age=0",
  15. "Connection": "keep-alive",
  16. "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"
  17. },
  18. gzip: true,
  19. followRedirect: true,
  20. followAllRedirects: true
  21. });
  22. };
  23. exports.setCredentials = function($user, $pass) {
  24. ////console.log("KINOX CRED");
  25. this.userName = $user.trim();
  26. this.password = $pass.trim();
  27. }
  28. exports.counter = 0;
  29. exports.resetCounter = function() {
  30. this.counter = 0;
  31. }
  32. exports.increment = function() {
  33. this.counter++;
  34. }
  35. exports.login = function(obj, movieCallback) {
  36. if(!obj.mainData.isSeries) {
  37. return movieCallback('Is n Film, Bypass#);
  38. }
  39. this.setDefault();
  40.  
  41. var that = this;
  42. if (this.loggedIn) {
  43. return this.sendTo(obj, movieCallback);
  44. }
  45. this.req.get({
  46. url: this.url
  47. }, function(a, b, c) {
  48. that.req.get({
  49. url: that.url + "/aSET/Login/UseThis.php?Method=Login&Login=" + encodeURIComponent(that.userName) + "&Secret=" + encodeURIComponent(that.password) + "&UseCookie=Y"
  50. }, function(a, b, c) {
  51. that.loggedIn = true;
  52. that.sendTo(obj, movieCallback);
  53. });
  54. });
  55. }
  56. exports.createMovie = function(obj, movieCallback) {
  57. console.log("CREATE MOVIE");
  58. var that = this;
  59. that.req("http://kinox.sx/AddEntry.html", function(a,b,c){
  60. that.req.post({
  61. url: "http://kinox.sx/AddEntry.html",
  62. formData: {
  63. type: "movie",
  64. language: "1",
  65. imdb: obj.mainData.imdb,
  66. title: obj.mainData.title,
  67. description: ""
  68. }
  69. }, function(a,b,c){
  70. if(a)
  71. return obj.callback(obj, movieCallback);
  72.  
  73. return that.sendTo(obj, movieCallback);
  74. })
  75. });
  76. }
  77. exports.sendTo = function(obj, movieCallback) {
  78. var links = obj.chunk[obj.currentPos];
  79. var that = this;
  80. var firstForm = {
  81. search_title: obj.mainData.imdb,
  82. search_language: 1,
  83. search_subtitle: 1
  84. }
  85.  
  86. var form = {
  87. "iid": "",
  88. "quality": (obj.mainData.quality == "55") ? "4" : obj.mainData.quality,
  89. "links[]": "",
  90. "Season": obj.mainData.season,
  91. "Episode": obj.mainData.episode,
  92. "rls_title": "",
  93. "mode": 1
  94. };
  95. var keys = [];
  96. console.log("KINOX");
  97. for ($_x = 0; $_x < links.length; $_x++) {
  98. 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"));
  99. }
  100. form["links[]"] = keys;
  101. ////console.log(keys);
  102. this.req(that.url, function(a, b, c) {
  103. that.req(that.url + "/Upload.html", function(a, b, c) {
  104. that.req.post({
  105. url: that.url + "/Upload.html",
  106. formData: firstForm
  107. }, function(a, b, c) {
  108. var $ = that.cheerio.load(c);
  109. var iid = ($("select[name='iid'] option").first().val());
  110. if(typeof iid == "undefined") {
  111. return movieCallback(["Musst Film erstmal per hand anlegen!"]);
  112. }
  113. form.iid = iid;
  114. that.req.post({
  115. url: that.url + "/Upload.html",
  116. formData: form
  117. }, function(a, b, c) {
  118. var $ = that.cheerio.load(c);
  119. var success = $("div.successBox").html();
  120. var error1 = $("div.errorBox").html();
  121.  
  122. var msg = [];
  123.  
  124. if(success != null ) {
  125. var suc = (success.split("<br>"));
  126. for(var i=0; i < suc.length; i++)
  127. msg.push(suc[i]);
  128. }
  129.  
  130. if(error1 != null) {
  131. var suc = (error1.split("<br>"));
  132. for(var i=0; i < suc.length; i++)
  133. msg.push(suc[i]);
  134. }
  135. console.log(msg);
  136. return movieCallback(msg);
  137.  
  138. //console.log("KINOX");
  139. /*
  140. if(success != null) {
  141. //console.log("SUCCESS "+currentReq);
  142. //console.log(success);
  143. }
  144.  
  145. if(error1 != null) {
  146. //console.log("ERROR "+ currentReq);
  147. //console.log(error1);
  148. }
  149. that.increment();
  150. if ($("div.successBox").length > 0) {
  151. cb(true, "kinox");
  152. } else {
  153. cb(false, "kinox");
  154. }
  155. if(that.counter == maxReq) {
  156. that.resetCounter();
  157. return _doneCB(that.name);
  158. }
  159. */
  160. });
  161.  
  162.  
  163. });
  164. });
  165. });
  166. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement