TVmaze Downloader 2019

Adds download links to TVmaze website

  1. // ==UserScript==
  2. // @name TVmaze Downloader 2019
  3. // @description Adds download links to TVmaze website
  4. // @include https://www.tvmaze.com/*
  5. // @version 1.01
  6. // @Author bnor
  7. // @license http://creativecommons.org/licenses/by-nc-sa/3.0/us/
  8. // @grant none
  9. // @namespace https://gf.qytechs.cn/users/173683
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. function Tracker(shortname, icon, logic) {
  14. this.shortname = shortname;
  15. this.icon = icon;
  16. this.logic = logic;
  17.  
  18. this.getHTML = function (query, episodeName,episodeNumber) {
  19. var tShortname = this.shortname;
  20. var tIcon = this.icon;
  21.  
  22. var html = "<a target=\"_blank\" href=\"";
  23. html += logic(query,episodeName,episodeNumber);
  24. html += "\">";
  25.  
  26. if (tIcon !== "") {
  27. html += "<img width=\"14\" heigth=\"14\" border=\"0\" src=\"" + tIcon + "\" alt=\"" + tShortname + "\">";
  28. } else {
  29. html += tShortname;
  30. }
  31. html += "</a>";
  32. return html;
  33. };
  34. }
  35.  
  36. function addDownloadWatchList(downloadURL) {
  37. // iterate through all series tables
  38. $("article.episode-row").each(function() {
  39. // Create Download column
  40. var linksDiv = $(this).find("div.tributton-watch").last();
  41.  
  42. // get current episode number
  43. var lastEpisodeNumber=$(this).parent().parent().find("div.watched-eps").first().text().trim().split("/")[0];
  44. var episodeNumber=Number(lastEpisodeNumber)+$(this).index();
  45.  
  46. // Get series title
  47. var showTitle = $(this).parent().parent().prev().children("a").text();
  48. showTitle = showTitle.replace(".","").replace("'","").replace("!","");
  49. // Get episode name
  50. var episodeName = $(this).find("div.small-6.medium-7.cell.center").first().text();
  51. episodeName = episodeName.split(":")[0].trim();
  52.  
  53. var htmlString="";
  54. // Add download link to each episode
  55. for(var i=0;i<downloadURL.length;++i){
  56. htmlString+=downloadURL[i].getHTML(showTitle, episodeName,episodeNumber);
  57. }
  58. linksDiv.append("<td style='width:40px'>" + htmlString + "</td>");
  59.  
  60. });
  61.  
  62. }
  63.  
  64.  
  65. // --------------- downloadURL ---------------
  66. // FORMAT: Tracker(shortName, iconURL, searchURL, useNumbers)
  67. // shortName - Alt display name for link
  68. // iconURL - icon displayed for link created
  69. // searchURL - URL that search string is appended to
  70. // useNumbers - if true adds the episode number to the search URL
  71. var trackEztv = new Tracker("EZTV", "http://eztv.io/favicon.ico", (name,episodeName,episodeNumber)=>{
  72. //1x02 > S01E02
  73. var season=Number(episodeName.split("x")[0]);
  74. var number=Number(episodeName.split("x")[1]);
  75. if(season<10){
  76. season="0"+season;
  77. }
  78. if(number<10){
  79. number="0"+number;
  80. }
  81.  
  82. episodeName= "S"+season+"E"+number;
  83. return "https://eztv.io/search/"+name+" "+episodeName;
  84. });
  85. var trackHs = new Tracker("HS", "", (name,episodeName,episodeNumber)=>{
  86. var map=[];
  87. map["That Time I Got Reincarnated as a Slime"]="tensei-shitara-slime-datta-ken";
  88. map["Ms vampire who lives in my neighborhood."]="tonari-no-kyuuketsuki-san";
  89. map["So Many Colors in the Future What a Wonderful World"]="Irozuku Sekai no Ashita kara";
  90.  
  91. if(map[name] !== undefined){
  92. name=map[name];
  93. }
  94. if(episodeNumber<10){
  95. episodeNumber="0"+episodeNumber;
  96. }
  97. return "https://horriblesubs.info/shows/"+name+"/#"+episodeNumber;
  98. });
  99.  
  100. //downloadURL = new Tracker("Kickass", "https://kastatic.com/images/favicon.ico", "https://kickass.to/usearch/?field=time_add&sorder=desc&q=ettv -720p -1080p ", false);
  101. // --------------- END OF downloadURL ---------------
  102.  
  103. if($("title").text().indexOf("Watch List")===0){
  104. addDownloadWatchList([trackEztv,trackHs]);
  105. }
  106.  
  107. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址