Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Adds Imdb movie details in thepiratebay(and proxies), an embedded youtube trailer for movies, links to torrentz and torrent file caches, and and douban movie info / reviews
// ==UserScript==
// @name Piratebay IMDB Douban mashup
// @namespace tpb&doubanstyle
// @description Adds Imdb movie details in thepiratebay(and proxies), an embedded youtube trailer for movies, links to torrentz and torrent file caches, and and douban movie info / reviews
// @include /^http://thepiratebay\.(\w\w)/torrent//
// @include /^https://thepiratebay\.(\w\w)/torrent//
// @include http://www.pirateproxy.me/torrent/*
// @include http://pirateproxy.net/torrent/*
// @icon http://i.imgur.com/U1fPU.png
// @version 0.9
// ==/UserScript==
// jquery is alraedy imported
var $ = unsafeWindow.jQuery.noConflict(true);
GM_addStyle("body{display:none}");
GM_addStyle('.imdb a, .douban a {margin:0 !important; border-bottom: 1px dotted #80C780; color: #3315AB !important; font-size: 1em; font-weight: bold; padding-right:10px; text-transform: uppercase; text-align:center;}.imgBox { width:71px; height:60px; background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEcAAAA8CAYAAAA0VacdAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAACu1JREFUeNrtm3lwG9Udx79vV7sryfIhmRgfcez4CLhMYpK0pUBgwIWQpglQWo603IWkBYarLTSUpJCDoUADE2CaMgUKZNJMCYRAcOKYkACOCZQcPjA2No4dJ7Et25Jsy7K8kvb1j13FK1uyTkuepm/mjY5d7b7f533f7/fe762AKVLmzZ2OxYtKpkpzpk5JN+lh7liTBoBRKpkK7WKmQiP6LA6i0TAPdbU/uQaAAICdCoDYqaCapppHC7RazbssS0rNZvu2o7WnhgG4AdAzWjl9FgcxGLg/AxIIoam/e/DSxwCkAuATrZ6EKicrMxkNXz08X6vlXgYAUIqUZKG0v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K0gJIApBy+0/TigtyeN3qV8zVinKciHMOmSg+wABAr4zrYaU33VEOn0jawijtERRIjNIeOyL8O2S0DplReo2F7zN1ifpfJvHTJjcS9E+//5cztfwXQw8TWf/ZYJUAAAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxMy0wMS0xMlQwMDowNDozNy0wNTowMDehFs8AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTMtMDEtMTJUMDA6MDQ6MzctMDU6MDBG/K5zAAAAAElFTkSuQmCC); }.imgText { text-align:center !important; margin:0 !important; padding:23px 0 0 0; font-family:tahoma; font-size:15px;font-weight: bold;}');
function cCount(strn, chr) //counts periods in title
{
var stringsearch = chr,
str = strn;
for (var i = count = 0; i < str.length; count += +(stringsearch === str[i++]));
return count;
}
//get hash
var ls = document.getElementsByTagName('a');
if (document.getElementsByClassName("torpicture")[0] == null)
hash = document.getElementsByClassName("col2")[0].lastChild.data.trim();
else {
hash = document.getElementsByClassName("col1")[0].lastChild.data.trim();
//Uncomment the next line to enable bayimg proxy
//imtp=document.getElementsByClassName("torpicture")[0].getElementsByTagName("img")[0];imtp.src=imtp.src.replace('http://image.bayimg.com','http://pirateproxy.net/bayimg')
}
//Torrent file links
torElt = document.createElement('div');
torElt.className = "imdb";
torElt.innerHTML = '<br/><a rel="nofollow" title="TorCache" target="_blank" href="http://torcache.net/torrent/' + hash + '.torrent"><img width="16" height="16" title="" alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAASdJREFUOI2F0k9HRGEUx/HPM2USQylDREQth5htq4hWEb2AmBcQbaOX0apttB3KvIAhondQSouURpRhVvG0mHvr6XZn5nAW99znfM+/n5gY6jjDEzqoxQkmSW7iBTHxg0mAaQghzKCNJX+tF0KYx0KM8UGZZdX3C5UjTpPudrA1cgRclADqCWAvi3WxWtibKgaF5M6/SmzjHX3spoC5kuqN0nbZyAB9LOeAzULy3bit4zDtUhLIvTsB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment