Last active
February 20, 2018 12:51
-
-
Save owenvoke/9ac658d2bd4810350a9608bf01e5fb37 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name WWT [worldwidetorrents.eu] - Subtitle download links to TV and Movie torrents | |
// @description Adds download links for subtitles to every TV and movie torrent on WWT (addic7ed & subscene) | |
// @namespace NotNeo | |
// @include http*://worldwidetorrents.eu/torrents-details.php* | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js | |
// @version 1.0.1 | |
// @grant none | |
// ==/UserScript== | |
$(document).ready(() => { | |
const btnBar = $(".glyphicon.glyphicon-download").parent().parent().parent(); | |
const cat = $(".category_id_bar").text(); | |
const torrentTitle = $(".fltRight").prev().prev().text(); | |
let baseURL; | |
if (/^TV.*/ig.test(cat)) { | |
baseURL = "http://www.addic7ed.com/search.php?search="; | |
} else if (/^Movies.*/ig.test(cat)) { | |
baseURL = "https://subscene.com/subtitles/title?q="; | |
} | |
btnBar.append(`<a href="${baseURL}${encodeURI(torrentTitle)}" target="_blank" class="btn btn-default"><span class="fa fa-fw fa-comment"></span> Download Subtitles</a>`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Changelog:
+
and removing spacesfor
loops. Removed them as it is unrequired (changed to regex andencodeURI()
)