dafilms.com link extractor

Prints the video direct download link

当前为 2014-12-23 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name dafilms.com link extractor
  3. // @namespace surrealmoviez.info
  4. // @description Prints the video direct download link
  5. // @include http://dafilms.com/film/*
  6. // @include http://dafilms.com/download/*
  7. // @include http://dafilms.com/film/*
  8. // @grant none
  9. // @version 0.2.2
  10. // ==/UserScript==
  11.  
  12.  
  13. if ($(".pagination").length > 0) {
  14. var timer = 0;
  15. var links = [];
  16. var currPage = $("body").html();
  17.  
  18. function fetchButton() {
  19. var interval = 2000;
  20. timer = setInterval(function() {
  21. BidClick();
  22. }, interval);
  23. }
  24.  
  25. function fetchDoc() {
  26.  
  27. $("#article .article", $(currPage)).each(function(i, v) {
  28. var link = "http://dafilms.com" + $("h3 > .upper", $(this)).attr("href");
  29. links.push(link);
  30. });
  31.  
  32. if ($(".disabled.next", $(currPage)).length > 0) {
  33. clearInterval(timer);
  34. timer = "";
  35. } else {
  36. var next = $(".current.page").next("a").attr("href");
  37.  
  38. $.ajax({type: "GET",
  39. url: "http://dafilms.com/film/" + next,
  40. async: false,
  41. success: function(response) {
  42. currPage = $("body", $(response)).html();
  43. },
  44. error: function(xhr, ajaxOptions, thrownError) {
  45. alert(xhr.status);
  46. alert(thrownError);
  47. }
  48. });
  49. }
  50. }
  51.  
  52.  
  53. } else {
  54. var html = $("body").html();
  55. var linkStart = html.indexOf("http://stream.dafilms.com/video.mp4?");
  56. var link;
  57. if (linkStart === -1) {
  58. link = "Not found. Be sure to click 'Play' first.";
  59. } else {
  60. var linkEnd = html.indexOf("'", linkStart);
  61. link = html.substring(linkStart, linkEnd);
  62. }
  63.  
  64. $(".movie-top-info").append("<p>DOWNLOAD LINK:</p>" + link);
  65. }