IMDb Scout

Add links from IMDb pages to torrent sites -- easy downloading from IMDb

  1. // ==UserScript==
  2. // @name IMDb Scout
  3. // @namespace https://greasyfork.org/users/1057-kannibalox
  4. // @description Add links from IMDb pages to torrent sites -- easy downloading from IMDb
  5. //
  6. // Preference window for userscripts, hosted by greasyfork:
  7. // @require https://greasyfork.org/libraries/GM_config/20131122/GM_config.js
  8. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js
  9. //
  10. // @version 5.3.1
  11. // @include http*://*.imdb.tld/title/tt*
  12. // @include http*://*.imdb.tld/search/title*
  13. // @include http*://*.imdb.tld/user/*/watchlist*
  14. // @include http*://*.imdb.com/title/tt*
  15. // @include http*://*.imdb.com/search/title*
  16. // @include http*://*.imdb.com/user/*/watchlist*
  17. //
  18. // @connect *
  19. // @grant GM_log
  20. // @grant GM_getValue
  21. // @grant GM_setValue
  22. // @grant GM_addStyle
  23. // @grant GM_openInTab
  24. // @grant GM_xmlhttpRequest
  25. // @grant GM_registerMenuCommand
  26. //
  27. // ==/UserScript==
  28. /*---------------------Version History--------------------
  29. 1.00 - Initial public release, everything works on barebones greasemonkey
  30.  
  31. 1.50 - Added the ability to select which sites to load from the GM script commands
  32. - Moved the required method to userscripts
  33. - Removed FH, NZB, Avax
  34.  
  35. 1.60 - Added style elements and shading to display on imdb
  36.  
  37. 1.62 - Fixed bug:SCC-ARC not removing when unchecked
  38. - Alphabetized list
  39.  
  40. 1.70 - Cleaned up code
  41. - Added option to not run script on page load
  42.  
  43. 1.71 - Deprecated action-box field
  44.  
  45. 1.80 - Added icons that link to OpenSubs, Criticker, RT, YT
  46.  
  47. 1.81 - Added support for tv, only displays on shows listed as 'tv series'
  48. - Added support for icheckmovies at top bar.
  49.  
  50. 1.82 - Fixed title parsing for tv shows.
  51.  
  52. 1.83 - Fixed dhive not working properly
  53.  
  54. 1.90 - Set height of preference window to 450px, added scroll bar
  55.  
  56. 1.91 - Added another 11 torrent sites
  57.  
  58. 2.00 - Added auto updater
  59.  
  60. 2.01 - Added TC, FreshOn, TVT, STF, CC
  61. - Cleaned up code (tabbing)
  62. - Removed THR
  63. - Added TV-Rage to top bar
  64.  
  65. 2.02 - Added PS, THC, HH, HDStar
  66. - Fixed CC false positive
  67.  
  68. 2.03 - TehC now uses tt
  69. - Added Raymoz mod for AT
  70.  
  71. 2.04 - Added HDbits
  72. - Added TL
  73.  
  74. 2.10 - Added genre page search functionality
  75.  
  76. 2.11 - Fixed ICM because Nuked was whining
  77.  
  78. 2.12 - Removed tvrage
  79. - Fixed iCM (added tt)
  80. - Added HDVNbits
  81. - Changed RevTT to .me
  82. - Added HDT
  83. - removed autoupdate
  84.  
  85. 2.13 - removed xvidme
  86. - reinstated autoupdate
  87. - removed google chrome code
  88. - fixed hdvn and hdt issues
  89.  
  90. 2.14 - Added @grant entries for API access
  91. - Fixed tt parser to work on imdb pages with referral info in url
  92.  
  93. 2.2 - Switch preferences window to use GM_config
  94. - Consolidate icon & site lists
  95. - Added IPT, KASS, sHD, and HDW
  96. - Fix "Open All" link
  97. - Add option for strikethroughs on search page
  98. - Removed arrays from search URLs
  99. - Spring cleaning
  100.  
  101. 2.21 - Added SSL to TVT, HDME, TC, AHD, IPT, SCC
  102. - Added SSL option for CG
  103. - Added GFT, GFT-Gems, GFT-TV
  104. - Fixed SCC, SCC-ARC search URL
  105. - Removed TheBox, TheDVDClub
  106. - Added more comments, cleaned up some more stuff
  107.  
  108. 2.22 - Fixed TehC, BTN, BTN-Req, THC
  109. - Added a bunch of TV sites, courtesy of seedless
  110. - Added "both" option for sites, and made changes
  111. to allow coexistence of movie and TV sites with
  112. the same name
  113. - Code re-organization, documentation
  114. - Re-added code to allow an array for searchUrl
  115.  
  116. 2.22.1 - Minor fixes
  117.  
  118. 2.23 - Fixed THC, BTN
  119. - Distinguish between movies and TV on search page
  120.  
  121. 2.24 - Separate load_on_start option for search page
  122. - Fix search_string on search page
  123.  
  124. 2.25 - Added some helpful text when no sites have been enabled
  125.  
  126. 2.26 - Added code to show links when on pages besides just the "front" one
  127. (e.g. http://www.imdb.com/title/tt2310332/reference)
  128.  
  129. 2.26.1 - Correctly detect TV shows when on aforementioned pages.
  130.  
  131. 2.3 - Incorporate a bunch of changes courtesy of Inguin:
  132. - Added SSL to AT, TE, D-noid, TG, YT, RT
  133. - Changed tracker short titles to canonical form ADC, KG
  134. - Updated D-noid from .me to .pw
  135. - Fixed broken AT search; also updated to use .me so avoids redirect
  136. - Added BitHQ, ET (eutorrents)
  137. - Removed two broken THC; replaced with one fixed
  138. - Removed iplay, horrorhaven, hdstar, scandbits, leecherslair
  139. - Removed needless CG http/https duplication - plenty of listed sites self-sign
  140. - A-Z sites list for readability
  141. - Cleanup YT search string
  142. - Copyedits
  143. - Clean up code (tabs, trailing spaces)
  144. - Use consistent naming style
  145. - Added Letterboxd, Subscene to icons
  146. - Added options for showing icons
  147.  
  148. 2.31 - Added preliminary check for TSH
  149. - Change all SCC links to .org
  150.  
  151. 2.31.1 - Typo fix
  152.  
  153. 2.32 - On uncertain pages, display both movie and TV sites
  154.  
  155. 2.33 - Add year to possible search params
  156. - Add rutorrent
  157.  
  158. 2.33.1 - Change KG to .in
  159.  
  160. 2.33.2 - Change TSH to .me
  161.  
  162. 2.34 - Updated AT, TPB
  163. - Removed HDWing, TVT and CHDBits
  164. - Added RARBG
  165. - Re-added reverse match checking to support rarbg
  166.  
  167. 2.35 - Fixed YouTube icon, add SubtitleSeeker icon
  168. - Added FL.ro, bB, BHD, HDS
  169. - Fixed TL, TehC, HDb, HDVN, AHD, KG
  170. - Renamed reverseMatch to positiveMatch
  171.  
  172. 2.36 - Added Wikipedia to icon sites
  173.  
  174. 2.36.1 - Typo fix
  175.  
  176. 2.37 - Add PxHD
  177.  
  178. 2.38 - Fix subtitle seeker
  179. - Added CG-c
  180. - Added FilmAffinity
  181. - Added option to skip http check entirely
  182.  
  183. 2.38.1 - Typo fix
  184.  
  185. 2.38.2 - Global replace parameters
  186.  
  187. 2.38.3 - Typo fix
  188.  
  189. 3.00 - Clean up some formatting
  190. - Add support for new IMDb page format
  191. - Update jquery
  192.  
  193. 3.0.1 - Added Classix
  194.  
  195. 3.0.2 - Updated documentation/comments
  196.  
  197. 3.0.3 - Removed GOEM, FY, PS, MT
  198. - Added Metacritic, CanIStream.It?, AllMovie, Facebook, Amazon, Cartoon Chaos, MySpleen, Secret Cinema
  199. - Fixed Wikipedia icon
  200.  
  201. 3.1 - Handle HTTP failures less silently
  202.  
  203. 3.1.1 - Fix KASS
  204.  
  205. 3.1.2 - Fix TPB, TE, HDT
  206. - Add MTV, DVDSeed
  207.  
  208. 3.1.3 - Add M-T, UHDB, HDC, Blu-ray.com
  209. - Fix scenehd, RT
  210.  
  211. 3.1.4 - Add HDClub
  212.  
  213. 3.2 - Fix the button on new-style pages
  214.  
  215. 3.2.1 - Fix AHD
  216.  
  217. 3.3 - Be less obnoxious about failed calls
  218.  
  219. 3.4 - Add Netflix icon
  220. - Remove a default parameter to satisfy Chrome
  221.  
  222. 3.5 - Add KZ, NNM, BB-HD, t411, TD, Rutor
  223. - Fix HDClub
  224. - Fix preferences in Chrome, sort sites properly
  225.  
  226. 3.5.1 - Remove DHive, Fix AHD
  227.  
  228. 4.0 - Bring in UI changes courtesy of janot
  229. - Add spaceEncode and goToUrl to site options
  230. - Add option to show results as links instead of text
  231. - Differentiate between missing and logged out
  232. - General refactoring
  233.  
  234. 4.1 - Add RARAT
  235.  
  236. 4.2 - Fix t411
  237. - Use magic .tld domain in @include
  238.  
  239. 4.3 - Set @connect in metadata block
  240.  
  241. 4.3.1 - Fix THC
  242.  
  243. 4.3.2 - Add AR, TtN
  244. - Add year and "trailer" to youtube search
  245. - Fix M-team
  246.  
  247. 4.3.3 - Fix BitHQ, PTP-Req, SCC
  248.  
  249. 4.3.4 - Fix M-team, myspleen, avistaz, eutorrents
  250. - Removed KAT
  251.  
  252. 4.3.5 - Fix IPT, Freshon
  253. - Add ExtraTorrent
  254.  
  255. 4.3.6 - Fix Demonoid, EuTorrents (now CinemaZ)
  256. - Fix "Actually search for torrents" option
  257. - Add PrivateHD for movies and tv
  258.  
  259. 4.3.7 - Apply CinemaZ fixes to AvistaZ as well
  260.  
  261. 4.3.8 - Fix SurrealMoviez and MySpleen, switch to new PTP url
  262.  
  263. 4.3.9 - Fix criticker, add CN
  264.  
  265. 4.3.10 - Fix Netflix, MTV
  266.  
  267. 4.3.11 - Add CHD back
  268.  
  269. 4.3.12 - Fix typo
  270.  
  271. 4.4 - Fix BeyondHD
  272. - Allow unicode when searching by name
  273.  
  274. 4.4.1 - Add trakt.tv
  275.  
  276. 4.4.2 - Added XS, HD-S, PTN, TBD, Blutopia
  277. - Removed Freshon, CN, ExT, t411, SCC
  278. - Fixed SC, TE, TG, Tik
  279. - Add .com for script runners that don't support .tld
  280.  
  281. 4.5 - (Chameleon)
  282. - Added an option to run on ILC request pages
  283. - Fixed running on reference pages (new imdb style)
  284. - Added a delay of 1 second between loading the same site (by domain) - no more popcorn quota timeouts
  285. - Fixed running on search pages
  286.  
  287. 4.5.1 - Removed (dead): BitHQ, TehC, FSS, ExtraTorrent, Cine-Clasico, and Secret-Cinema
  288. - Fixed the hack on goToUrl
  289.  
  290. 4.5.2 - Fixed filelist.ro, Tik, TD
  291. - Added HDHome, HDU, OurBits
  292.  
  293. 4.5.3 - Fixed TG, TE, HDSpace
  294. - Added XS
  295.  
  296. 4.5.4 - Fixed HDU
  297.  
  298. 4.5.5 - Fixed BHD
  299.  
  300. 4.6 - Option to highlight if the movie is missing from PTP
  301.  
  302. 4.7 - Added option to ignore the movie/tv distinction
  303.  
  304. 4.7.1 - Fix blutopia, hdchina, indenting
  305.  
  306. 4.7.2 - Fix SDBits, M-T
  307. - Add TTGg
  308.  
  309. 4.7.3 - Enable on https versions of imdb sites
  310. - Add TTG
  311.  
  312. 4.8.0 - Add FinVip, JoyHD, TO, TP, TS, TVCK
  313. - Fix TE, HDH, CZ, Subscene
  314. - Remove SubtitleSeeker
  315. - Rip out all site-specific code
  316. - Fix up minor code smells
  317. - Allow config name to be different from site name
  318.  
  319. 4.8.1 - Add SP
  320.  
  321. 4.8.2 - Add TMDB
  322.  
  323. 4.8.3 - Add TGx
  324. - Fix TTG, JoyHD, HDH
  325. - Remove duplicate TMDB
  326.  
  327. 4.9.0 - Add support for a user's watchlist
  328.  
  329. 4.10.0 - Add support for icon sites on the reference view
  330. - Add HTTPS for icon sites that support it
  331.  
  332. 4.11.0 - Fix search_string
  333.  
  334. 4.11.1 - Remove Blutopia
  335. Fix IPT
  336.  
  337. 4.11.2 - Add unogs
  338.  
  339. 4.11.3 - Fix TVDB
  340.  
  341. 4.11.4 - Add AB, remove ADC
  342. - Fix BHD, Demonoid, TPB, M-T, U2, BTN, BitHD
  343.  
  344. 4.11.5 - Fix conditional check
  345.  
  346. 4.12 - Update SDBits, BTN, PTP, TMDB
  347. - Apply some correctness changes
  348.  
  349. 4.12.1 - Add CCT
  350. - Update CHD, AB, TTG
  351.  
  352.  
  353. 4.12.1-mod1 - First public release. New additions, tweaks, bugfixes.
  354.  
  355. What I can remember:
  356. - Added: Blu, Retroflix, ACM, PTE, KG Requests, SC Requests.
  357. - Tweak: Classix search, and split to Movie/TV.
  358. - Tweak: Bunch of 'loggedOutRegex' added.
  359. - Fixed: Bunch of icons.
  360. - Fixed: TL, TPB.
  361. - Fixed: Bug in 'loggedOutRegex' logic.
  362. - New feature: Distinct icons on Requests.
  363.  
  364. 4.12.1-mod2 - Removed: Canistream.it
  365. - Fixed: Few icons.
  366. - Fixed: Search bug if ampersand is in the title
  367.  
  368. 4.12.1-mod3 - Removed: RARAT.
  369. - Added: Rarelust & Zooqle.
  370. - New feature: Sites are split to public & private (config menu).
  371.  
  372. 4.12.1-mod4 - Added: YGG, CG Requests.
  373. - Tweak: CG-Cocks & CG Request icons.
  374. - Tweak: RuT search, split to TV/Movie.
  375. - Fixed: Filter out filled KG Requests.
  376. - New feature: %search_string_orig% (search by the original titles
  377. on the movie/tv pages), enabled on RuT and YGG.
  378.  
  379. 4.12.1-mod5 - Fixed: CG Request. Demonoid typo.
  380.  
  381. 4.12.1-mod6 - Removed: HDVN, HoundDawgs.
  382. - Added: 1337x, ETTV, LimeTor, HDSpain, RlsBB, DB, FF, THR, PTer.
  383. - Fixed: TD, Demonoid, RARBG.
  384. - Tweak: Bold'ed the titles of config menu sections for better visibility.
  385. - Tweak: 'Other titles' sorted in alphabetical order.
  386. - Tweak: Added 'loggedOutRegex' to all private & some public sites.
  387. - Fixed: All borked icons are fixed.
  388. - Fixed: Bug in 'loggedOutRegex' (false negative if site responds with redirect).
  389.  
  390. 4.12.1-mod7 - Added: BRT.
  391. - Tweak: SDBits, U2.
  392.  
  393. 5.0 - Fix: @namespace & @name changed to fix updating for plugins.
  394.  
  395. 5.1 - Tweak: TVV, BB-HD.
  396. - Fixed: Invisible icons on dark background JoyHD, Rarelust, CZ, Zooqle, KG.
  397. - New feature: The new layout (icons are placed at top). Option to turn it off.
  398. - New feature: Option to select background for the new layout.
  399.  
  400. 5.2 - Tweak: Small tweaks (some preferences will reset to default).
  401. - Fixed: Rarelust icon.
  402.  
  403. 5.2.1 - Fixed: Rarelust icon (forgot to update it)
  404. - Added: RlsBB-Proxy ('RlsBB' now points to the main domain)
  405.  
  406. 5.3 - Added: Tik-Req, AHD-Req.
  407. - Tweak: No icon borders if "Show results on one line" is off.
  408. - Fixed: Text color on the new layout.
  409. - New feature: Option to change size of the icons.
  410.  
  411. 5.3.1 - Added: JPTV.
  412. - Fixed: ACM icon.
  413.  
  414.  
  415. -------------------------------------------------------*/
  416.  
  417. //------------------------------------------------------
  418. // A list of all the sites, and the data necessary to
  419. // check IMDb against them.
  420. // Each site is a dictionary with the following attributes:
  421. //
  422. // - name:
  423. // The site name, abbreviated
  424. // - searchUrl:
  425. // The URL to perform the search against, see below for how
  426. // to tailor the string to a site
  427. // - matchRegex:
  428. // The string which appears if the searchUrl *doesn't* return a result
  429. // - positiveMatch (optional):
  430. // Changes the test to return true if the searchUrl *does* return
  431. // a result that matches matchRegex
  432. // - TV (optional):
  433. // If true, it means that this site will only show up on TV pages.
  434. // By default, sites only show up on movie pages.
  435. // - both (optional):
  436. // Means that the site will show up on both movie and TV pages
  437. // - spaceEncode (optional):
  438. // Changes the character used to encode spaces in movie titles
  439. // The default is '+'.
  440. // - goToUrl (optional):
  441. // Most of the time the same URLs that are used for checking are
  442. // the ones that are used to actually get to the movie,
  443. // but this allows overriding that.
  444. // - loggedOutRegex (optional):
  445. // If any text on the page matches this regex, the site is treated
  446. // as being logged out, rather than mising the movie. This option is
  447. // not effected by positiveMatch.
  448. // - configName (optional):
  449. // Use this to allow changing names without breaking existing users.
  450. //
  451. // To create a search URL, there are four parameters
  452. // you can use inside the URL:
  453. // - %tt%:
  454. // The IMDb id with the tt prefix (e.g. tt0055630)
  455. // - %nott%:
  456. // The IMDb id without the tt prefix (e.g. 0055630)
  457. // - %search_string%:
  458. // The movie title (e.g. Yojimbo)
  459. // Depends on your preferences at www.imdb.com/preferences/general
  460. // - %search_string_orig%:
  461. // The original movie title (e.g. Yojimbo)
  462. // Affects only TV/Movie pages (on Watchlist/Search pages it will switch to %search_string%)
  463. // - %year%:
  464. // The movie year (e.g. 1961)
  465. // See below for examples
  466. //------------------------------------------------------
  467.  
  468. var public_sites = [
  469. { 'name': '1337x',
  470. 'searchUrl': 'https://1337x.unblocker.cc/category-search/%search_string%+%year%/Movies/1/',
  471. 'matchRegex': /No results were returned/},
  472. { 'name': '1337x',
  473. 'searchUrl': 'https://1337x.unblocker.cc/category-search/%search_string%/TV/1/',
  474. 'matchRegex': /No results were returned/,
  475. 'TV': true},
  476. { 'name': 'Demonoid',
  477. 'searchUrl': 'http://www.dnoid.pw/files/?query=%tt%',
  478. 'loggedOutRegex': /Error 522|Checking your browser|security check to access|daily site maintenance|page is not available/,
  479. 'matchRegex': /No torrents found/,
  480. 'both': true},
  481. { 'name': 'ETTV',
  482. 'searchUrl': 'https://www.ettvdl.com/torrents-search.php?search=%search_string%+%year%',
  483. 'matchRegex': /Nothing Found/,
  484. 'both': true},
  485. { 'name': 'KZ',
  486. 'searchUrl': 'http://kinozal.tv/browse.php?s=%search_string%+%year%&g=0&c=1002&v=0&d=0&w=0&t=0&f=0',
  487. 'matchRegex': 'Нет активных раздач, приносим извинения. Пожалуйста, уточните параметры поиска'},
  488. { 'name': 'KZ',
  489. 'searchUrl': 'http://kinozal.tv/browse.php?s=%search_string%+%year%&g=0&c=1001&v=0&d=0&w=0&t=0&f=0',
  490. 'matchRegex': 'Нет активных раздач, приносим извинения. Пожалуйста, уточните параметры поиска',
  491. 'TV': true},
  492. { 'name': 'LimeTor',
  493. 'searchUrl': 'https://limetorrents.unblockit.win/search/movies/%search_string%+%year%/seeds/1/',
  494. 'matchRegex': /csprite_dl14/,
  495. 'positiveMatch': true},
  496. { 'name': 'NNM',
  497. 'searchUrl': 'https://nnm-club.me/forum/tracker.php?nm=%search_string%+%year%',
  498. 'matchRegex': 'Не найдено',
  499. 'both': true},
  500. { 'name': 'RARBG',
  501. 'searchUrl': 'https://rarbgweb.org/torrents.php?imdb=%tt%',
  502. 'loggedOutRegex': /something wrong|Please wait|enter the captcha/,
  503. 'matchRegex': '//dyncdn.me/static/20/images/imdb_thumb.gif',
  504. 'positiveMatch': true,
  505. 'both': true},
  506. { 'name': 'Rarelust',
  507. 'icon': 'https://i.imgur.com/kaaYhsp.png',
  508. 'searchUrl': 'https://rarelust.com/?s=%tt%',
  509. 'matchRegex': 'Nothing Found'},
  510. { 'name': 'RlsBB',
  511. 'icon': 'https://i.imgur.com/Ve3T1rC.png',
  512. 'searchUrl': 'http://search.rlsbb.ru/Home/GetPost?phrase=%tt%&pindex=1&content=true&type=Simple',
  513. 'goToUrl': 'http://rlsbb.ru/?serach_mode=light&s=%tt%',
  514. 'loggedOutRegex': /Error 522|Checking your browser|security check to access/,
  515. 'matchRegex': /"results":\[\]|Not Found/,
  516. 'both': true},
  517. { 'name': 'RlsBB-Proxy',
  518. 'icon': 'https://i.imgur.com/Ve3T1rC.png',
  519. 'searchUrl': 'http://search.proxybb.com/Home/GetPost?phrase=%tt%&pindex=1&content=true&type=Simple',
  520. 'goToUrl': 'http://search.proxybb.com/?serach_mode=light&s=%tt%',
  521. 'loggedOutRegex': /Error 522|Checking your browser|security check to access/,
  522. 'matchRegex': /"results":\[\]|Not Found/,
  523. 'both': true},
  524. { 'name': 'RuT',
  525. 'searchUrl': 'https://rutracker.org/forum/tracker.php?f=100,101,103,1105,1114,1213,1235,124,1247,1278,1280,1281,1327,1363,1389,1391,140,1453,1457,1467,1468,1469,1475,1543,1576,1577,1666,1670,187,1900,1908,1936,194,1950,2076,208,2082,209,2090,2091,2092,2093,2107,2109,2110,2112,212,2123,2139,2159,2160,2163,2164,2166,2168,2169,2176,2177,2178,2198,2199,22,2200,2201,2220,2221,2258,2323,2339,2343,2365,2380,2459,249,2491,251,2535,2538,2540,294,312,313,33,352,376,4,484,500,505,511,521,539,549,552,56,572,599,656,671,672,7,709,752,821,822,851,863,876,877,893,905,921,93,930,934,941,97,979,98&nm=%search_string_orig%',
  526. 'loggedOutRegex': /Введите ваше имя/,
  527. 'matchRegex': 'Не найдено'},
  528. { 'name': 'RuT',
  529. 'searchUrl': 'https://rutracker.org/forum/tracker.php?f=103,1102,1105,1114,1120,1214,1242,1248,1278,1280,1281,1288,1301,1327,1359,1363,1389,1391,1453,1459,1460,1463,1467,1468,1469,1475,1493,1498,1531,1537,1539,1574,1690,1803,193,1938,1939,1940,195,2076,2082,2104,2107,2110,2112,2123,2139,2159,2160,2163,2164,2166,2168,2169,2176,2177,2178,2323,235,2380,2412,242,249,2491,251,2535,2538,266,294,315,325,387,489,500,534,552,56,594,599,607,656,671,672,694,704,717,718,721,752,775,781,815,816,819,821,825,842,851,863,864,876,893,915,97,979,98&nm=%search_string_orig%',
  530. 'loggedOutRegex': /Введите ваше имя/,
  531. 'matchRegex': 'Не найдено',
  532. 'TV': true},
  533. { 'name': 'Rutor',
  534. 'searchUrl': 'http://rutor.info/search/0/0/010/0/%tt%',
  535. 'loggedOutRegex': /Gateway Time-out/,
  536. 'matchRegex': 'Результатов поиска 0',
  537. 'both': true},
  538. { 'name': 'TPB',
  539. 'searchUrl': 'https://proxyproxy.fi/s/?q=%search_string%&video=on&category=0&page=0&orderby=99',
  540. 'matchRegex': /No hits. Try adding an asterisk in you search phrase./,
  541. 'both': true},
  542. { 'name': 'TGx',
  543. 'icon': 'https://torrentgalaxy.to/common/favicon/favicon-16x16.png',
  544. 'searchUrl': 'https://torrentgalaxy.org/torrents.php?search=%tt%',
  545. 'matchRegex': /No results found/},
  546. { 'name': 'YGG',
  547. 'searchUrl': 'https://www2.yggtorrent.si/engine/search?name=%search_string_orig%&category=2145&sub_category=all&do=search',
  548. 'matchRegex': 'Aucun résultat !',
  549. 'both': true},
  550. { 'name': 'Zooqle',
  551. 'icon': 'https://i.imgur.com/jqKceYP.png',
  552. 'searchUrl': 'https://zooqle.com/search?q=%tt%',
  553. 'loggedOutRegex': /Error 522|Checking your browser|security check to access/,
  554. 'matchRegex': 'Sorry, no torrents match',
  555. 'both': true}
  556. ];
  557.  
  558. var private_sites = [
  559. { 'name': 'AB',
  560. 'searchUrl': 'https://animebytes.tv/torrents.php?searchstr=%search_string%&action=advanced&search_type=title&tags=-lolicon+-shotacon+&sort=relevance&way=desc&hentai=0&showhidden=1&anime%5Btv_series%5D=1&anime%5Btv_special%5D=1&anime%5Bmovie%5D=1&anime%5Bova%5D=1&anime%5Bona%5D=1&anime%5Bdvd_special%5D=1&anime%5Bbd_special%5D=1&airing=2',
  561. 'loggedOutRegex': /Forgot your username/,
  562. 'matchRegex': /Translation: No search results/,
  563. 'both': true},
  564. { 'name': 'ACM',
  565. 'icon': 'https://i.imgur.com/7jLeQqf.png',
  566. 'searchUrl': 'https://asiancinema.me/torrents/filter?imdb=%tt%',
  567. 'loggedOutRegex': /Forgot Your Password/,
  568. 'matchRegex': /<tbody>\n\ {16}<\/tbody>/,
  569. 'both': true},
  570. { 'name': 'AHD',
  571. 'searchUrl': 'https://awesome-hd.me/torrents.php?id=%tt%',
  572. 'loggedOutRegex': /Keep me logged in./,
  573. 'matchRegex': /Your search did not match anything.|Error 404/,
  574. 'both': true},
  575. { 'name': 'AHD-Req',
  576. 'icon': 'https://i.imgur.com/wEs3QZL.png',
  577. 'searchUrl': 'https://awesome-hd.me/requests.php?submit=true&search=%tt%',
  578. 'loggedOutRegex': /Keep me logged in./,
  579. 'matchRegex': /Nothing found!|Error 404/,
  580. 'both': true},
  581. { 'name': 'ANT',
  582. 'icon': 'https://i.imgur.com/hKZo4s2.png',
  583. 'searchUrl': 'https://anthelion.me/torrents.php?searchstr=%search_string%&order_by=time&order_way=desc&group_results=1&action=basic&searchsubmit=1',
  584. 'loggedOutRegex': /You appear to have cookies disabled./,
  585. 'matchRegex': /Your search did not match anything/},
  586. { 'name': 'AR',
  587. 'searchUrl': 'https://alpharatio.cc/torrents.php?searchstr=%search_string%+%year%&tags_type=1&order_by=time&order_way=desc&filter_cat%5B8%5D=1&filter_cat%5B9%5D=1&filter_cat%5B10%5D=1&filter_cat%5B11%5D=1&filter_cat%5B12%5D=1&filter_cat%5B13%5D=1&filter_cat%5B15%5D=1&action=advanced&searchsubmit=1',
  588. 'loggedOutRegex': /<title>Login :: AlphaRatio/,
  589. 'matchRegex': /Your search did not match anything/},
  590. { 'name': 'AR',
  591. 'searchUrl': 'https://alpharatio.cc/torrents.php?searchstr=%search_string%&tags_type=1&order_by=time&order_way=desc&filter_cat%5B1%5D=1&filter_cat%5B2%5D=1&filter_cat%5B3%5D=1&filter_cat%5B4%5D=1&filter_cat%5B5%5D=1&filter_cat%5B6%5D=1&filter_cat%5B7%5D=1&action=advanced&searchsubmit=1',
  592. 'loggedOutRegex': /<title>Login :: AlphaRatio/,
  593. 'matchRegex': /Your search did not match anything/,
  594. 'TV': true},
  595. { 'name': 'AT',
  596. 'icon': 'https://i.imgur.com/ON1FGGO.png',
  597. 'searchUrl': 'https://avistaz.to/movies?search=&imdb=%tt%',
  598. 'loggedOutRegex': /Forgot Your Password/,
  599. 'matchRegex': /class="overlay-container"/,
  600. 'positiveMatch': true},
  601. { 'name': 'AT',
  602. 'icon': 'https://i.imgur.com/ON1FGGO.png',
  603. 'searchUrl': 'https://avistaz.to/tv-shows?search=&imdb=%tt%',
  604. 'loggedOutRegex': /Forgot Your Password/,
  605. 'matchRegex': /class="overlay-container"/,
  606. 'positiveMatch': true,
  607. 'TV': true},
  608. { 'name': 'bB',
  609. 'searchUrl': 'https://baconbits.org/torrents.php?action=basic&filter_cat[9]=1&searchstr=%search_string%+%year%',
  610. 'loggedOutRegex': /Lost your password/,
  611. 'matchRegex': /Your search was way too l33t/},
  612. { 'name': 'bB',
  613. 'searchUrl': 'https://baconbits.org/torrents.php?action=basic&filter_cat[8]=1&filter_cat[10]=1&searchstr=%search_string%',
  614. 'loggedOutRegex': /Lost your password/,
  615. 'matchRegex': /Your search was way too l33t/,
  616. 'TV': true},
  617. { 'name': 'BB-HD',
  618. 'searchUrl': 'https://bluebird-hd.org/browse.php?search=&incldead=0&cat=0&dsearch=%tt%&stype=or',
  619. 'loggedOutRegex': /Восстановление пароля|Bad Gateway/,
  620. 'matchRegex': /Nothing found|Ничего не найдено/,
  621. 'both': true},
  622. { 'name': 'BHD',
  623. 'searchUrl': 'https://beyond-hd.me/torrents/all?search=&doSearch=Search&imdb=%nott%',
  624. 'loggedOutRegex': /FORGET PASSWORD/,
  625. 'matchRegex': /<h5 class="text-bold text-danger">N\/A<\/h5>/,
  626. 'both': true},
  627. { 'name': 'BitHD',
  628. 'searchUrl': 'https://www.bit-hdtv.com/torrents.php?search=%tt%&options=4',
  629. 'loggedOutRegex': /Forgot your password/,
  630. 'matchRegex': /No match!/},
  631. { 'name': 'Blu',
  632. 'searchUrl': 'https://blutopia.xyz/torrents/filter?imdb=%tt%',
  633. 'loggedOutRegex': /Forgot Your Password/,
  634. 'matchRegex': /<tbody>\n\ {20}<\/tbody>/,
  635. 'both': true},
  636. { 'name': 'BRT',
  637. 'icon': 'https://i.imgur.com/KVaHMKi.png',
  638. 'searchUrl': 'https://brasiltracker.org/torrents.php?searchstr=%tt%',
  639. 'loggedOutRegex': /Recuperar senha/,
  640. 'matchRegex': /retornou nenhum resultado/,
  641. 'both': true},
  642. { 'name': 'BTN',
  643. 'searchUrl': 'https://broadcasthe.net/torrents.php?imdb=%tt%',
  644. 'loggedOutRegex': /Lost your password\?/,
  645. 'matchRegex': /Error 404/,
  646. 'both': true},
  647. { 'name': 'BTN-Req',
  648. 'icon': 'https://i.imgur.com/yj9qrwa.png',
  649. 'searchUrl': 'https://broadcasthe.net/requests.php?search=%search_string%',
  650. 'loggedOutRegex': /Lost your password\?/,
  651. 'matchRegex': /Nothing found/,
  652. 'TV': true},
  653. { 'name': 'CaCh',
  654. 'searchUrl': 'http://www.cartoonchaos.org/index.php?page=torrents&search=%search_string%&category=0&options=0&active=0',
  655. 'loggedOutRegex': /not authorized to view the Torrents/,
  656. 'matchRegex': />Av.<\/td>\s*<\/tr>\s*<\/table>/,
  657. 'both': true},
  658. { 'name': 'CCT',
  659. 'searchUrl': 'https://concertos.live/torrents?imdb=%nott%',
  660. 'loggedOutRegex': /Forgot Your Password/,
  661. 'matchRegex': /ago/,
  662. 'positiveMatch': true,
  663. 'both': true},
  664. { 'name': 'CG',
  665. 'searchUrl': 'https://cinemageddon.net/browse.php?search=%tt%',
  666. 'loggedOutRegex': 'Not logged in!',
  667. 'matchRegex': /Nothing found!/},
  668. { 'name': 'CG-c',
  669. 'icon': 'https://i.imgur.com/CdCbVW4.png',
  670. 'searchUrl': 'https://cinemageddon.net/cocks/endoscope.php?what=imdb&q=%tt%',
  671. 'loggedOutRegex': 'Not logged in!',
  672. 'matchRegex': /Nothing found!/},
  673. { 'name': 'CG-Req',
  674. 'icon': 'https://i.imgur.com/305SsHL.png',
  675. 'searchUrl': 'https://cinemageddon.net/viewrequests.php?search=%tt%&incdesc=1&filter=true',
  676. 'loggedOutRegex': 'Not logged in!',
  677. 'matchRegex': /Nothing found./},
  678. { 'name': 'CHD',
  679. 'searchUrl': 'https://chdbits.co/torrents.php?incldead=0&spstate=0&inclbookmarked=0&search_area=4&search_mode=0&search=%tt%',
  680. 'loggedOutRegex': /SSL \(HTTPS\)/,
  681. 'matchRegex': /Nothing found/},
  682. { 'name': 'Classix',
  683. 'searchUrl': 'http://classix-unlimited.co.uk/torrents-search.php?search="%search_string%"&parent_cat=Movies',
  684. 'loggedOutRegex': /Sorry this is a private site/,
  685. 'matchRegex': /Database Error/},
  686. { 'name': 'Classix',
  687. 'searchUrl': 'http://classix-unlimited.co.uk/torrents-search.php?search="%search_string%"&parent_cat=TV',
  688. 'loggedOutRegex': /Sorry this is a private site/,
  689. 'matchRegex': /Database Error/,
  690. 'TV': true},
  691. { 'name': 'CZ',
  692. 'icon': 'https://i.imgur.com/HYNMAuJ.png',
  693. 'configName': 'ET',
  694. 'searchUrl': 'https://cinemaz.to/movies?search=&imdb=%tt%',
  695. 'loggedOutRegex': /Forgot Your Password/,
  696. 'matchRegex': /class="overlay-container"/,
  697. 'positiveMatch': true},
  698. { 'name': 'CZ',
  699. 'icon': 'https://i.imgur.com/HYNMAuJ.png',
  700. 'configName': 'ET',
  701. 'searchUrl': 'https://cinemaz.to/tv-shows?search=&imdb=%tt%',
  702. 'loggedOutRegex': /Forgot Your Password/,
  703. 'matchRegex': /class="overlay-container"/,
  704. 'positiveMatch': true,
  705. 'TV': true},
  706. { 'name': 'DB',
  707. 'searchUrl': 'https://danishbits.org/torrents.php?&pre_type=s_imdb&search=%tt%',
  708. 'loggedOutRegex': /Glemt din kode\?/,
  709. 'matchRegex': /Your search did not match/,
  710. 'both': true},
  711. { 'name': 'DVDSeed',
  712. 'searchUrl': 'http://www.dvdseed.eu/browse2.php?search=%tt%&wheresearch=2&incldead=1&polish=0&nuke=0&rodzaj=0',
  713. 'loggedOutRegex': /Nie masz konta/,
  714. 'matchRegex': /Nic tutaj nie ma!/},
  715. { 'name': 'eThor',
  716. 'searchUrl': 'http://ethor.net/browse.php?stype=b&c23=1&c20=1&c42=1&c5=1&c19=1&c25=1&c6=1&c37=1&c43=1&c7=1&c9=1&advcat=0&incldead=0&includedesc=1&search=%tt%',
  717. 'loggedOutRegex': /Vous avez perdu votre mot de passe/,
  718. 'matchRegex': /Try again with a refined search string./},
  719. { 'name': 'FF',
  720. 'searchUrl': 'https://www.funfile.org/browse.php?search=%search_string%',
  721. 'loggedOutRegex': /You need cookies enabled to log in/,
  722. 'matchRegex': /Try again with a refined search/,
  723. 'both': true},
  724. { 'name': 'FL',
  725. 'searchUrl': 'https://filelist.io/browse.php?search=%nott%&cat=0&searchin=3&sort=2',
  726. 'loggedOutRegex': /Login on any IP/,
  727. 'matchRegex': /Nu s-a găsit nimic!/,
  728. 'both': true},
  729. { 'name': 'FinVip',
  730. 'searchUrl': 'https://finvip.org/index.php?page=torrents&search=%tt%&options=1',
  731. 'loggedOutRegex': /Sinulla ei ole oikeuksia sivulle/,
  732. 'matchRegex': /<td colspan="2" align="center"> <\/td>/},
  733. { 'name': 'HDb',
  734. 'searchUrl': 'https://hdbits.org/browse.php?c3=1&c1=1&c4=1&c2=1&imdb=%tt%',
  735. 'loggedOutRegex': /Make sure your passcode generating/,
  736. 'matchRegex': /Nothing here!/,
  737. 'both': true},
  738. { 'name': 'HDC',
  739. 'icon': 'https://i.imgur.com/KkZE390.png',
  740. 'searchUrl': 'https://hdchina.org/torrents.php?incldead=0&spstate=0&inclbookmarked=0&boardid=0&seeders=&search=%tt%&search_area=4&search_mode=2',
  741. 'loggedOutRegex': /SSL \(HTTPS\)/,
  742. 'matchRegex': /Nothing found! Try again with a refined search string./},
  743. { 'name': 'HDH',
  744. 'configName': 'HDHome',
  745. 'icon': 'https://i.imgur.com/XUd8EfR.png',
  746. 'searchUrl': 'https://hdhome.org/torrents.php?search_area=4&search=%tt%',
  747. 'loggedOutRegex': /SSL \(HTTPS\)/,
  748. 'matchRegex': /Nothing found! Try again with a refined search string/},
  749. { 'name': 'HDME',
  750. 'searchUrl': 'https://hdme.eu/browse.php?blah=2&cat=0&incldead=1&search=%tt%',
  751. 'loggedOutRegex': /You need cookies enabled/,
  752. 'matchRegex': /Try again with a refined search string./},
  753. { 'name': 'HDME',
  754. 'searchUrl': 'https://hdme.eu/browse.php?search=%search_string%&blah=0&cat=0&incldead=1',
  755. 'loggedOutRegex': /You need cookies enabled/,
  756. 'matchRegex': /Try again with a refined search string./,
  757. 'TV': true},
  758. { 'name': 'HDS',
  759. 'searchUrl': 'https://hdsky.me/torrents.php?incldead=1&search=%tt%&search_area=4&search_mode=0',
  760. 'loggedOutRegex': /SSL \(HTTPS\)/,
  761. 'matchRegex': /Nothing found!/},
  762. { 'name': 'HDS',
  763. 'searchUrl': 'https://hdsky.me/torrents.php?cat402=1&cat403=1&incldead=1&search=%search_string%&search_area=0&search_mode=0',
  764. 'loggedOutRegex': /SSL \(HTTPS\)/,
  765. 'matchRegex': /Nothing found!/,
  766. 'TV': true},
  767. { 'name': 'HDSpace',
  768. 'icon': 'https://i.imgur.com/hQNih7O.png',
  769. 'searchUrl': 'https://hd-space.org/index.php?page=torrents&active=0&options=2&search=%nott%',
  770. 'loggedOutRegex': /not authorized to view the Torrents!/,
  771. 'matchRegex': /<td colspan="2" align="center"> <\/td>/,
  772. 'both': true},
  773. { 'name': 'HDSpain',
  774. 'searchUrl': 'https://www.hd-spain.com/browse.php?%search_string%',
  775. 'loggedOutRegex': /Error 404 No encontrado/,
  776. 'matchRegex': /xxx Change Me xxx/,
  777. 'both': true},
  778. { 'name': 'HDT',
  779. 'icon': 'https://hdts.ru/favicon.ico',
  780. 'searchUrl': 'http://hd-torrents.org/torrents.php?active=0&options=2&search=%tt%',
  781. 'loggedOutRegex': /not authorized to view this Torrents/,
  782. 'matchRegex': /No torrents here.../,
  783. 'both': true},
  784. { 'name': 'HDU',
  785. 'searchUrl': 'https://pt.upxin.net/torrents.php?search_area=4&search=%tt%',
  786. 'loggedOutRegex': /SSL \(HTTPS\)/,
  787. 'matchRegex': /Nothing found!/},
  788. { 'name': 'IPT',
  789. 'searchUrl': 'https://ip.findnemo.net/t?q=%tt%',
  790. 'loggedOutRegex': /Error 522|Checking your browser|security check to access|Forgot your password/,
  791. 'matchRegex': /No Torrents Found!/},
  792. { 'name': 'IPT',
  793. 'searchUrl': 'https://ip.findnemo.net/t?72=&73=&q=%search_string%&qf=ti',
  794. 'loggedOutRegex': /Error 522|Checking your browser|security check to access|Forgot your password/,
  795. 'matchRegex': /No Torrents Found!/,
  796. 'TV': true},
  797. { 'name': 'JoyHD',
  798. 'icon': 'https://i.imgur.com/z5kbxta.png',
  799. 'searchUrl': 'https://www.joyhd.net/torrents.php?search_area=4&search=%tt%',
  800. 'loggedOutRegex': /Resend Email Verification/,
  801. 'matchRegex': /Nothing found! Try again with a refined search string/},
  802. { 'name': 'JPTV',
  803. 'searchUrl': 'https://jptv.club/torrents/filter?imdb=%tt%',
  804. 'loggedOutRegex': /Forgot Your Password/,
  805. 'matchRegex': /<tbody>\n\ {20}<\/tbody>/,
  806. 'both': true},
  807. { 'name': 'KG',
  808. 'icon': 'https://i.imgur.com/0JFxPY5.png',
  809. 'searchUrl': 'https://www.karagarga.in/browse.php?search_type=imdb&search=%nott%',
  810. 'loggedOutRegex': /Not logged in!/,
  811. 'matchRegex': /No torrents found/,
  812. 'both': true},
  813. { 'name': 'KG-Req',
  814. 'icon': 'https://i.imgur.com/ZQgliKg.png',
  815. 'searchUrl': 'https://karagarga.in/viewrequests.php?search=%nott%&filter=true',
  816. 'loggedOutRegex': /Not logged in!/,
  817. 'matchRegex': /1&nbsp;-/,
  818. 'positiveMatch': true,
  819. 'both': true},
  820. { 'name': 'LM',
  821. 'searchUrl': 'https://www.linkomanija.net/browse.php?incldead=1&search=%tt%&searchindesc=1',
  822. 'loggedOutRegex': /Prisiminti mane/,
  823. 'matchRegex': /Nieko nerasta./},
  824. { 'name': 'LM',
  825. 'searchUrl': 'https://www.linkomanija.net/browse.php?c30=1&c60=1&c28=1&c62=1&c65=1&c58=1&incldead=0&search="%search_string%"',
  826. 'loggedOutRegex': /Prisiminti mane/,
  827. 'matchRegex': /Nieko nerasta./,
  828. 'TV': true},
  829. { 'name': 'LM-5z',
  830. 'searchUrl': 'https://www.linkomanija.net/torrents.php?cat=0&search="%search_string%"',
  831. 'loggedOutRegex': /Prisiminti mane/,
  832. 'matchRegex': /Torrentų nėra./,
  833. 'both': true},
  834. { 'name': 'M-T',
  835. 'searchUrl': 'https://pt.m-team.cc/torrents.php?incldead=1&spstate=0&inclbookmarked=0&search=%tt%&search_area=4&search_mode=0',
  836. 'loggedOutRegex': /type="password" name="password"|An error occurred./,
  837. 'matchRegex': /Nothing here!|Try again with a refined search string./,
  838. 'both': true},
  839. { 'name': 'MS',
  840. 'searchUrl': 'http://www.myspleen.org/browse.php?search=%search_string%&title=0&cat=0',
  841. 'loggedOutRegex': /<title>MySpleen :: Login<\/title>/,
  842. 'matchRegex': /<strong>Nothing found!<\/strong>/,
  843. 'both': true},
  844. { 'name': 'MTV',
  845. 'searchUrl': 'https://www.morethan.tv/torrents.php?searchstr=%search_string%+%year%&tags_type=1&order_by=time&order_way=desc&group_results=1&filter_cat%5B1%5D=1&action=basic&searchsubmit=1',
  846. 'loggedOutRegex': /<title>Login :: morethan.tv/,
  847. 'matchRegex': /<h2>Your search did not match anything.<\/h2>/},
  848. { 'name': 'MTV',
  849. 'searchUrl': 'https://www.morethan.tv/torrents.php?searchstr=%search_string%&tags_type=1&order_by=time&order_way=desc&group_results=1&filter_cat%5B2%5D=1&action=basic&searchsubmit=1',
  850. 'loggedOutRegex': /<title>Login :: morethan.tv/,
  851. 'matchRegex': /<h2>Your search did not match anything.<\/h2>/,
  852. 'TV': true},
  853. { 'name': 'NB',
  854. 'icon': 'https://i.imgur.com/OH7fBY4.png',
  855. 'searchUrl': 'https://norbits.net/browse.php?incldead=1&fullsearch=0&scenerelease=0&imdbsearch=%tt%&imdb_from=0&imdb_to=0&search=',
  856. 'loggedOutRegex': /Ikke innlogget!/,
  857. 'matchRegex': /<h3>Ingenting her!<\/h3>/,
  858. 'both': true},
  859. { 'name': 'NBL',
  860. 'searchUrl': 'https://nebulance.io/torrents.php?order_by=time&order_way=desc&searchtext=%search_string%&search_type=0&taglist=&tags_type=0',
  861. 'loggedOutRegex': /have cookies disabled./,
  862. 'matchRegex': /Your search did not match anything/,
  863. 'TV': true},
  864. { 'name': 'OurBits',
  865. 'searchUrl': 'https://ourbits.club/torrents.php?search_area=4&search=%tt%',
  866. 'loggedOutRegex': /SSL \(HTTPS\)/,
  867. 'matchRegex': /Nothing found! Try again with a refined search string/},
  868. { 'name': 'PHD',
  869. 'icon': 'https://i.imgur.com/MJJGioU.png',
  870. 'searchUrl': 'https://privatehd.to/movies?search=&imdb=%tt%',
  871. 'loggedOutRegex': /Forgot Your Password/,
  872. 'matchRegex': /class="overlay-container"/,
  873. 'positiveMatch': true},
  874. { 'name': 'PHD',
  875. 'icon': 'https://i.imgur.com/MJJGioU.png',
  876. 'searchUrl': 'https://privatehd.to/tv-shows?search=&imdb=%tt%',
  877. 'loggedOutRegex': /Forgot Your Password/,
  878. 'matchRegex': /class="overlay-container"/,
  879. 'positiveMatch': true,
  880. 'TV': true},
  881. { 'name': 'PTE',
  882. 'icon': 'https://cdn.pte.nu/img/favicon.ico',
  883. 'searchUrl': 'https://pte.nu/apitorrents?tpage=1&cat[]=6&cat[]=7&cat[]=9&search=%search_string%',
  884. 'goToUrl': 'https://pte.nu/torrents?cat=["6","7","9"]&search=%search_string%',
  885. 'loggedOutRegex': /submit">Sign in/,
  886. 'matchRegex': /"count":0/,
  887. 'spaceEncode': ' '},
  888. { 'name': 'PTE',
  889. 'icon': 'https://cdn.pte.nu/img/favicon.ico',
  890. 'searchUrl': 'https://pte.nu/apitorrents?tpage=1&cat[]=11&cat[]=12&search=%search_string%',
  891. 'goToUrl': 'https://pte.nu/torrents?cat=["11","12"]&search=%search_string%',
  892. 'loggedOutRegex': /submit">Sign in/,
  893. 'matchRegex': /"count":0/,
  894. 'spaceEncode': ' ',
  895. 'TV': true},
  896. { 'name': 'PTer',
  897. 'searchUrl': 'https://pterclub.com/torrents.php?search=%tt%&search_area=4',
  898. 'loggedOutRegex': /SSL \(HTTPS\)/,
  899. 'matchRegex': /Nothing found!/},
  900. { 'name': 'PTF',
  901. 'searchUrl': 'https://ptfiles.net/browse.php?search=%search_string%&incldead=0&title=0',
  902. 'loggedOutRegex': /Forgot your password/,
  903. 'matchRegex': /Nothing found!/},
  904. { 'name': 'PTN',
  905. 'icon': 'https://piratethenet.org/pic/favicon.ico',
  906. 'searchUrl': 'https://piratethenet.org/browseold.php?incldead=1&_by=3&search=%tt%',
  907. 'loggedOutRegex': /You need to have cookies enabled/,
  908. 'matchRegex': /Nothing found!/,
  909. 'both': true},
  910. { 'name': 'PTP',
  911. 'searchUrl': 'https://passthepopcorn.me/torrents.php?imdb=%tt%',
  912. 'loggedOutRegex': /Keep me logged in/,
  913. 'matchRegex': /Your search did not match anything/},
  914. { 'name': 'PTP-Req',
  915. 'icon': 'https://i.imgur.com/EFCRrc9.png',
  916. 'searchUrl': 'https://passthepopcorn.me/requests.php?submit=true&search=%tt%',
  917. 'loggedOutRegex': /Keep me logged in/,
  918. 'matchRegex': /Your search did not match anything/},
  919. { 'name': 'PxHD',
  920. 'icon': 'https://i.imgur.com/OA7JJ6x.png',
  921. 'searchUrl': 'https://pixelhd.me/torrents.php?groupname=&year=&tmdbover=&tmdbunder=&tmdbid=&imdbover=&imdbunder=&imdbid=%tt%&order_by=time&order_way=desc&taglist=&tags_type=1&filterTorrentsButton=Filter+Torrents',
  922. 'loggedOutRegex': /You appear to have javascript disabled/,
  923. 'matchRegex': /Your search did not match anything/},
  924. { 'name': 'RevTT',
  925. 'searchUrl': 'https://www.revolutiontt.me/browse.php?search=%tt%',
  926. 'loggedOutRegex': /used when you're logged in./,
  927. 'matchRegex': /Nothing found!/},
  928. { 'name': 'RevTT',
  929. 'searchUrl': 'https://www.revolutiontt.me/browse.php?search=%search_string%&cat=0&incldead=1&titleonly=1',
  930. 'loggedOutRegex': /used when you're logged in./,
  931. 'matchRegex': /Nothing found!/,
  932. 'TV': true},
  933. { 'name': 'Retroflix',
  934. 'searchUrl': 'https://retroflix.club/torrents1.php?incldead=0&spstate=0&inclbookmarked=0&search=%tt%&search_area=4&search_mode=0',
  935. 'loggedOutRegex': /Restrict session to my IP/,
  936. 'matchRegex': /Nothing found!/,
  937. 'both': true},
  938. { 'name': 'SC',
  939. 'searchUrl': 'https://secret-cinema.pw/torrents.php?action=advanced&searchsubmit=1&filter_cat=1&cataloguenumber=%tt%&order_by=time&order_way=desc&tags_type=0',
  940. 'loggedOutRegex': /<title>Login :: Secret Cinema/,
  941. 'matchRegex': /Your search did not match anything/,
  942. 'both': true},
  943. { 'name': 'SC-Req',
  944. 'icon': 'https://i.imgur.com/QHOSsFZ.png',
  945. 'searchUrl': 'https://secret-cinema.pw/requests.php?submit=true&search=%tt%',
  946. 'loggedOutRegex': /<title>Login :: Secret Cinema/,
  947. 'matchRegex': /Nothing found!/,
  948. 'both': true},
  949. { 'name': 'SDBits',
  950. 'searchUrl': 'https://sdbits.org/browse.php?incldead=1&imdb=%tt%',
  951. 'loggedOutRegex': /Not logged in!/,
  952. 'matchRegex': /Nothing here!|Nothing found!/},
  953. { 'name': 'sHD',
  954. 'searchUrl': 'https://scenehd.org/browse.php?search=%tt%',
  955. 'loggedOutRegex': /If you have forgotten your password/,
  956. 'matchRegex': /No torrents found!/},
  957. { 'name': 'Snahp',
  958. 'searchUrl': 'https://forum.snahp.it/search.php?keywords=%search_string%&amp;sf=titleonly',
  959. 'loggedOutRegex': /register" role/,
  960. 'matchRegex': '/Search found 0 matches/',
  961. 'both': true},
  962. { 'name': 'SP',
  963. 'searchUrl': 'http://www.scenepalace.info/browse.php?search=%nott%&cat=0&incldead=1',
  964. 'loggedOutRegex': /Not logged in!/,
  965. 'matchRegex': /Nothing found!/,
  966. 'both': true},
  967. { 'name': 'TBD',
  968. 'icon': 'https://1.bp.blogspot.com/-F2JeKtPCJYI/VgjpVxwMO4I/AAAAAAAAADg/VyNyp-yW9Ac/s1600/TBD.ico',
  969. 'searchUrl': 'https://www.torrentbd.me/torrent/movies.php?module=torrents&id=%nott%',
  970. 'loggedOutRegex': /<title>TorrentBD : Login</,
  971. 'matchRegex': /This title is not available!/,
  972. 'both': true},
  973. { 'name': 'TD',
  974. 'searchUrl': 'https://tday.findnemo.net/t?q=%tt%',
  975. 'loggedOutRegex': /Error 522|Checking your browser|security check to access|Forgot Password\?/,
  976. 'matchRegex': /No Torrents Found!/,
  977. 'both': true},
  978. { 'name': 'TE',
  979. 'searchUrl': 'https://theempire.click/browse.php?incldead=0&country=&nonboolean=1&search=%tt%',
  980. 'loggedOutRegex': /404 - Not Found|You need cookies enabled/,
  981. 'matchRegex': /Try again with a refined search string/,
  982. 'both': true},
  983. { 'name': 'TG',
  984. 'searchUrl': 'https://thegeeks.click/browse.php?incldead=0&country=&nonboolean=1&search=%tt%',
  985. 'loggedOutRegex': /404 - Not Found|You need cookies enabled/,
  986. 'matchRegex': /Try again with a refined search string/,
  987. 'both': true},
  988. { 'name': 'THR',
  989. 'searchUrl': 'https://www.torrenthr.org/browse.php?search=%search_string%&blah=0&incldead=1',
  990. 'loggedOutRegex': /registraciju morate imati omogućene cookiese/,
  991. 'matchRegex': /Ništa nije pronađeno!/,
  992. 'both': true},
  993. { 'name': 'TO',
  994. 'searchUrl': 'https://theoccult.click/browse.php?incldead=0&country=&nonboolean=1&search=%tt%',
  995. 'loggedOutRegex': /404 - Not Found|You need cookies enabled/,
  996. 'matchRegex': /Try again with a refined search string/,
  997. 'both': true},
  998. { 'name': 'TP',
  999. 'searchUrl': 'https://theplace.click/browse.php?incldead=0&country=&nonboolean=1&search=%tt%',
  1000. 'loggedOutRegex': /not found on this server|You need cookies enabled/,
  1001. 'matchRegex': /Try again with a refined search string/,
  1002. 'both': true},
  1003. { 'name': 'TRL',
  1004. 'searchUrl': 'https://torrent.ai/lt/torrents?in=2&search=%tt%',
  1005. 'loggedOutRegex': /Jums nepavyksta pasijungti/,
  1006. 'matchRegex': /nieko nerasta!/,
  1007. 'both': true},
  1008. { 'name': 'TRL',
  1009. 'searchUrl': 'https://torrent.ai/lt/torrents?search=%search_string%&cats[]=53&cats[]=56&cats[]=79&cats[]=42&cats[]=58&cats[]=59&cats[]=45&cats[]=69&cats[]=70&cats[]=39&cats[]=28',
  1010. 'loggedOutRegex': /Jums nepavyksta pasijungti/,
  1011. 'matchRegex': /nieko nerasta!/,
  1012. 'TV': true},
  1013. { 'name': 'TS',
  1014. 'searchUrl': 'https://theshow.click/browse.php?incldead=0&country=&nonboolean=1&search=%tt%',
  1015. 'loggedOutRegex': /404 - Not Found|You need cookies enabled/,
  1016. 'matchRegex': /Try again with a refined search string/,
  1017. 'both': true},
  1018. { 'name': 'THC',
  1019. 'searchUrl': 'https://horrorcharnel.org/browse.php?search=%nott%&cat=0&incldead=1',
  1020. 'loggedOutRegex': /Not logged in!/,
  1021. 'matchRegex': /<h2>Nothing found!<\/h2>/},
  1022. { 'name': 'Tik',
  1023. 'searchUrl': 'https://www.cinematik.net/browse.php?cat=0&incldead=1&srchdtls=1&search=%tt%',
  1024. 'loggedOutRegex': /Not logged in!/,
  1025. 'matchRegex': /Nothing found!/,
  1026. 'both': true},
  1027. { 'name': 'Tik-Req',
  1028. 'icon': 'https://i.imgur.com/bM8D1m2.png',
  1029. 'searchUrl': 'https://www.cinematik.net/viewrequests.php?search=%search_string%&filter=1',
  1030. 'loggedOutRegex': /Not logged in!/,
  1031. 'matchRegex': /No requests found!/,
  1032. 'both': true},
  1033. { 'name': 'TL',
  1034. 'searchUrl': 'https://www.torrentleech.org/torrents/browse/list/categories/8,9,11,12,13,14,15,29/query/%search_string% %year%',
  1035. 'goToUrl': 'http://www.torrentleech.org/torrents/browse/index/query/%search_string% %year%/categories/1,8,9,10,11,12,13,14,15,29',
  1036. 'loggedOutRegex': /Signup With Invite/,
  1037. 'matchRegex': /"numFound":0/,
  1038. 'spaceEncode': ' '},
  1039. { 'name': 'TL',
  1040. 'searchUrl': 'https://www.torrentleech.org/torrents/browse/list/categories/26,27,32/query/%search_string%',
  1041. 'goToUrl': 'http://www.torrentleech.org/torrents/browse/index/query/%search_string%/categories/2,26,27,32',
  1042. 'loggedOutRegex': /Signup With Invite/,
  1043. 'matchRegex': /"numFound":0/,
  1044. 'spaceEncode': ' ',
  1045. 'TV': true},
  1046. { 'name': 'TTG',
  1047. 'searchUrl': 'https://totheglory.im/browse.php?c=M&search_field=imdb%nott%',
  1048. 'loggedOutRegex': /Forget your password/,
  1049. 'matchRegex': /Didn't match any titles/},
  1050. { 'name': 'TVCK',
  1051. 'searchUrl': 'https://www.tvchaosuk.com/browse.php?do=search&search_type=t_name&keywords=%search_string%',
  1052. 'loggedOutRegex': /404 Not Found/,
  1053. 'matchRegex': /<b>Nothing Found<\/b>/},
  1054. { 'name': 'TVV',
  1055. 'searchUrl': 'https://tv-vault.me/torrents.php?action=advanced&imdbid=%tt%&order_by=s3&order_way=desc',
  1056. 'loggedOutRegex': /Lost your password\?|Browse quota exceeded/,
  1057. 'matchRegex': /Nothing found<\/h2>/,
  1058. 'TV': true},
  1059. { 'name': 'U2',
  1060. 'searchUrl': 'https://u2.dmhy.org/torrents.php?incldead=0&spstate=0&inclbookmarked=0&search=%tt%&search_area=1&search_mode=0',
  1061. 'loggedOutRegex': /<title>Access Point :: U2</,
  1062. 'matchRegex': /Nothing found/},
  1063. { 'name': 'UHDB',
  1064. 'searchUrl': 'https://uhdbits.org/torrents.php?action=advanced&groupname=%tt%',
  1065. 'loggedOutRegex': /Lost your password/,
  1066. 'matchRegex': /Your search did not match anything./},
  1067. { 'name': 'XS',
  1068. 'searchUrl': 'https://www.xspeeds.eu/browse.php?do=search&keywords=%search_string%&search_type=t_name&category=0&include_dead_torrents=yes',
  1069. 'loggedOutRegex': /Forget your password/,
  1070. 'matchRegex': /<b>Nothing Found<\/b>/}
  1071. ];
  1072.  
  1073. var sites = public_sites.concat(private_sites);
  1074.  
  1075. var icon_sites = [
  1076. { 'name': 'AllMovie',
  1077. 'searchUrl': 'https://www.allmovie.com/search/movies/%search_string%',
  1078. 'showByDefault': false},
  1079. { 'name': 'Amazon',
  1080. 'searchUrl': 'https://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Dmovies-tv&field-keywords=%search_string%',
  1081. 'showByDefault': false},
  1082. { 'name': 'BCDB',
  1083. 'icon': 'https://i.imgur.com/IZwCRkn.png',
  1084. 'searchUrl': 'https://www.bcdb.com/bcdb/search.cgi?query=%search_string%'},
  1085. { 'name': 'Blu-ray.com',
  1086. 'searchUrl': 'https://www.blu-ray.com/search/?quicksearch=1&quicksearch_country=all&quicksearch_keyword=%search_string%+&section=bluraymovies',
  1087. 'showByDefault': false},
  1088. { 'name': 'Criticker',
  1089. 'searchUrl': 'https://www.criticker.com/?search=%search_string%&type=films'},
  1090. { 'name': 'Facebook',
  1091. 'searchUrl': 'https://www.facebook.com/search/str/%search_string%/keywords_pages',
  1092. 'showByDefault': false},
  1093. { 'name': 'FilmAffinity',
  1094. 'searchUrl': 'https://www.filmaffinity.com/en/advsearch.php?stext=%search_string%&stype[]=title&fromyear=%year%&toyear=%year%',
  1095. 'showByDefault': false},
  1096. { 'name': 'Google',
  1097. 'searchUrl': 'https://www.google.com/search?q=%search_string%'},
  1098. { 'name': 'iCheckMovies',
  1099. 'searchUrl': 'https://www.icheckmovies.com/search/movies/?query=%tt%'},
  1100. { 'name': 'Letterboxd',
  1101. 'searchUrl': 'https://letterboxd.com/imdb/%nott%'},
  1102. { 'name': 'Metacritic',
  1103. 'searchUrl': 'https://www.metacritic.com/search/all/%search_string%/results?cats[movie]=1&cats[tv]=1&search_type=advanced&sort=relevancy',
  1104. 'showByDefault': false},
  1105. { 'name': 'Netflix',
  1106. 'searchUrl': 'https://www.netflix.com/search/%search_string%',
  1107. 'showByDefault': false},
  1108. { 'name': 'OpenSubtitles',
  1109. 'searchUrl': 'https://www.opensubtitles.org/en/search/imdbid-%tt%'},
  1110. { 'name': 'Rotten Tomatoes',
  1111. 'searchUrl': 'https://www.rottentomatoes.com/search/?search=%search_string%'},
  1112. { 'name': 'Subscene',
  1113. 'icon': 'https://subscene.com/favicon.ico',
  1114. 'searchUrl': 'https://subscene.com/subtitles/title?q=%search_string%'},
  1115. { 'name': 'TMDB',
  1116. 'icon': 'https://www.themoviedb.org/assets/2/favicon-16x16-b362d267873ce9c5a39f686a11fe67fec2a72ed25fa8396c11b71aa43c938b11.png',
  1117. 'searchUrl': 'https://www.themoviedb.org/search?query=%search_string%'},
  1118. { 'name': 'Trakt.tv',
  1119. 'icon': 'https://walter.trakt.tv/hotlink-ok/public/favicon.ico',
  1120. 'searchUrl': 'https://trakt.tv/search/imdb?query=%tt%',
  1121. 'showByDefault': false},
  1122. { 'name': 'TVDB',
  1123. 'icon': 'https://www.thetvdb.com/images/icon.png',
  1124. 'searchUrl': 'https://www.thetvdb.com/search?query=%search_string%'},
  1125. { 'name': 'uNoGS',
  1126. 'searchUrl': 'https://unogs.com/?q=%tt%',
  1127. 'showByDefault': false},
  1128. { 'name': 'Wikipedia',
  1129. 'searchUrl': 'https://en.wikipedia.org/w/index.php?search=%search_string%&go=Go'},
  1130. { 'name': 'YouTube.com',
  1131. 'searchUrl': 'https://www.youtube.com/results?search_query="%search_string%"+%year%+trailer'}
  1132. ];
  1133.  
  1134. // For internal use (order matters)
  1135. var valid_states = [
  1136. 'found',
  1137. 'missing',
  1138. 'logged_out',
  1139. 'error'
  1140. ];
  1141.  
  1142. function replaceSearchUrlParams(site, movie_id, movie_title, movie_title_orig) {
  1143. var search_url = site['searchUrl'];
  1144. // If an array, do a little bit of recursion
  1145. if ($.isArray(search_url)) {
  1146. var search_array = [];
  1147. $.each(search_url, function(index, url) {
  1148. search_array[index] = replaceSearchUrlParams(url, movie_id, movie_title, movie_title_orig);
  1149. });
  1150. return search_array;
  1151. }
  1152. var space_replace = ('spaceEncode' in site) ? site['spaceEncode'] : '+';
  1153. var search_string = movie_title.trim().replace(/ +\(.*|&/g, '').replace(/\s+/g, space_replace);
  1154. var search_string_orig = movie_title_orig.trim().replace(/ +\(.*|&/g, '').replace(/\s+/g, space_replace);
  1155. var movie_year = document.title.replace(/^(.+) \((.*)([0-9]{4})(.*)$/gi, '$3');
  1156. var s = search_url.replace(/%tt%/g, 'tt' + movie_id)
  1157. .replace(/%nott%/g, movie_id)
  1158. .replace(/%search_string%/g, search_string)
  1159. .replace(/%search_string_orig%/g, search_string_orig)
  1160. .replace(/%year%/g, movie_year);
  1161. return s;
  1162. }
  1163.  
  1164. function getPageSetting(key) {
  1165. return (onSearchPage ? GM_config.get(key + '_search') : GM_config.get(key + '_movie'));
  1166. }
  1167.  
  1168. // Small utility function to return a site's icon
  1169. function getFavicon(site, hide_on_err) {
  1170. var favicon;
  1171. if (typeof(hide_on_err) === 'undefined') { hide_on_err = false }
  1172. if ('icon' in site) {
  1173. favicon = site['icon'];
  1174. } else {
  1175. var url = new URL(site['searchUrl']);
  1176. favicon = url.origin + '/favicon.ico';
  1177. }
  1178. var img = $('<img />').attr({'style': '-moz-opacity: 0.4; border: 0; vertical-align: text-top',
  1179. 'width': GM_config.get('cfg_icons_size'),
  1180. 'src': favicon,
  1181. 'title': site['name'],
  1182. 'alt': site['name']});
  1183. if (hide_on_err) { img.attr('onerror', "this.style.display='none';") }
  1184. return img;
  1185. }
  1186.  
  1187. // Adds search links to an element
  1188. // state should always be one of the values defined in valid_states
  1189. function addLink(elem, link_text, target, site, state) {
  1190. var link = $('<a />').attr('href', target).attr('target', '_blank');
  1191. if ($.inArray(state, valid_states) < 0) {
  1192. console.log("Unknown state " + state);
  1193. }
  1194. if (getPageSetting('use_mod_icons')) {
  1195. var icon = getFavicon(site);
  1196. (GM_config.get('one_line')) ? icon.css({'border-width': '3px', 'border-style': 'solid', 'border-radius': '2px'}) : icon.css({'border-width': '0px', 'border-style': 'solid', 'border-radius': '2px'});
  1197. if (state == 'error' || state == 'logged_out') {
  1198. icon.css('border-color', 'red');
  1199. } else if (state == 'missing') {
  1200. icon.css('border-color', 'yellow');
  1201. } else {
  1202. icon.css('border-color', 'green');
  1203. }
  1204. link.append(icon);
  1205. } else {
  1206. if (state == 'missing' || state == 'error' || state == 'logged_out') {
  1207. link.append($('<s />').append(link_text));
  1208. } else {
  1209. link.append(link_text);
  1210. }
  1211. if (state == 'error' || state == 'logged_out') {
  1212. link.css('color', 'red');
  1213. }
  1214. }
  1215.  
  1216. if (!onSearchPage) {
  1217. $('#imdbscout_' + state).append(link).append(' ');
  1218. } else {
  1219. var result_box = $(elem).find('td.result_box');
  1220. if (result_box.length > 0) {
  1221. $(result_box).append(link);
  1222. } else {
  1223. $(elem).append($('<td />').append(link).addClass('result_box'));
  1224. }
  1225. }
  1226. }
  1227.  
  1228. // Performs an ajax request to determine
  1229. // whether or not a url should be displayed
  1230. function maybeAddLink(elem, link_text, search_url, site) {
  1231. // If the search URL is an array, recurse briefly on the elements.
  1232. if ($.isArray(search_url)) {
  1233. $.each(search_url, function(index, url) {
  1234. maybeAddLink(elem, link_text + '_' + (index + 1).toString(), url, site);
  1235. });
  1236. return;
  1237. }
  1238.  
  1239. var domain = search_url.split('/')[2];
  1240. var now = (new Date())*1;
  1241. var lastLoaded = window.localStorage[domain+'_lastLoaded'];
  1242. if (!lastLoaded) {
  1243. lastLoaded = now - 5000;
  1244. } else {
  1245. lastLoaded = parseInt(lastLoaded);
  1246. }
  1247. if (now-lastLoaded < 1000) {
  1248. window.setTimeout(maybeAddLink.bind(undefined, elem, site['name'], search_url, site), 1000);
  1249. return;
  1250. }
  1251. else
  1252. {
  1253. window.localStorage[domain+'_lastLoaded']=(new Date())*1;
  1254. }
  1255.  
  1256. var target = search_url;
  1257. if (site.goToUrl) {
  1258. target = site.goToUrl;
  1259. }
  1260. var success_match = ('positiveMatch' in site) ? site['positiveMatch'] : false;
  1261. GM_xmlhttpRequest({
  1262. method: 'GET',
  1263. url: search_url,
  1264. onload: function(response) {
  1265. if (response.responseHeaders.indexOf('efresh: 0; url') > -1) {
  1266. addLink(elem, link_text, target, site, 'logged_out');
  1267. } else if (site['positiveMatch'] && site['loggedOutRegex'] && String(response.responseText).match(site['loggedOutRegex'])) {
  1268. addLink(elem, link_text, target, site, 'logged_out');
  1269. } else if (String(response.responseText).match(site['matchRegex']) ? !(success_match) : success_match) {
  1270. if (getPageSetting('highlight_missing').split(',').includes(site['name'])) {
  1271. if (elem.style) {
  1272. elem.parentNode.style.background = 'rgba(255,104,104,0.7)';
  1273. } else {
  1274. document.querySelector('#imdbscout_missing').style.background = 'rgba(255,104,104,0.7)';
  1275. }
  1276. }
  1277. if (!getPageSetting('hide_missing')) {
  1278. addLink(elem, link_text, target, site, 'missing');
  1279. }
  1280. } else if (site['loggedOutRegex'] && String(response.responseText).match(site['loggedOutRegex'])) {
  1281. addLink(elem, link_text, target, site, 'logged_out');
  1282. } else {
  1283. addLink(elem, link_text, target, site, 'found');
  1284. }
  1285. },
  1286. onerror: function() {
  1287. addLink(elem, link_text, target, site, 'error');
  1288. },
  1289. onabort: function() {
  1290. addLink(elem, link_text, target, site, 'error');
  1291. }
  1292. });
  1293. }
  1294.  
  1295. // Run code to create fields and display sites
  1296. function perform(elem, movie_id, movie_title, movie_title_orig, is_tv, is_movie) {
  1297. var site_shown = false;
  1298. $.each(sites, function(index, site) {
  1299. if (site['show']) {
  1300. site_shown = true;
  1301. // If we're on a TV page, only show TV links.
  1302. if ((Boolean(site['TV']) == is_tv ||
  1303. Boolean(site['both'])) ||
  1304. (!is_tv && !is_movie) || getPageSetting('ignore_type')) {
  1305. var searchUrl = replaceSearchUrlParams(site, movie_id, movie_title, movie_title_orig);
  1306. if (site.goToUrl)
  1307. site.goToUrl = replaceSearchUrlParams({
  1308. 'searchUrl': site['goToUrl'],
  1309. 'spaceEncode': ('spaceEncode' in site) ? site['spaceEncode'] : '+'
  1310. }, movie_id, movie_title, movie_title_orig);
  1311. if (getPageSetting('call_http_mod')) {
  1312. maybeAddLink(elem, site['name'], searchUrl, site);
  1313. } else {
  1314. addLink(elem, site['name'], searchUrl, site, 'found');
  1315. }
  1316. }
  1317. }
  1318. });
  1319. if (!site_shown) {
  1320. $(elem).append('No sites enabled! "IMDb Scout Mod Preferences" button you can find on Monkeys plugin icon.');
  1321. }
  1322. }
  1323.  
  1324. //------------------------------------------------------
  1325. // Button Code
  1326. //------------------------------------------------------
  1327.  
  1328. function displayButton() {
  1329. var p = $('<p />').attr('id', 'imdbscout_button');
  1330. p.append($('<button>Load IMDb Scout</button>').click(function() {
  1331. $('#imdbscout_button').remove();
  1332. if (onSearchPage) {
  1333. performSearch();
  1334. } else {
  1335. performPage();
  1336. }
  1337. }));
  1338. if (onSearchPage) {
  1339. $('#sidebar').append(p);
  1340. } else if ($('h1.header:first').length) {
  1341. $('h1.header:first').parent().append(p);
  1342. } else {
  1343. $('#title-overview-widget').parent().append(p);
  1344. }
  1345. }
  1346.  
  1347. //------------------------------------------------------
  1348. // Icons at top bar
  1349. //------------------------------------------------------
  1350.  
  1351. // Adds a dictionary of icons to the top of the page.
  1352. // Unlike the other URLs, they aren't checked to see if the movie exists.
  1353. function addIconBar(movie_id, movie_title, movie_title_orig) {
  1354. var iconbar;
  1355. if ($('h1.header:first').length) {
  1356. iconbar = $('h1.header:first').append($('<br/>'));
  1357. } else if ($('.title_wrapper h1').length) {
  1358. iconbar = $('.title_wrapper h1').append($('<br/>'));
  1359. } else if ($('h3[itemprop="name"]').length) {
  1360. iconbar = $('h3[itemprop="name"]').append($('<br/>'));
  1361. } else {
  1362. iconbar = $('#tn15title .title-extra');
  1363. }
  1364. $.each(icon_sites, function(index, site) {
  1365. if (site['show']) {
  1366. var search_url = replaceSearchUrlParams(site, movie_id, movie_title, movie_title_orig);
  1367. var image = getFavicon(site);
  1368. var html = $('<span />').append("&nbsp;").attr('style', 'font-size: 11px;').append(
  1369. $('<a />').attr('href', search_url)
  1370. .addClass('iconbar_icon').append(image));
  1371. iconbar.append(html).append();
  1372. }
  1373. });
  1374. //If we have access to the openInTab function, add an Open All feature
  1375. if (GM_openInTab) {
  1376. var aopenall = $('<a />').text('Open All')
  1377. .prepend("&nbsp;")
  1378. .attr('href', 'javascript:;')
  1379. .attr('style', 'font-weight:bold;font-size:11px;font-family: Calibri, Verdana, Arial, Helvetica, sans-serif;');
  1380. aopenall.click(function() {
  1381. $('.iconbar_icon').each(function() {
  1382. GM_openInTab($(this).attr('href'));
  1383. });
  1384. }, false);
  1385. iconbar.append(aopenall);
  1386. }
  1387. }
  1388.  
  1389. //------------------------------------------------------
  1390. // Search page code
  1391. //------------------------------------------------------
  1392.  
  1393. function performSearch() {
  1394. //Add css for the new table cells we're going to add
  1395. var styles = '.result_box {width: 335px}';
  1396. styles += ' .result_box a { margin-right: 5px; color: #444;} ';
  1397. styles += ' .result_box a:visited { color: #551A8B; }';
  1398. styles += ' #content-2-wide #main, #content-2-wide';
  1399. styles += ' .maindetails_center {margin-left: 5px; width: 1001px;} ';
  1400. GM_addStyle(styles);
  1401.  
  1402. if($('div#main table.results tr.detailed').length !== 0) {
  1403. //Loop through each result row
  1404. $('div#main table.results tr.detailed').each(function() {
  1405. var link = $(this).find('.title>a');
  1406. var is_tv = Boolean($(this).find('.year_type').html()
  1407. .match('TV Series'));
  1408. var is_movie = Boolean($(this).find('.year_type').html()
  1409. .match(/\(([0-9]*)\)/));
  1410. var movie_title = link.html();
  1411. var movie_title_orig = movie_title;
  1412. var movie_id = link.attr('href').match(/tt([0-9]*)\/?$/)[1];
  1413.  
  1414. $(this).find('span.genre a').each(function() {
  1415. if ($(this).html() == 'Adult') {
  1416. $(this).parent().parent().parent()
  1417. .css('background-color', 'red');
  1418. }
  1419. });
  1420. perform($(this), movie_id, movie_title, movie_title_orig, is_tv, is_movie);
  1421. });
  1422. } else {
  1423. // Chameleon code, in a different style
  1424. var titleDivs = document.getElementsByClassName('col-title');
  1425. var compact = true;
  1426. if(titleDivs.length === 0)
  1427. {
  1428. titleDivs=document.getElementsByClassName('lister-item-header');
  1429. compact=false;
  1430. }
  1431. for(var i=0; i<titleDivs.length; i++)
  1432. {
  1433. var t = titleDivs[i];
  1434. var link = t.getElementsByTagName('a')[0];
  1435. var is_tv = link.nextElementSibling.textContent.indexOf('-')!==-1;
  1436. var is_movie = !is_tv;
  1437. var movie_title = link.textContent;
  1438. var movie_title_orig = movie_title;
  1439. var movie_id = link.href.split("/title/tt")[1].split("/")[0];
  1440.  
  1441. var elem = t.parentNode.parentNode;
  1442. if(!compact)
  1443. elem = t.parentNode;
  1444. perform(elem, movie_id, movie_title, movie_title_orig, is_tv, is_movie);
  1445. }
  1446. }
  1447. }
  1448.  
  1449. //------------------------------------------------------
  1450. // Watchlist page code
  1451. //------------------------------------------------------
  1452.  
  1453. function performWatchlist() {
  1454. //Add css for the new table cells we're going to add
  1455. var styles = '.result_box {width: 335px}';
  1456. styles += ' .result_box a { margin-right: 5px; color: #444;} ';
  1457. styles += ' .result_box a:visited { color: #551A8B; }';
  1458. styles += ' #content-2-wide #main, #content-2-wide';
  1459. styles += ' .maindetails_center {margin-left: 5px; width: 1001px;} ';
  1460. GM_addStyle(styles);
  1461. if($('div .lister-list.mode-detail').children().length !== 0) {
  1462. $('div .lister-list.mode-detail').children().each(function() {
  1463. var link = $(this).find('.lister-item-header>a');
  1464. var is_tv = Boolean($(this).find('.lister-item-details').html()
  1465. .match('TV Series'));
  1466. var is_movie = Boolean($(this).find('.lister-item-year').html()
  1467. .match(/^([0-9]*)$/));
  1468. var movie_title = link.html();
  1469. var movie_title_orig = movie_title;
  1470. var movie_id = link.attr('href').match(/tt([0-9]*)\/?.*/)[1];
  1471. perform($(this), movie_id, movie_title, movie_title_orig, is_tv, is_movie);
  1472. });
  1473. }
  1474. }
  1475.  
  1476. //------------------------------------------------------
  1477. // TV/movie page code
  1478. //------------------------------------------------------
  1479.  
  1480. function performPage() {
  1481. var movie_title = $('.title_wrapper>h1').clone().children().remove().end().text();
  1482. if (movie_title === "") {
  1483. movie_title = $('h3[itemprop="name"]').text().trim();
  1484. }
  1485. var movie_title_orig = $('.originalTitle').clone().children().remove().end().text();
  1486. if (movie_title_orig === "") {
  1487. movie_title_orig = movie_title;
  1488. }
  1489. var movie_id = document.URL.match(/\/tt([0-9]+)\//)[1].trim('tt');
  1490. var is_tv_page = Boolean($('title').text().match('TV Series')) ||
  1491. Boolean($('.tv-extra').length);
  1492. var is_movie_page = Boolean($('title').text().match(/.*? \(([0-9]*)\)/));
  1493. //Create area to put links in
  1494. perform(getLinkArea(), movie_id, movie_title, movie_title_orig,
  1495. is_tv_page, is_movie_page);
  1496. addIconBar(movie_id, movie_title, movie_title_orig);
  1497. }
  1498.  
  1499. //------------------------------------------------------
  1500. // Find/create elements
  1501. //------------------------------------------------------
  1502.  
  1503. function getLinkArea() {
  1504. // If it already exists, just return it
  1505. if ($('#imdbscout_header').length) {
  1506. return $('#imdbscout_header');
  1507. }
  1508. var p = $('<p />').append('<h2>' + GM_config.get('imdbscoutmod_header_text') + '</h2>').attr('id', 'imdbscout_header').css({
  1509. 'padding': '0px 20px',
  1510. 'font-weight': 'bold'
  1511. });
  1512. var background_color = (GM_config.get('new_layout_dark')) ? '#333333' : '#EEEEEE';
  1513. var txt_color = (GM_config.get('new_layout_dark')) ? '#EEEEEE' : '#333333';
  1514. var p_new = $('<p />').append(GM_config.get('imdbscoutmod_header_text')).attr('id', 'imdbscout_header').css({
  1515. 'padding': '4px 11px',
  1516. 'font-weight': 'bold',
  1517. 'background-color': background_color,
  1518. 'margin-top': '0px',
  1519. 'margin-bottom': '0px',
  1520. 'overflow': 'hidden',
  1521. 'color': txt_color
  1522. });
  1523. if (GM_config.get('use_new_layout')) {
  1524. var p = p_new;
  1525. }
  1526. $.each(valid_states, function(i, name) {
  1527. if (GM_config.get('one_line')) {
  1528. p.append($('<span />').attr('id', 'imdbscout_' + name));
  1529. } else {
  1530. var title = $('<span>' + name.replace('_', ' ') + ': </span>').css({
  1531. 'textTransform': 'capitalize',
  1532. 'min-width': '100px',
  1533. 'display': 'inline-block'
  1534. });
  1535. p.append($('<div />').attr('id', 'imdbscout_' + name).append(title));
  1536. }
  1537. });
  1538. if ($('h1.header:first').length) {
  1539. $('h1.header:first').parent().append(p);
  1540. } else if (GM_config.get('use_new_layout')) {
  1541. if ($('.button_panel.navigation_panel').length) {
  1542. $('.button_panel.navigation_panel').after(p);
  1543. } else if ($('.title_block').length) {
  1544. $('.title_block').after(p);
  1545. }
  1546. } else if ($('#title-overview-widget').length && !GM_config.get('use_new_layout')) {
  1547. $('#title-overview-widget').parent().append(p);
  1548. } else if ($('.titlereference-header').length) {
  1549. $('.titlereference-header').append(p);
  1550. } else {
  1551. $('#tn15rating').before(p);
  1552. }
  1553. return $('#imdbscout_header');
  1554. }
  1555.  
  1556. //------------------------------------------------------
  1557. // Create the config name
  1558. //------------------------------------------------------
  1559.  
  1560. function configName(site) {
  1561. if ('configName' in site) {
  1562. return 'show_' + site['configName'] + (site['TV'] ? '_TV' : '');
  1563. } else {
  1564. return 'show_' + site['name'] + (site['TV'] ? '_TV' : '');
  1565. }
  1566. }
  1567.  
  1568. //------------------------------------------------------
  1569. // Code being run (main)
  1570. //------------------------------------------------------
  1571.  
  1572. // Get everything configured
  1573.  
  1574. // Create the non-site dictionary for GM_config
  1575. var config_fields = {
  1576. 'imdbscoutmod_header_text': {
  1577. 'label': 'Header text for torrent sites:',
  1578. 'type': 'text',
  1579. 'default': ''
  1580. },
  1581. 'cfg_icons_size': {
  1582. 'label': 'Size of the icons (pixels):',
  1583. 'type': 'text',
  1584. 'default': '20'
  1585. },
  1586. 'use_new_layout': {
  1587. 'section': 'Movie Page:'.bold(),
  1588. 'type': 'checkbox',
  1589. 'label': 'Use the new layout?',
  1590. 'default': true
  1591. },
  1592. 'new_layout_dark': {
  1593. 'type': 'checkbox',
  1594. 'label': 'Dark background for the new layout?',
  1595. 'default': true
  1596. },
  1597. 'loadmod_on_start_movie': {
  1598. 'type': 'checkbox',
  1599. 'label': 'Load on start?',
  1600. 'default': true
  1601. },
  1602. 'call_http_mod_movie': {
  1603. 'type': 'checkbox',
  1604. 'label': 'Actually check for torrents?',
  1605. 'default': true
  1606. },
  1607. 'hide_missing_movie': {
  1608. 'type': 'checkbox',
  1609. 'label': 'Hide missing links?',
  1610. 'default': false
  1611. },
  1612. 'use_mod_icons_movie': {
  1613. 'type': 'checkbox',
  1614. 'label': 'Use icons instead of text?',
  1615. 'default': true
  1616. },
  1617. 'one_line': {
  1618. 'type': 'checkbox',
  1619. 'label': 'Show results on one line?',
  1620. 'default': true
  1621. },
  1622. 'ignore_type_movie': {
  1623. 'type': 'checkbox',
  1624. 'label': 'Search all sites, ignoring movie/tv distinction?',
  1625. 'default': false
  1626. },
  1627. 'highlight_missing_movie': {
  1628. 'label': 'Highlight when not on:',
  1629. 'type': 'text',
  1630. 'default': ''
  1631. },
  1632. 'loadmod_on_start_search': {
  1633. 'section': 'Search Page:'.bold(),
  1634. 'type': 'checkbox',
  1635. 'label': 'Load on start?',
  1636. 'default': false
  1637. },
  1638. 'call_http_mod_search': {
  1639. 'type': 'checkbox',
  1640. 'label': 'Actually check for torrents?',
  1641. 'default': false
  1642. },
  1643. 'hide_missing_search': {
  1644. 'type': 'checkbox',
  1645. 'label': 'Hide missing links?',
  1646. 'default': false
  1647. },
  1648. 'use_mod_icons_search': {
  1649. 'type': 'checkbox',
  1650. 'label': 'Use icons instead of text?',
  1651. 'default': true
  1652. },
  1653. 'ignore_type_search': {
  1654. 'type': 'checkbox',
  1655. 'label': 'Search all sites, ignoring movie/tv distinction?',
  1656. 'default': false
  1657. },
  1658. 'watchlist_as_search': {
  1659. 'type': 'checkbox',
  1660. 'label': 'Treat the watchlist a a search page?',
  1661. 'default': false
  1662. },
  1663. 'highlight_missing_search': {
  1664. 'label': 'Highlight when not on:',
  1665. 'type': 'text',
  1666. 'default': ''
  1667. }
  1668. };
  1669.  
  1670. // Add each public site to a GM_config dictionary schema
  1671. // The GM_config default for checkboxes is false
  1672. $.each(public_sites, function(index, site) {
  1673. config_fields[configName(site)] = {
  1674. 'section': (index == 0) ? ['Public download sites:'.bold()] : '',
  1675. 'type': 'checkbox',
  1676. 'label': ' ' + site['name'] + (site['TV'] ? ' (TV)' : '')
  1677. };
  1678. });
  1679.  
  1680. // Add each private site to a GM_config dictionary schema
  1681. // The GM_config default for checkboxes is false
  1682. $.each(private_sites, function(index, site) {
  1683. config_fields[configName(site)] = {
  1684. 'section': (index == 0) ? ['Private download sites:'.bold()] : '',
  1685. 'type': 'checkbox',
  1686. 'label': ' ' + site['name'] + (site['TV'] ? ' (TV)' : '')
  1687. };
  1688. });
  1689.  
  1690. // Icon sites should be shown by default though,
  1691. // since they barely use any resources.
  1692. $.each(icon_sites, function(index, icon_site) {
  1693. config_fields['show_icon_' + icon_site['name']] = {
  1694. 'section': (index == 0) ? ['Other sites:'.bold()] : '',
  1695. 'type': 'checkbox',
  1696. 'label': ' ' + icon_site['name'],
  1697. 'default': ('showByDefault' in icon_site) ?
  1698. icon_site['showByDefault'] : true
  1699. };
  1700. });
  1701.  
  1702. // Initialize and register GM_config
  1703. GM_config.init({
  1704. 'id': 'imdb_scout',
  1705. 'title': 'IMDb Scout Mod Preferences',
  1706. 'fields': config_fields,
  1707. 'css': '.section_header { \
  1708. background: white !important; \
  1709. color: black !important; \
  1710. border: 0px !important; \
  1711. text-align: left !important;} \
  1712. .field_label { \
  1713. font-weight: normal !important;}',
  1714. 'events':
  1715. {
  1716. 'open': function() {
  1717. $('#imdb_scout').contents().find('#imdb_scout_section_2').find('.field_label').each(function(index, label) {
  1718. var url = new URL(public_sites[index].searchUrl);
  1719. $(label).append(' ' + '<a class="grey_link" target="_blank" style="color: gray; text-decoration : none" href="' + url.origin + '">'
  1720. + (/www./.test(url.hostname) ? url.hostname.match(/www.(.*)/)[1] : url.hostname) + '</a>');
  1721. $(label).prepend(getFavicon(public_sites[index], true));
  1722. });
  1723. $('#imdb_scout').contents().find('#imdb_scout_section_3').find('.field_label').each(function(index, label) {
  1724. var url = new URL(private_sites[index].searchUrl);
  1725. $(label).append(' ' + '<a class="grey_link" target="_blank" style="color: gray; text-decoration : none" href="' + url.origin + '">'
  1726. + (/www./.test(url.hostname) ? url.hostname.match(/www.(.*)/)[1] : url.hostname) + '</a>');
  1727. $(label).prepend(getFavicon(private_sites[index], true));
  1728. });
  1729. $('#imdb_scout').contents().find('#imdb_scout_section_4').find('.field_label').each(function(index, label) {
  1730. $(label).prepend(getFavicon(icon_sites[index], true));
  1731. });
  1732. }
  1733. }
  1734. });
  1735.  
  1736. GM_registerMenuCommand('IMDb Scout Mod Preferences', function() {GM_config.open()});
  1737.  
  1738. // Fetch per-site values from GM_config
  1739. $.each(sites, function(index, site) {
  1740. site['show'] = GM_config.get(configName(site));
  1741. });
  1742.  
  1743. $.each(icon_sites, function(index, icon_site) {
  1744. icon_site['show'] = GM_config.get('show_icon_' + icon_site['name']);
  1745. });
  1746.  
  1747. // Are we on a search page?
  1748. // This variable is camelCased to show it's global
  1749. // Hopefully it can be factored out of the global scope in the future
  1750. var onSearchPage = Boolean(location.href.match('search')) || Boolean(location.href.match('watchlist'));
  1751.  
  1752. $('title').ready(function() {
  1753. if (window.top == window.self) {
  1754. if (!onSearchPage && GM_config.get('loadmod_on_start_movie')) {
  1755. performPage();
  1756. } else if (onSearchPage && GM_config.get('loadmod_on_start_search')) {
  1757. if (Boolean(location.href.match('watchlist')) && GM_config.get('watchlist_as_search')) {
  1758. performWatchlist();
  1759. } else {
  1760. performSearch();
  1761. }
  1762. } else {
  1763. displayButton();
  1764. }
  1765. }
  1766. });