IMDb Scout Mod

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

目前为 2020-09-01 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name IMDb Scout Mod
  3. // @namespace https://github.com/Purfview/IMDb-Scout-Mod
  4. // @description Add links from IMDb pages to torrent and other 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 6.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.tld/list/*
  15. // @include http*://*.imdb.com/title/tt*
  16. // @include http*://*.imdb.com/search/title*
  17. // @include http*://*.imdb.com/user/*/watchlist*
  18. // @include http*://*.imdb.com/list/*
  19. //
  20. // @connect *
  21. // @grant GM_log
  22. // @grant GM_getValue
  23. // @grant GM_setValue
  24. // @grant GM_addStyle
  25. // @grant GM_openInTab
  26. // @grant GM_xmlhttpRequest
  27. // @grant GM_registerMenuCommand
  28. //
  29. // ==/UserScript==
  30. //
  31. /*========================= Version History ==================================
  32.  
  33. 1.00 - Initial public release, everything works on barebones greasemonkey
  34.  
  35. 1.50 - Added the ability to select which sites to load from the GM script commands
  36. - Moved the required method to userscripts
  37. - Removed FH, NZB, Avax
  38.  
  39. 1.60 - Added style elements and shading to display on imdb
  40.  
  41. 1.62 - Fixed bug:SCC-ARC not removing when unchecked
  42. - Alphabetized list
  43.  
  44. 1.70 - Cleaned up code
  45. - Added option to not run script on page load
  46.  
  47. 1.71 - Deprecated action-box field
  48.  
  49. 1.80 - Added icons that link to OpenSubs, Criticker, RT, YT
  50.  
  51. 1.81 - Added support for tv, only displays on shows listed as 'tv series'
  52. - Added support for icheckmovies at top bar.
  53.  
  54. 1.82 - Fixed title parsing for tv shows.
  55.  
  56. 1.83 - Fixed dhive not working properly
  57.  
  58. 1.90 - Set height of preference window to 450px, added scroll bar
  59.  
  60. 1.91 - Added another 11 torrent sites
  61.  
  62. 2.00 - Added auto updater
  63.  
  64. 2.01 - Added TC, FreshOn, TVT, STF, CC
  65. - Cleaned up code (tabbing)
  66. - Removed THR
  67. - Added TV-Rage to top bar
  68.  
  69. 2.02 - Added PS, THC, HH, HDStar
  70. - Fixed CC false positive
  71.  
  72. 2.03 - TehC now uses tt
  73. - Added Raymoz mod for AT
  74.  
  75. 2.04 - Added HDbits
  76. - Added TL
  77.  
  78. 2.10 - Added genre page search functionality
  79.  
  80. 2.11 - Fixed ICM because Nuked was whining
  81.  
  82. 2.12 - Removed tvrage
  83. - Fixed iCM (added tt)
  84. - Added HDVNbits
  85. - Changed RevTT to .me
  86. - Added HDT
  87. - removed autoupdate
  88.  
  89. 2.13 - removed xvidme
  90. - reinstated autoupdate
  91. - removed google chrome code
  92. - fixed hdvn and hdt issues
  93.  
  94. 2.14 - Added @grant entries for API access
  95. - Fixed tt parser to work on imdb pages with referral info in url
  96.  
  97. 2.2 - Switch preferences window to use GM_config
  98. - Consolidate icon & site lists
  99. - Added IPT, KASS, sHD, and HDW
  100. - Fix "Open All" link
  101. - Add option for strikethroughs on search page
  102. - Removed arrays from search URLs
  103. - Spring cleaning
  104.  
  105. 2.21 - Added SSL to TVT, HDME, TC, AHD, IPT, SCC
  106. - Added SSL option for CG
  107. - Added GFT, GFT-Gems, GFT-TV
  108. - Fixed SCC, SCC-ARC search URL
  109. - Removed TheBox, TheDVDClub
  110. - Added more comments, cleaned up some more stuff
  111.  
  112. 2.22 - Fixed TehC, BTN, BTN-Req, THC
  113. - Added a bunch of TV sites, courtesy of seedless
  114. - Added "both" option for sites, and made changes
  115. to allow coexistence of movie and TV sites with
  116. the same name
  117. - Code re-organization, documentation
  118. - Re-added code to allow an array for searchUrl
  119.  
  120. 2.22.1 - Minor fixes
  121.  
  122. 2.23 - Fixed THC, BTN
  123. - Distinguish between movies and TV on search page
  124.  
  125. 2.24 - Separate load_on_start option for search page
  126. - Fix search_string on search page
  127.  
  128. 2.25 - Added some helpful text when no sites have been enabled
  129.  
  130. 2.26 - Added code to show links when on pages besides just the "front" one
  131. (e.g. http://www.imdb.com/title/tt2310332/reference)
  132.  
  133. 2.26.1 - Correctly detect TV shows when on aforementioned pages.
  134.  
  135. 2.3 - Incorporate a bunch of changes courtesy of Inguin:
  136. - Added SSL to AT, TE, D-noid, TG, YT, RT
  137. - Changed tracker short titles to canonical form ADC, KG
  138. - Updated D-noid from .me to .pw
  139. - Fixed broken AT search; also updated to use .me so avoids redirect
  140. - Added BitHQ, ET (eutorrents)
  141. - Removed two broken THC; replaced with one fixed
  142. - Removed iplay, horrorhaven, hdstar, scandbits, leecherslair
  143. - Removed needless CG http/https duplication - plenty of listed sites self-sign
  144. - A-Z sites list for readability
  145. - Cleanup YT search string
  146. - Copyedits
  147. - Clean up code (tabs, trailing spaces)
  148. - Use consistent naming style
  149. - Added Letterboxd, Subscene to icons
  150. - Added options for showing icons
  151.  
  152. 2.31 - Added preliminary check for TSH
  153. - Change all SCC links to .org
  154.  
  155. 2.31.1 - Typo fix
  156.  
  157. 2.32 - On uncertain pages, display both movie and TV sites
  158.  
  159. 2.33 - Add year to possible search params
  160. - Add rutorrent
  161.  
  162. 2.33.1 - Change KG to .in
  163.  
  164. 2.33.2 - Change TSH to .me
  165.  
  166. 2.34 - Updated AT, TPB
  167. - Removed HDWing, TVT and CHDBits
  168. - Added RARBG
  169. - Re-added reverse match checking to support rarbg
  170.  
  171. 2.35 - Fixed YouTube icon, add SubtitleSeeker icon
  172. - Added FL.ro, bB, BHD, HDS
  173. - Fixed TL, TehC, HDb, HDVN, AHD, KG
  174. - Renamed reverseMatch to positiveMatch
  175.  
  176. 2.36 - Added Wikipedia to icon sites
  177.  
  178. 2.36.1 - Typo fix
  179.  
  180. 2.37 - Add PxHD
  181.  
  182. 2.38 - Fix subtitle seeker
  183. - Added CG-c
  184. - Added FilmAffinity
  185. - Added option to skip http check entirely
  186.  
  187. 2.38.1 - Typo fix
  188.  
  189. 2.38.2 - Global replace parameters
  190.  
  191. 2.38.3 - Typo fix
  192.  
  193. 3.00 - Clean up some formatting
  194. - Add support for new IMDb page format
  195. - Update jquery
  196.  
  197. 3.0.1 - Added Classix
  198.  
  199. 3.0.2 - Updated documentation/comments
  200.  
  201. 3.0.3 - Removed GOEM, FY, PS, MT
  202. - Added Metacritic, CanIStream.It?, AllMovie, Facebook, Amazon, Cartoon Chaos, MySpleen, Secret Cinema
  203. - Fixed Wikipedia icon
  204.  
  205. 3.1 - Handle HTTP failures less silently
  206.  
  207. 3.1.1 - Fix KASS
  208.  
  209. 3.1.2 - Fix TPB, TE, HDT
  210. - Add MTV, DVDSeed
  211.  
  212. 3.1.3 - Add M-T, UHDB, HDC, Blu-ray.com
  213. - Fix scenehd, RT
  214.  
  215. 3.1.4 - Add HDClub
  216.  
  217. 3.2 - Fix the button on new-style pages
  218.  
  219. 3.2.1 - Fix AHD
  220.  
  221. 3.3 - Be less obnoxious about failed calls
  222.  
  223. 3.4 - Add Netflix icon
  224. - Remove a default parameter to satisfy Chrome
  225.  
  226. 3.5 - Add KZ, NNM, BB-HD, t411, TD, Rutor
  227. - Fix HDClub
  228. - Fix preferences in Chrome, sort sites properly
  229.  
  230. 3.5.1 - Remove DHive, Fix AHD
  231.  
  232. 4.0 - Bring in UI changes courtesy of janot
  233. - Add spaceEncode and goToUrl to site options
  234. - Add option to show results as links instead of text
  235. - Differentiate between missing and logged out
  236. - General refactoring
  237.  
  238. 4.1 - Add RARAT
  239.  
  240. 4.2 - Fix t411
  241. - Use magic .tld domain in @include
  242.  
  243. 4.3 - Set @connect in metadata block
  244.  
  245. 4.3.1 - Fix THC
  246.  
  247. 4.3.2 - Add AR, TtN
  248. - Add year and "trailer" to youtube search
  249. - Fix M-team
  250.  
  251. 4.3.3 - Fix BitHQ, PTP-Req, SCC
  252.  
  253. 4.3.4 - Fix M-team, myspleen, avistaz, eutorrents
  254. - Removed KAT
  255.  
  256. 4.3.5 - Fix IPT, Freshon
  257. - Add ExtraTorrent
  258.  
  259. 4.3.6 - Fix Demonoid, EuTorrents (now CinemaZ)
  260. - Fix "Actually search for torrents" option
  261. - Add PrivateHD for movies and tv
  262.  
  263. 4.3.7 - Apply CinemaZ fixes to AvistaZ as well
  264.  
  265. 4.3.8 - Fix SurrealMoviez and MySpleen, switch to new PTP url
  266.  
  267. 4.3.9 - Fix criticker, add CN
  268.  
  269. 4.3.10 - Fix Netflix, MTV
  270.  
  271. 4.3.11 - Add CHD back
  272.  
  273. 4.3.12 - Fix typo
  274.  
  275. 4.4 - Fix BeyondHD
  276. - Allow unicode when searching by name
  277.  
  278. 4.4.1 - Add trakt.tv
  279.  
  280. 4.4.2 - Added XS, HD-S, PTN, TBD, Blutopia
  281. - Removed Freshon, CN, ExT, t411, SCC
  282. - Fixed SC, TE, TG, Tik
  283. - Add .com for script runners that don't support .tld
  284.  
  285. 4.5 - (Chameleon)
  286. - Added an option to run on ILC request pages
  287. - Fixed running on reference pages (new imdb style)
  288. - Added a delay of 1 second between loading the same site (by domain) - no more popcorn quota timeouts
  289. - Fixed running on search pages
  290.  
  291. 4.5.1 - Removed (dead): BitHQ, TehC, FSS, ExtraTorrent, Cine-Clasico, and Secret-Cinema
  292. - Fixed the hack on goToUrl
  293.  
  294. 4.5.2 - Fixed filelist.ro, Tik, TD
  295. - Added HDHome, HDU, OurBits
  296.  
  297. 4.5.3 - Fixed TG, TE, HDSpace
  298. - Added XS
  299.  
  300. 4.5.4 - Fixed HDU
  301.  
  302. 4.5.5 - Fixed BHD
  303.  
  304. 4.6 - Option to highlight if the movie is missing from PTP
  305.  
  306. 4.7 - Added option to ignore the movie/tv distinction
  307.  
  308. 4.7.1 - Fix blutopia, hdchina, indenting
  309.  
  310. 4.7.2 - Fix SDBits, M-T
  311. - Add TTGg
  312.  
  313. 4.7.3 - Enable on https versions of imdb sites
  314. - Add TTG
  315.  
  316. 4.8.0 - Add FinVip, JoyHD, TO, TP, TS, TVCK
  317. - Fix TE, HDH, CZ, Subscene
  318. - Remove SubtitleSeeker
  319. - Rip out all site-specific code
  320. - Fix up minor code smells
  321. - Allow config name to be different from site name
  322.  
  323. 4.8.1 - Add SP
  324.  
  325. 4.8.2 - Add TMDB
  326.  
  327. 4.8.3 - Add TGx
  328. - Fix TTG, JoyHD, HDH
  329. - Remove duplicate TMDB
  330.  
  331. 4.9.0 - Add support for a user's watchlist
  332.  
  333. 4.10.0 - Add support for icon sites on the reference view
  334. - Add HTTPS for icon sites that support it
  335.  
  336. 4.11.0 - Fix search_string
  337.  
  338. 4.11.1 - Remove Blutopia
  339. Fix IPT
  340.  
  341. 4.11.2 - Add unogs
  342.  
  343. 4.11.3 - Fix TVDB
  344.  
  345. 4.11.4 - Add AB, remove ADC
  346. - Fix BHD, Demonoid, TPB, M-T, U2, BTN, BitHD
  347.  
  348. 4.11.5 - Fix conditional check
  349.  
  350. 4.12 - Update SDBits, BTN, PTP, TMDB
  351. - Apply some correctness changes
  352.  
  353. 4.12.1 - Add CCT
  354. - Update CHD, AB, TTG
  355.  
  356.  
  357. #==============================================================================#
  358. # IMDb Scout Mod:
  359. #==============================================================================#
  360.  
  361. 4.12.1-mod1 - First public release. New additions, tweaks, bugfixes.
  362.  
  363. What I can remember:
  364. - Added: Blu, Retroflix, ACM, PTE, KG Requests, SC Requests.
  365. - Tweak: Classix search, and split to Movie/TV.
  366. - Tweak: Bunch of 'loggedOutRegex' added.
  367. - Fixed: Bunch of icons.
  368. - Fixed: TL, TPB.
  369. - Fixed: Bug in 'loggedOutRegex' logic.
  370. - New feature: Distinct icons on Requests.
  371.  
  372. 4.12.1-mod2 - Removed: Canistream.it
  373. - Fixed: Few icons.
  374. - Fixed: Search bug if ampersand is in the title
  375.  
  376. 4.12.1-mod3 - Removed: RARAT.
  377. - Added: Rarelust & Zooqle.
  378. - New feature: Sites are split to public & private (config menu).
  379.  
  380. 4.12.1-mod4 - Added: YGG, CG Requests.
  381. - Tweak: CG-Cocks & CG Request icons.
  382. - Tweak: RuT search, split to TV/Movie.
  383. - Fixed: Filter out filled KG Requests.
  384. - New feature: %search_string_orig% (search by the original titles
  385. on the movie/tv pages), enabled on RuT and YGG.
  386.  
  387. 4.12.1-mod5 - Fixed: CG Request. Demonoid typo.
  388.  
  389. 4.12.1-mod6 - Removed: HDVN, HoundDawgs.
  390. - Added: 1337x, ETTV, LimeTor, HDSpain, RlsBB, DB, FF, THR, PTer.
  391. - Fixed: TD, Demonoid, RARBG.
  392. - Tweak: Bold'ed the titles of config menu sections for better visibility.
  393. - Tweak: 'Other titles' sorted in alphabetical order.
  394. - Tweak: Added 'loggedOutRegex' to all private & some public sites.
  395. - Fixed: All borked icons are fixed.
  396. - Fixed: Bug in 'loggedOutRegex' (false negative if site responds with redirect).
  397.  
  398. 4.12.1-mod7 - Added: BRT.
  399. - Tweak: SDBits, U2.
  400.  
  401. 5.0 - Fix: @namespace & @name changed to fix updating for plugins.
  402.  
  403. 5.1 - Tweak: TVV, BB-HD.
  404. - Fixed: Invisible icons on dark background JoyHD, Rarelust, CZ, Zooqle, KG.
  405. - New feature: The new layout (icons are placed at top). Option to turn it off.
  406. - New feature: Option to select background for the new layout.
  407.  
  408. 5.2 - Tweak: Small tweaks (some preferences will reset to default).
  409. - Fixed: Rarelust icon.
  410.  
  411. 5.2.1 - Fixed: Rarelust icon (forgot to update it)
  412. - Added: RlsBB-Proxy ('RlsBB' now points to the main domain)
  413.  
  414. 5.3 - Added: Tik-Req, AHD-Req.
  415. - Tweak: No icon borders if "Show results on one line" is off.
  416. - Fixed: Text color on the new layout.
  417. - New feature: Option to change size of the icons.
  418.  
  419. 5.3.1 - Added: JPTV.
  420. - Fixed: ACM icon.
  421.  
  422. 5.4 - Added: AG, CPS, Deildu (as public because open reg).
  423. - Tweak: PTP, DVDSeeds, AHD, PTer.
  424. - Fixed: Button code for legacy & new layout.
  425. - Fixed: Reference view for the new layout.
  426.  
  427. 5.5 - Added: PreDB & dozen of the subtitles sites (all of it is set to the 2nd bar).
  428. - Fixed: Subscene
  429. - New Feature: New 'Subtitles' & 'Other searchable sites' sections (config menu), all set to 2nd bar.
  430. - New Feature: Two extra searchable bars for the movies page (Search/Watchlist page shows only 1st bar).
  431. - New Feature: Extra bars can be enabled/disabled/swapped at the preferences.
  432. - New Feature: Two new 'inSecondSearchBar' and 'inThirdSearchBar' attributes.
  433. Subtitles & Other searchable sites are set to 2nd bar.
  434. 3rd bar is empty, free space for custom configuration.
  435.  
  436. 5.5.1 - Added: TVV-Req, GT, WC, RareFilm, Titlovi, MoviePosterDB, Ulož, srrDB, xREL.
  437. Tweak: PreDB, TE, 1337x, LimeTor, HDB, BTN.
  438.  
  439. 5.5.2 - Added: XDCC, ixIRC.
  440. Tweak: GT.
  441.  
  442. 5.5.3 - Added: EUC, 1337x-Proxy, LimeTor-Proxy.
  443.  
  444. 6.0 - Added: BTN-Title (if someone prefer to search by the titles).
  445. - Tweak: PTP, "Your popcorn quota" added to loggedOutRegex.
  446. - Tweak: Refinement of code, comments and documentation.
  447. - Fixed: "TV Special" is not recognized as "TV" (now it works same as "TV Movie").
  448. - Fixed: Broken TV/Movie distinction on the Search/Watchlist pages.
  449. - Fixed: Broken Watchlist search if "episode" is present.
  450. - Fixed: Broken 'Load' button on Watchlist pages.
  451. - Fixed: Broken %year% search on Search/Watchlist pages.
  452. - Fixed: Broken %goToUrl% on Search/Watchlist pages when "check for results" is on.
  453. - Fixed: Broken %goToUrl% on all pages when "check for results" is off.
  454. - Fixed: Broken %year% on TV-series pages.
  455. - Removed: 'Treat the watchlist as a search page?' option.
  456. - New Feature: Documentaries are treated as TV & Movie.
  457. - New Feature: %search_string_orig% works on Search/List/Watchlist pages too.
  458. - New Feature: Script supports List pages.
  459.  
  460. 6.0.1 - Added: TSeeds.
  461.  
  462. 6.0.2 - Tweak: TSeeds.
  463.  
  464. 6.1 - Added: DC.
  465. - Tweak: BTN-Title, WC, TVV, TVV-Req, ACM, Blu, JPTV, M-T, U2 and ect..
  466. - Tweak: Some code optimizations.
  467. - New Feature: Connection rate limiting for IMDb's domain.
  468. Sites are added more consequent on Search/List pages.
  469. - New Feature: Dynamic rates. Search on Title pages are much faster now.
  470. - New Feature: Optional 'rateLimit' attribute for sites.
  471.  
  472.  
  473. //==============================================================================
  474. // A list of all the sites.
  475. //==============================================================================
  476.  
  477. -= Each site is a dictionary with the following attributes: =-
  478.  
  479. # 'name':
  480. The site name, abbreviated.
  481.  
  482. # 'searchUrl':
  483. The URL to perform the search against, see below for how to tailor the string to a site.
  484.  
  485. # 'matchRegex':
  486. The string which appears if the searchUrl *doesn't* return a result.
  487.  
  488. # 'positiveMatch' (optional):
  489. Changes the test to return true if the searchUrl *does* return a result that matches matchRegex.
  490.  
  491. # 'TV' (optional):
  492. If true, it means that this site will only show up on TV pages.
  493. By default, sites only show up on movie pages.
  494.  
  495. # 'both' (optional):
  496. Means that the site will show up on both movie and TV pages.
  497.  
  498. # 'SpaceEncode' (optional):
  499. Changes the character used to encode spaces in movie/TV titles. The default is '+'.
  500.  
  501. # 'goToUrl' (optional):
  502. Most of the time the same URLs that are used for checking are the ones that
  503. are used to actually get to the movie, but this allows overriding that.
  504.  
  505. # 'loggedOutRegex' (optional):
  506. If any text on the page matches this regex, the site is treated as being logged out,
  507. rather than mising the movie. This option is not effected by positiveMatch.
  508.  
  509. # 'ConfigName' (optional):
  510. Use this to allow changing names without breaking existing users.
  511.  
  512. # 'inSecondSearchBar' & 'inThirdSearchBar' (optional):
  513. Places site at the extra searchable bar. Subtitles and other sites are set to 2nd bar.
  514. 3rd bar is empty, space for custom user's configuration. By defaut site goes to the 1st bar.
  515. Extra bars can be enabled/disabled/swapped at the preferences.
  516.  
  517. # 'rateLimit' (optional):
  518. Connection rate limit in milliseconds. Default is 200.
  519. On the Search/List pages it will be increased by a factor of 4.
  520.  
  521. -= Search URL parameters: =-
  522.  
  523. # %tt%:
  524. The IMDb id with the tt prefix (e.g. tt0055630).
  525.  
  526. # %nott%:
  527. The IMDb id without the tt prefix (e.g. 0055630).
  528.  
  529. # %search_string%:
  530. The movie title (e.g. Yojimbo). Depends on your preferences at www.imdb.com/preferences/general.
  531.  
  532. # %search_string_orig%:
  533. The original movie title (e.g. Yôjinbô). Reverts to %search_string% if original title is not set at IMDb.
  534.  
  535. # %year%:
  536. The movie year (e.g. 1961).
  537.  
  538. */
  539.  
  540. var public_sites = [
  541. { 'name': '1337x',
  542. 'searchUrl': 'https://1337x.to/category-search/%search_string%+%year%/Movies/1/',
  543. 'matchRegex': /No results were returned/},
  544. { 'name': '1337x',
  545. 'searchUrl': 'https://1337x.to/category-search/%search_string%/TV/1/',
  546. 'matchRegex': /No results were returned/,
  547. 'TV': true},
  548. { 'name': '1337x-Proxy',
  549. 'searchUrl': 'https://1337x.unblocker.cc/category-search/%search_string%+%year%/Movies/1/',
  550. 'matchRegex': /No results were returned/},
  551. { 'name': '1337x-Proxy',
  552. 'searchUrl': 'https://1337x.unblocker.cc/category-search/%search_string%/TV/1/',
  553. 'matchRegex': /No results were returned/,
  554. 'TV': true},
  555. { 'name': 'CPS',
  556. 'searchUrl': 'https://mycarpathians.net/browse.php?c194=1&c60=1&c10=1&c20=1&c181=1&c183=1&c192=1&c190=1&c70=1&c30=1&c40=1&search=%search_string%',
  557. 'loggedOutRegex': /Nem vagy bejelentkezve!/,
  558. 'matchRegex': /Nincs itt semmi!/,
  559. 'both': true},
  560. { 'name': 'Deildu',
  561. 'searchUrl': 'https://deildu.net/browse.php?search=%tt%&cat=0&Lysing=1',
  562. 'loggedOutRegex': /Forgot Your Password/,
  563. 'matchRegex': /Ekkert fannst!/,
  564. 'both': true},
  565. { 'name': 'Demonoid',
  566. 'searchUrl': 'http://www.dnoid.pw/files/?query=%tt%',
  567. 'loggedOutRegex': /Cloudflare Ray ID|Checking your browser|security check to access|daily site maintenance|page is not available/,
  568. 'matchRegex': /No torrents found/,
  569. 'both': true},
  570. { 'name': 'ETTV',
  571. 'searchUrl': 'https://www.ettvdl.com/torrents-search.php?search=%search_string%+%year%',
  572. 'matchRegex': /Nothing Found/,
  573. 'both': true},
  574. { 'name': 'EUC',
  575. 'searchUrl': 'https://eliteunitedcrew.org/browse.php?search=%tt%&cat=0&incldead=1&btn=Search',
  576. 'loggedOutRegex': /Not logged in/,
  577. 'matchRegex': /nijedan torent/,
  578. 'both': true},
  579. { 'name': 'ixIRC',
  580. 'icon': 'https://ixirc.com/favicon.png',
  581. 'searchUrl': 'https://ixirc.com/?q=%search_string_orig%+%year%',
  582. 'matchRegex': /No results/},
  583. { 'name': 'ixIRC',
  584. 'icon': 'https://ixirc.com/favicon.png',
  585. 'searchUrl': 'https://ixirc.com/?q=%search_string_orig%',
  586. 'matchRegex': /No results/,
  587. 'TV': true},
  588. { 'name': 'KZ',
  589. 'searchUrl': 'http://kinozal.tv/browse.php?s=%search_string%+%year%&g=0&c=1002&v=0&d=0&w=0&t=0&f=0',
  590. 'matchRegex': 'Нет активных раздач, приносим извинения. Пожалуйста, уточните параметры поиска'},
  591. { 'name': 'KZ',
  592. 'searchUrl': 'http://kinozal.tv/browse.php?s=%search_string%+%year%&g=0&c=1001&v=0&d=0&w=0&t=0&f=0',
  593. 'matchRegex': 'Нет активных раздач, приносим извинения. Пожалуйста, уточните параметры поиска',
  594. 'TV': true},
  595. { 'name': 'LimeTor',
  596. 'loggedOutRegex': /Cloudflare Ray ID|Checking your browser|security check to access|Please turn JavaScript/,
  597. 'searchUrl': 'https://www.limetorrents.info/search/movies/%search_string%+%year%/seeds/1/',
  598. 'matchRegex': /csprite_dl14/,
  599. 'positiveMatch': true},
  600. { 'name': 'LimeTor-Proxy',
  601. 'loggedOutRegex': /Cloudflare Ray ID|Checking your browser|security check to access|Please turn JavaScript/,
  602. 'searchUrl': 'https://limetorrents.unblockit.win/search/movies/%search_string%+%year%/seeds/1/',
  603. 'matchRegex': /csprite_dl14/,
  604. 'positiveMatch': true},
  605. { 'name': 'NNM',
  606. 'searchUrl': 'https://nnm-club.me/forum/tracker.php?nm=%search_string%+%year%',
  607. 'matchRegex': 'Не найдено',
  608. 'both': true},
  609. { 'name': 'RARBG',
  610. 'searchUrl': 'https://rarbgweb.org/torrents.php?imdb=%tt%',
  611. 'loggedOutRegex': /something wrong|Please wait|enter the captcha|too many requests/,
  612. 'matchRegex': '//dyncdn.me/static/20/images/imdb_thumb.gif',
  613. 'positiveMatch': true,
  614. 'rateLimit': 250,
  615. 'both': true},
  616. { 'name': 'RareFilm',
  617. 'icon': 'http://rarefilm.net/wp-content/themes/sahifa/favicon.ico',
  618. 'searchUrl': 'http://rarefilm.net/?s=%tt%',
  619. 'matchRegex': /Nothing Found/,
  620. 'both': true},
  621. { 'name': 'Rarelust',
  622. 'icon': 'https://i.imgur.com/kaaYhsp.png',
  623. 'searchUrl': 'https://rarelust.com/?s=%tt%',
  624. 'matchRegex': 'Nothing Found'},
  625. { 'name': 'RlsBB',
  626. 'icon': 'https://i.imgur.com/Ve3T1rC.png',
  627. 'searchUrl': 'http://search.rlsbb.ru/Home/GetPost?phrase=%tt%&pindex=1&content=true&type=Simple',
  628. 'goToUrl': 'http://rlsbb.ru/?serach_mode=light&s=%tt%',
  629. 'loggedOutRegex': /Cloudflare Ray ID|Checking your browser|security check to access/,
  630. 'matchRegex': /"results":\[\]|Not Found/,
  631. 'rateLimit': 250,
  632. 'both': true},
  633. { 'name': 'RlsBB-Proxy',
  634. 'icon': 'https://i.imgur.com/Ve3T1rC.png',
  635. 'searchUrl': 'http://search.proxybb.com/Home/GetPost?phrase=%tt%&pindex=1&content=true&type=Simple',
  636. 'goToUrl': 'http://search.proxybb.com/?serach_mode=light&s=%tt%',
  637. 'loggedOutRegex': /Cloudflare Ray ID|Checking your browser|security check to access/,
  638. 'matchRegex': /"results":\[\]|Not Found/,
  639. 'rateLimit': 250,
  640. 'both': true},
  641. { 'name': 'RuT',
  642. '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%',
  643. 'loggedOutRegex': /Введите ваше имя/,
  644. 'matchRegex': 'Не найдено'},
  645. { 'name': 'RuT',
  646. '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%',
  647. 'loggedOutRegex': /Введите ваше имя/,
  648. 'matchRegex': 'Не найдено',
  649. 'TV': true},
  650. { 'name': 'Rutor',
  651. 'searchUrl': 'http://rutor.info/search/0/0/010/0/%tt%',
  652. 'loggedOutRegex': /Gateway Time-out/,
  653. 'matchRegex': 'Результатов поиска 0',
  654. 'both': true},
  655. { 'name': 'TPB',
  656. 'searchUrl': 'https://proxyproxy.fi/s/?q=%search_string%&video=on&category=0&page=0&orderby=99',
  657. 'matchRegex': /No hits. Try adding an asterisk in you search phrase./,
  658. 'both': true},
  659. { 'name': 'TGx',
  660. 'icon': 'https://torrentgalaxy.to/common/favicon/favicon-16x16.png',
  661. 'searchUrl': 'https://torrentgalaxy.org/torrents.php?search=%tt%',
  662. 'matchRegex': /No results found/},
  663. { 'name': 'WC',
  664. 'icon': 'https://i.imgur.com/ojFZp6N.png',
  665. 'searchUrl': 'https://worldscinema.org/?s=%tt%',
  666. 'matchRegex': /Nothing Found/,
  667. 'both': true},
  668. { 'name': 'XDCC',
  669. 'searchUrl': 'https://www.xdcc.eu/search.php?searchkey=%search_string_orig%+%year%',
  670. 'matchRegex': /No result found/},
  671. { 'name': 'XDCC',
  672. 'searchUrl': 'https://www.xdcc.eu/search.php?searchkey=%search_string_orig%',
  673. 'matchRegex': /No result found/,
  674. 'TV': true},
  675. { 'name': 'YGG',
  676. 'searchUrl': 'https://www2.yggtorrent.si/engine/search?name=%search_string_orig%&category=2145&sub_category=all&do=search',
  677. 'loggedOutRegex': /Cloudflare Ray ID|Checking your browser|security check to access/,
  678. 'matchRegex': 'Aucun résultat !',
  679. 'both': true},
  680. { 'name': 'Zooqle',
  681. 'icon': 'https://i.imgur.com/jqKceYP.png',
  682. 'searchUrl': 'https://zooqle.com/search?q=%tt%',
  683. 'loggedOutRegex': /Cloudflare Ray ID|Checking your browser|security check to access/,
  684. 'matchRegex': 'Sorry, no torrents match',
  685. 'both': true}
  686. ];
  687.  
  688. var private_sites = [
  689. { 'name': 'AB',
  690. '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',
  691. 'loggedOutRegex': /Forgot your username/,
  692. 'matchRegex': /Translation: No search results/,
  693. 'both': true},
  694. { 'name': 'ACM',
  695. 'icon': 'https://i.imgur.com/7jLeQqf.png',
  696. 'searchUrl': 'https://asiancinema.me/torrents/filter?imdb=%tt%',
  697. 'loggedOutRegex': /Forgot Your Password/,
  698. 'matchRegex': /<tbody>\s*<\/tbody>/,
  699. 'both': true},
  700. { 'name': 'AG',
  701. 'searchUrl': 'https://asgrd.org/browse.php?si=%tt%&incldead=1',
  702. 'loggedOutRegex': /Remember Me\?/,
  703. 'matchRegex': /Nothing here!/,
  704. 'both': true},
  705. { 'name': 'AHD',
  706. 'searchUrl': 'https://awesome-hd.me/torrents.php?id=%tt%',
  707. 'loggedOutRegex': /Keep me logged in.|Gateway Time-out/,
  708. 'matchRegex': /Your search did not match anything.|Error 404/,
  709. 'rateLimit': 250,
  710. 'both': true},
  711. { 'name': 'AHD-Req',
  712. 'icon': 'https://i.imgur.com/wEs3QZL.png',
  713. 'searchUrl': 'https://awesome-hd.me/requests.php?submit=true&search=%tt%',
  714. 'loggedOutRegex': /Keep me logged in./,
  715. 'matchRegex': /Nothing found!|Error 404/,
  716. 'rateLimit': 250,
  717. 'both': true},
  718. { 'name': 'ANT',
  719. 'icon': 'https://i.imgur.com/hKZo4s2.png',
  720. 'searchUrl': 'https://anthelion.me/torrents.php?searchstr=%search_string%&order_by=time&order_way=desc&group_results=1&action=basic&searchsubmit=1',
  721. 'loggedOutRegex': /You appear to have cookies disabled./,
  722. 'matchRegex': /Your search did not match anything/},
  723. { 'name': 'AR',
  724. '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',
  725. 'loggedOutRegex': /<title>Login :: AlphaRatio/,
  726. 'matchRegex': /Your search did not match anything/},
  727. { 'name': 'AR',
  728. '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',
  729. 'loggedOutRegex': /<title>Login :: AlphaRatio/,
  730. 'matchRegex': /Your search did not match anything/,
  731. 'TV': true},
  732. { 'name': 'AT',
  733. 'icon': 'https://i.imgur.com/ON1FGGO.png',
  734. 'searchUrl': 'https://avistaz.to/movies?search=&imdb=%tt%',
  735. 'loggedOutRegex': /Forgot Your Password/,
  736. 'matchRegex': /class="overlay-container"/,
  737. 'positiveMatch': true},
  738. { 'name': 'AT',
  739. 'icon': 'https://i.imgur.com/ON1FGGO.png',
  740. 'searchUrl': 'https://avistaz.to/tv-shows?search=&imdb=%tt%',
  741. 'loggedOutRegex': /Forgot Your Password/,
  742. 'matchRegex': /class="overlay-container"/,
  743. 'positiveMatch': true,
  744. 'TV': true},
  745. { 'name': 'bB',
  746. 'searchUrl': 'https://baconbits.org/torrents.php?action=basic&filter_cat[9]=1&searchstr=%search_string%+%year%',
  747. 'loggedOutRegex': /Lost your password/,
  748. 'matchRegex': /Your search was way too l33t/},
  749. { 'name': 'bB',
  750. 'searchUrl': 'https://baconbits.org/torrents.php?action=basic&filter_cat[8]=1&filter_cat[10]=1&searchstr=%search_string%',
  751. 'loggedOutRegex': /Lost your password/,
  752. 'matchRegex': /Your search was way too l33t/,
  753. 'TV': true},
  754. { 'name': 'BB-HD',
  755. 'searchUrl': 'https://bluebird-hd.org/browse.php?search=&incldead=0&cat=0&dsearch=%tt%&stype=or',
  756. 'loggedOutRegex': /Восстановление пароля|Bad Gateway/,
  757. 'matchRegex': /Nothing found|Ничего не найдено/,
  758. 'both': true},
  759. { 'name': 'BHD',
  760. 'searchUrl': 'https://beyond-hd.me/torrents/all?search=&doSearch=Search&imdb=%nott%',
  761. 'loggedOutRegex': /FORGET PASSWORD/,
  762. 'matchRegex': /<h5 class="text-bold text-danger">N\/A<\/h5>/,
  763. 'both': true},
  764. { 'name': 'BitHD',
  765. 'searchUrl': 'https://www.bit-hdtv.com/torrents.php?search=%tt%&options=4',
  766. 'loggedOutRegex': /Forgot your password/,
  767. 'matchRegex': /No match!/},
  768. { 'name': 'Blu',
  769. 'searchUrl': 'https://blutopia.xyz/torrents/filter?imdb=%tt%',
  770. 'loggedOutRegex': /Forgot Your Password|Service Unavailable/,
  771. 'matchRegex': /<tbody>\s*<\/tbody>/,
  772. 'both': true},
  773. { 'name': 'BRT',
  774. 'icon': 'https://i.imgur.com/KVaHMKi.png',
  775. 'searchUrl': 'https://brasiltracker.org/torrents.php?searchstr=%tt%',
  776. 'loggedOutRegex': /Recuperar senha/,
  777. 'matchRegex': /retornou nenhum resultado/,
  778. 'both': true},
  779. { 'name': 'BTN',
  780. 'searchUrl': 'https://broadcasthe.net/torrents.php?imdb=%tt%',
  781. 'loggedOutRegex': /Lost your password\?/,
  782. 'matchRegex': /Error 404/,
  783. 'TV': true},
  784. { 'name': 'BTN-Title',
  785. 'searchUrl': 'https://broadcasthe.net/torrents.php?action=basic&searchstr=%search_string_orig%',
  786. 'loggedOutRegex': /Lost your password\?/,
  787. 'matchRegex': /No search results/,
  788. 'TV': true},
  789. { 'name': 'BTN-Req',
  790. 'icon': 'https://i.imgur.com/yj9qrwa.png',
  791. 'searchUrl': 'https://broadcasthe.net/requests.php?search=%search_string%',
  792. 'loggedOutRegex': /Lost your password\?/,
  793. 'matchRegex': /Nothing found/,
  794. 'TV': true},
  795. { 'name': 'CaCh',
  796. 'searchUrl': 'http://www.cartoonchaos.org/index.php?page=torrents&search=%search_string%&category=0&options=0&active=0',
  797. 'loggedOutRegex': /not authorized to view the Torrents/,
  798. 'matchRegex': />Av.<\/td>\s*<\/tr>\s*<\/table>/,
  799. 'both': true},
  800. { 'name': 'CCT',
  801. 'searchUrl': 'https://concertos.live/torrents?imdb=%nott%',
  802. 'loggedOutRegex': /Forgot Your Password/,
  803. 'matchRegex': /ago/,
  804. 'positiveMatch': true,
  805. 'both': true},
  806. { 'name': 'CG',
  807. 'searchUrl': 'https://cinemageddon.net/browse.php?search=%tt%',
  808. 'loggedOutRegex': 'Not logged in!',
  809. 'matchRegex': /Nothing found!/},
  810. { 'name': 'CG-c',
  811. 'icon': 'https://i.imgur.com/CdCbVW4.png',
  812. 'searchUrl': 'https://cinemageddon.net/cocks/endoscope.php?what=imdb&q=%tt%',
  813. 'loggedOutRegex': 'Not logged in!',
  814. 'matchRegex': /Nothing found!/},
  815. { 'name': 'CG-Req',
  816. 'icon': 'https://i.imgur.com/305SsHL.png',
  817. 'searchUrl': 'https://cinemageddon.net/viewrequests.php?search=%tt%&incdesc=1&filter=true',
  818. 'loggedOutRegex': 'Not logged in!',
  819. 'matchRegex': /Nothing found./},
  820. { 'name': 'CHD',
  821. 'searchUrl': 'https://chdbits.co/torrents.php?incldead=0&spstate=0&inclbookmarked=0&search_area=4&search_mode=0&search=%tt%',
  822. 'loggedOutRegex': /SSL \(HTTPS\)/,
  823. 'matchRegex': /Nothing found/},
  824. { 'name': 'Classix',
  825. 'searchUrl': 'http://classix-unlimited.co.uk/torrents-search.php?search="%search_string%"&parent_cat=Movies',
  826. 'loggedOutRegex': /Sorry this is a private site/,
  827. 'matchRegex': /Database Error/},
  828. { 'name': 'Classix',
  829. 'searchUrl': 'http://classix-unlimited.co.uk/torrents-search.php?search="%search_string%"&parent_cat=TV',
  830. 'loggedOutRegex': /Sorry this is a private site/,
  831. 'matchRegex': /Database Error/,
  832. 'TV': true},
  833. { 'name': 'CZ',
  834. 'icon': 'https://i.imgur.com/HYNMAuJ.png',
  835. 'configName': 'ET',
  836. 'searchUrl': 'https://cinemaz.to/movies?search=&imdb=%tt%',
  837. 'loggedOutRegex': /Forgot Your Password/,
  838. 'matchRegex': /class="overlay-container"/,
  839. 'positiveMatch': true},
  840. { 'name': 'CZ',
  841. 'icon': 'https://i.imgur.com/HYNMAuJ.png',
  842. 'configName': 'ET',
  843. 'searchUrl': 'https://cinemaz.to/tv-shows?search=&imdb=%tt%',
  844. 'loggedOutRegex': /Forgot Your Password/,
  845. 'matchRegex': /class="overlay-container"/,
  846. 'positiveMatch': true,
  847. 'TV': true},
  848. { 'name': 'DB',
  849. 'searchUrl': 'https://danishbits.org/torrents.php?&pre_type=s_imdb&search=%tt%',
  850. 'loggedOutRegex': /Glemt din kode\?/,
  851. 'matchRegex': /Your search did not match/,
  852. 'both': true},
  853. { 'name': 'DC',
  854. 'searchUrl': 'https://digitalcore.club/api/v1/torrents?categories[]=1&categories[]=2&categories[]=3&categories[]=4&categories[]=5&categories[]=6&categories[]=7&dead=false&limit=1&page=search&searchText=%search_string%+%year%',
  855. 'goToUrl': 'https://digitalcore.club/search?search=%search_string%+%year%&cats=1,2,5,6,3,4,7&fc=true',
  856. 'loggedOutRegex': /It doesnt work here/,
  857. 'matchRegex': /imdbid/,
  858. 'rateLimit': 250,
  859. 'positiveMatch': true},
  860. { 'name': 'DC',
  861. 'searchUrl': 'https://digitalcore.club/api/v1/torrents?categories[]=8&categories[]=9&categories[]=10&categories[]=11&categories[]=12&categories[]=13&categories[]=14&dead=false&limit=1&page=search&searchText=%search_string%',
  862. 'goToUrl': 'https://digitalcore.club/search?search=%search_string%&cats=8,9,10,11,13,12,14&fc=true',
  863. 'loggedOutRegex': /It doesnt work here/,
  864. 'matchRegex': /imdbid/,
  865. 'rateLimit': 250,
  866. 'positiveMatch': true,
  867. 'TV': true},
  868. { 'name': 'DVDSeed',
  869. 'searchUrl': 'http://www.dvdseed.eu/browse2.php?search=%tt%&wheresearch=2&incldead=1&polish=0&nuke=0&rodzaj=0',
  870. 'loggedOutRegex': /Nie masz konta|Nie zalogowany!/,
  871. 'matchRegex': /Nic tutaj nie ma!/},
  872. { 'name': 'eThor',
  873. '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%',
  874. 'loggedOutRegex': /Vous avez perdu votre mot de passe/,
  875. 'matchRegex': /Try again with a refined search string./},
  876. { 'name': 'FF',
  877. 'searchUrl': 'https://www.funfile.org/browse.php?search=%search_string%',
  878. 'loggedOutRegex': /You need cookies enabled to log in/,
  879. 'matchRegex': /Try again with a refined search/,
  880. 'both': true},
  881. { 'name': 'FL',
  882. 'searchUrl': 'https://filelist.io/browse.php?search=%nott%&cat=0&searchin=3&sort=2',
  883. 'loggedOutRegex': /Login on any IP/,
  884. 'matchRegex': /Nu s-a găsit nimic!/,
  885. 'both': true},
  886. { 'name': 'FinVip',
  887. 'searchUrl': 'https://finvip.org/index.php?page=torrents&search=%tt%&options=1',
  888. 'loggedOutRegex': /Sinulla ei ole oikeuksia sivulle/,
  889. 'matchRegex': /<td colspan="2" align="center"> <\/td>/},
  890. { 'name': 'GT',
  891. 'searchUrl': 'https://greek-team.cc/browse.php?incldead=0&search=%search_string_orig%&blah=0',
  892. 'loggedOutRegex': /Retrieve Password/,
  893. 'matchRegex': /No data found/,
  894. 'both': true},
  895. { 'name': 'HDb',
  896. 'searchUrl': 'https://hdbits.org/browse.php?c1=1&c2=1&c3=1&c4=1&c5=1&c7=1&c8=1&imdb=%tt%',
  897. 'loggedOutRegex': /Make sure your passcode generating/,
  898. 'matchRegex': /Nothing here!/,
  899. 'both': true},
  900. { 'name': 'HDC',
  901. 'icon': 'https://i.imgur.com/KkZE390.png',
  902. 'searchUrl': 'https://hdchina.org/torrents.php?incldead=0&spstate=0&inclbookmarked=0&boardid=0&seeders=&search=%tt%&search_area=4&search_mode=2',
  903. 'loggedOutRegex': /SSL \(HTTPS\)/,
  904. 'matchRegex': /Nothing found! Try again with a refined search string./},
  905. { 'name': 'HDH',
  906. 'configName': 'HDHome',
  907. 'icon': 'https://i.imgur.com/XUd8EfR.png',
  908. 'searchUrl': 'https://hdhome.org/torrents.php?search_area=4&search=%tt%',
  909. 'loggedOutRegex': /SSL \(HTTPS\)/,
  910. 'matchRegex': /Nothing found! Try again with a refined search string/},
  911. { 'name': 'HDME',
  912. 'searchUrl': 'https://hdme.eu/browse.php?blah=2&cat=0&incldead=1&search=%tt%',
  913. 'loggedOutRegex': /You need cookies enabled/,
  914. 'matchRegex': /Try again with a refined search string./},
  915. { 'name': 'HDME',
  916. 'searchUrl': 'https://hdme.eu/browse.php?search=%search_string%&blah=0&cat=0&incldead=1',
  917. 'loggedOutRegex': /You need cookies enabled/,
  918. 'matchRegex': /Try again with a refined search string./,
  919. 'TV': true},
  920. { 'name': 'HDS',
  921. 'searchUrl': 'https://hdsky.me/torrents.php?incldead=1&search=%tt%&search_area=4&search_mode=0',
  922. 'loggedOutRegex': /SSL \(HTTPS\)/,
  923. 'matchRegex': /Nothing found!/},
  924. { 'name': 'HDS',
  925. 'searchUrl': 'https://hdsky.me/torrents.php?cat402=1&cat403=1&incldead=1&search=%search_string%&search_area=0&search_mode=0',
  926. 'loggedOutRegex': /SSL \(HTTPS\)/,
  927. 'matchRegex': /Nothing found!/,
  928. 'TV': true},
  929. { 'name': 'HDSpace',
  930. 'icon': 'https://i.imgur.com/hQNih7O.png',
  931. 'searchUrl': 'https://hd-space.org/index.php?page=torrents&active=0&options=2&search=%nott%',
  932. 'loggedOutRegex': /not authorized to view the Torrents!/,
  933. 'matchRegex': /<td colspan="2" align="center"> <\/td>/,
  934. 'both': true},
  935. { 'name': 'HDSpain',
  936. 'searchUrl': 'https://www.hd-spain.com/browse.php?%search_string_orig%',
  937. 'loggedOutRegex': /Error 404 No encontrado/,
  938. 'matchRegex': /xxx Change Me xxx/,
  939. 'both': true},
  940. { 'name': 'HDT',
  941. 'icon': 'https://hdts.ru/favicon.ico',
  942. 'searchUrl': 'http://hd-torrents.org/torrents.php?active=0&options=2&search=%tt%',
  943. 'loggedOutRegex': /not authorized to view this Torrents/,
  944. 'matchRegex': /No torrents here.../,
  945. 'both': true},
  946. { 'name': 'HDU',
  947. 'searchUrl': 'https://pt.upxin.net/torrents.php?search_area=4&search=%tt%',
  948. 'loggedOutRegex': /SSL \(HTTPS\)/,
  949. 'matchRegex': /Nothing found!/},
  950. { 'name': 'IPT',
  951. 'searchUrl': 'https://ip.findnemo.net/t?q=%tt%',
  952. 'loggedOutRegex': /Error 522|Checking your browser|security check to access|Forgot your password/,
  953. 'matchRegex': /No Torrents Found!/},
  954. { 'name': 'IPT',
  955. 'searchUrl': 'https://ip.findnemo.net/t?72=&73=&q=%search_string%&qf=ti',
  956. 'loggedOutRegex': /Error 522|Checking your browser|security check to access|Forgot your password/,
  957. 'matchRegex': /No Torrents Found!/,
  958. 'TV': true},
  959. { 'name': 'JoyHD',
  960. 'icon': 'https://i.imgur.com/z5kbxta.png',
  961. 'searchUrl': 'https://www.joyhd.net/torrents.php?search_area=4&search=%tt%',
  962. 'loggedOutRegex': /Resend Email Verification/,
  963. 'matchRegex': /Nothing found! Try again with a refined search string/},
  964. { 'name': 'JPTV',
  965. 'searchUrl': 'https://jptv.club/torrents/filter?imdb=%tt%',
  966. 'loggedOutRegex': /Forgot Your Password/,
  967. 'matchRegex': /<tbody>\s*<\/tbody>/,
  968. 'both': true},
  969. { 'name': 'KG',
  970. 'icon': 'https://i.imgur.com/0JFxPY5.png',
  971. 'searchUrl': 'https://www.karagarga.in/browse.php?search_type=imdb&search=%nott%',
  972. 'loggedOutRegex': /Not logged in!/,
  973. 'matchRegex': /No torrents found/,
  974. 'both': true},
  975. { 'name': 'KG-Req',
  976. 'icon': 'https://i.imgur.com/ZQgliKg.png',
  977. 'searchUrl': 'https://karagarga.in/viewrequests.php?search=%nott%&filter=true',
  978. 'loggedOutRegex': /Not logged in!/,
  979. 'matchRegex': /1&nbsp;-/,
  980. 'positiveMatch': true,
  981. 'both': true},
  982. { 'name': 'LM',
  983. 'searchUrl': 'https://www.linkomanija.net/browse.php?incldead=1&search=%tt%&searchindesc=1',
  984. 'loggedOutRegex': /Prisiminti mane/,
  985. 'matchRegex': /Nieko nerasta./},
  986. { 'name': 'LM',
  987. 'searchUrl': 'https://www.linkomanija.net/browse.php?c30=1&c60=1&c28=1&c62=1&c65=1&c58=1&incldead=0&search="%search_string%"',
  988. 'loggedOutRegex': /Prisiminti mane/,
  989. 'matchRegex': /Nieko nerasta./,
  990. 'TV': true},
  991. { 'name': 'LM-5z',
  992. 'searchUrl': 'https://www.linkomanija.net/torrents.php?cat=0&search="%search_string%"',
  993. 'loggedOutRegex': /Prisiminti mane/,
  994. 'matchRegex': /Torrentų nėra./,
  995. 'both': true},
  996. { 'name': 'M-T',
  997. 'searchUrl': 'https://pt.m-team.cc/torrents.php?incldead=1&spstate=0&inclbookmarked=0&search=%tt%&search_area=4&search_mode=0',
  998. 'loggedOutRegex': /type="password" name="password"|An error occurred|Please input the 6-digit code/,
  999. 'matchRegex': /Nothing here!|Try again with a refined search string./,
  1000. 'both': true},
  1001. { 'name': 'MS',
  1002. 'searchUrl': 'http://www.myspleen.org/browse.php?search=%search_string%&title=0&cat=0',
  1003. 'loggedOutRegex': /<title>MySpleen :: Login<\/title>/,
  1004. 'matchRegex': /<strong>Nothing found!<\/strong>/,
  1005. 'both': true},
  1006. { 'name': 'MTV',
  1007. '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',
  1008. 'loggedOutRegex': /<title>Login :: morethan.tv/,
  1009. 'matchRegex': /<h2>Your search did not match anything.<\/h2>/},
  1010. { 'name': 'MTV',
  1011. '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',
  1012. 'loggedOutRegex': /<title>Login :: morethan.tv/,
  1013. 'matchRegex': /<h2>Your search did not match anything.<\/h2>/,
  1014. 'TV': true},
  1015. { 'name': 'NB',
  1016. 'icon': 'https://i.imgur.com/OH7fBY4.png',
  1017. 'searchUrl': 'https://norbits.net/browse.php?incldead=1&fullsearch=0&scenerelease=0&imdbsearch=%tt%&imdb_from=0&imdb_to=0&search=',
  1018. 'loggedOutRegex': /Ikke innlogget!/,
  1019. 'matchRegex': /<h3>Ingenting her!<\/h3>/,
  1020. 'both': true},
  1021. { 'name': 'NBL',
  1022. 'searchUrl': 'https://nebulance.io/torrents.php?order_by=time&order_way=desc&searchtext=%search_string%&search_type=0&taglist=&tags_type=0',
  1023. 'loggedOutRegex': /have cookies disabled./,
  1024. 'matchRegex': /Your search did not match anything/,
  1025. 'TV': true},
  1026. { 'name': 'OurBits',
  1027. 'searchUrl': 'https://ourbits.club/torrents.php?search_area=4&search=%tt%',
  1028. 'loggedOutRegex': /SSL \(HTTPS\)/,
  1029. 'matchRegex': /Nothing found! Try again with a refined search string/},
  1030. { 'name': 'PHD',
  1031. 'icon': 'https://i.imgur.com/MJJGioU.png',
  1032. 'searchUrl': 'https://privatehd.to/movies?search=&imdb=%tt%',
  1033. 'loggedOutRegex': /Forgot Your Password/,
  1034. 'matchRegex': /class="overlay-container"/,
  1035. 'positiveMatch': true},
  1036. { 'name': 'PHD',
  1037. 'icon': 'https://i.imgur.com/MJJGioU.png',
  1038. 'searchUrl': 'https://privatehd.to/tv-shows?search=&imdb=%tt%',
  1039. 'loggedOutRegex': /Forgot Your Password/,
  1040. 'matchRegex': /class="overlay-container"/,
  1041. 'positiveMatch': true,
  1042. 'TV': true},
  1043. { 'name': 'PTE',
  1044. 'icon': 'https://cdn.pte.nu/img/favicon.ico',
  1045. 'searchUrl': 'https://pte.nu/apitorrents?tpage=1&cat[]=6&cat[]=7&cat[]=9&search=%search_string%',
  1046. 'goToUrl': 'https://pte.nu/torrents?cat=["6","7","9"]&search=%search_string%',
  1047. 'loggedOutRegex': /submit">Sign in/,
  1048. 'matchRegex': /"count":0/,
  1049. 'rateLimit': 250,
  1050. 'spaceEncode': ' '},
  1051. { 'name': 'PTE',
  1052. 'icon': 'https://cdn.pte.nu/img/favicon.ico',
  1053. 'searchUrl': 'https://pte.nu/apitorrents?tpage=1&cat[]=11&cat[]=12&search=%search_string%',
  1054. 'goToUrl': 'https://pte.nu/torrents?cat=["11","12"]&search=%search_string%',
  1055. 'loggedOutRegex': /submit">Sign in/,
  1056. 'matchRegex': /"count":0/,
  1057. 'rateLimit': 250,
  1058. 'spaceEncode': ' ',
  1059. 'TV': true},
  1060. { 'name': 'PTer',
  1061. 'searchUrl': 'https://pterclub.com/torrents.php?search=%tt%&search_area=4',
  1062. 'loggedOutRegex': /SSL \(HTTPS\)|Err code|Cloudflare Ray ID/,
  1063. 'matchRegex': /Nothing found!/},
  1064. { 'name': 'PTF',
  1065. 'searchUrl': 'https://ptfiles.net/browse.php?search=%search_string%&incldead=0&title=0',
  1066. 'loggedOutRegex': /Forgot your password/,
  1067. 'matchRegex': /Nothing found!/},
  1068. { 'name': 'PTN',
  1069. 'icon': 'https://piratethenet.org/pic/favicon.ico',
  1070. 'searchUrl': 'https://piratethenet.org/browseold.php?incldead=1&_by=3&search=%tt%',
  1071. 'loggedOutRegex': /You need to have cookies enabled/,
  1072. 'matchRegex': /Nothing found!/,
  1073. 'both': true},
  1074. { 'name': 'PTP',
  1075. 'icon': 'https://passthepopcorn.me/static/common/touch-icon-iphone.png',
  1076. 'searchUrl': 'https://passthepopcorn.me/torrents.php?imdb=%tt%',
  1077. 'loggedOutRegex': /Keep me logged in|Your popcorn quota/,
  1078. 'matchRegex': /Your search did not match anything/,
  1079. 'rateLimit': 250},
  1080. { 'name': 'PTP-Req',
  1081. 'icon': 'https://i.imgur.com/EFCRrc9.png',
  1082. 'searchUrl': 'https://passthepopcorn.me/requests.php?submit=true&search=%tt%',
  1083. 'loggedOutRegex': /Keep me logged in|Your popcorn quota/,
  1084. 'matchRegex': /Your search did not match anything/,
  1085. 'rateLimit': 250},
  1086. { 'name': 'PxHD',
  1087. 'icon': 'https://i.imgur.com/OA7JJ6x.png',
  1088. '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',
  1089. 'loggedOutRegex': /You appear to have javascript disabled/,
  1090. 'matchRegex': /Your search did not match anything/},
  1091. { 'name': 'RevTT',
  1092. 'searchUrl': 'https://www.revolutiontt.me/browse.php?search=%tt%',
  1093. 'loggedOutRegex': /used when you're logged in./,
  1094. 'matchRegex': /Nothing found!/},
  1095. { 'name': 'RevTT',
  1096. 'searchUrl': 'https://www.revolutiontt.me/browse.php?search=%search_string%&cat=0&incldead=1&titleonly=1',
  1097. 'loggedOutRegex': /used when you're logged in./,
  1098. 'matchRegex': /Nothing found!/,
  1099. 'TV': true},
  1100. { 'name': 'Retroflix',
  1101. 'searchUrl': 'https://retroflix.club/torrents1.php?incldead=0&spstate=0&inclbookmarked=0&search=%tt%&search_area=4&search_mode=0',
  1102. 'loggedOutRegex': /Restrict session to my IP/,
  1103. 'matchRegex': /Nothing found!/,
  1104. 'both': true},
  1105. { 'name': 'SC',
  1106. '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',
  1107. 'loggedOutRegex': /<title>Login :: Secret Cinema/,
  1108. 'matchRegex': /Your search did not match anything/,
  1109. 'both': true},
  1110. { 'name': 'SC-Req',
  1111. 'icon': 'https://i.imgur.com/QHOSsFZ.png',
  1112. 'searchUrl': 'https://secret-cinema.pw/requests.php?submit=true&search=%tt%',
  1113. 'loggedOutRegex': /<title>Login :: Secret Cinema/,
  1114. 'matchRegex': /Nothing found!/,
  1115. 'both': true},
  1116. { 'name': 'SDBits',
  1117. 'searchUrl': 'https://sdbits.org/browse.php?incldead=1&imdb=%tt%',
  1118. 'loggedOutRegex': /Not logged in!/,
  1119. 'matchRegex': /Nothing here!|Nothing found!/},
  1120. { 'name': 'sHD',
  1121. 'searchUrl': 'https://scenehd.org/browse.php?search=%tt%',
  1122. 'loggedOutRegex': /If you have forgotten your password/,
  1123. 'matchRegex': /No torrents found!/},
  1124. { 'name': 'Snahp',
  1125. 'searchUrl': 'https://forum.snahp.it/search.php?keywords=%search_string%&amp;sf=titleonly',
  1126. 'loggedOutRegex': /register" role/,
  1127. 'matchRegex': '/Search found 0 matches/',
  1128. 'both': true},
  1129. { 'name': 'SP',
  1130. 'searchUrl': 'http://www.scenepalace.info/browse.php?search=%nott%&cat=0&incldead=1',
  1131. 'loggedOutRegex': /Not logged in!/,
  1132. 'matchRegex': /Nothing found!/,
  1133. 'both': true},
  1134. { 'name': 'TBD',
  1135. 'icon': 'https://1.bp.blogspot.com/-F2JeKtPCJYI/VgjpVxwMO4I/AAAAAAAAADg/VyNyp-yW9Ac/s1600/TBD.ico',
  1136. 'searchUrl': 'https://www.torrentbd.me/torrent/movies.php?module=torrents&id=%nott%',
  1137. 'loggedOutRegex': /<title>TorrentBD : Login</,
  1138. 'matchRegex': /This title is not available!/,
  1139. 'both': true},
  1140. { 'name': 'TD',
  1141. 'searchUrl': 'https://tday.findnemo.net/t?q=%tt%',
  1142. 'loggedOutRegex': /Error 522|Checking your browser|security check to access|Forgot Password\?/,
  1143. 'matchRegex': /No Torrents Found!/,
  1144. 'both': true},
  1145. { 'name': 'TE',
  1146. 'searchUrl': 'https://theempire.click/browse.php?incldead=0&country=&nonboolean=1&search=%tt%',
  1147. 'loggedOutRegex': /404 - Not Found|You need cookies enabled/,
  1148. 'matchRegex': /Try again with a refined search string/,
  1149. 'TV': true},
  1150. { 'name': 'TG',
  1151. 'searchUrl': 'https://thegeeks.click/browse.php?incldead=0&country=&nonboolean=1&search=%tt%',
  1152. 'loggedOutRegex': /404 - Not Found|You need cookies enabled/,
  1153. 'matchRegex': /Try again with a refined search string/,
  1154. 'both': true},
  1155. { 'name': 'THC',
  1156. 'searchUrl': 'https://horrorcharnel.org/browse.php?search=%nott%&cat=0&incldead=1',
  1157. 'loggedOutRegex': /Not logged in!/,
  1158. 'matchRegex': /<h2>Nothing found!<\/h2>/},
  1159. { 'name': 'THR',
  1160. 'searchUrl': 'https://www.torrenthr.org/browse.php?search=%search_string%&blah=0&incldead=1',
  1161. 'loggedOutRegex': /registraciju morate imati omogućene cookiese/,
  1162. 'matchRegex': /Ništa nije pronađeno!/,
  1163. 'both': true},
  1164. { 'name': 'Tik',
  1165. 'searchUrl': 'https://www.cinematik.net/browse.php?cat=0&incldead=1&srchdtls=1&search=%tt%',
  1166. 'loggedOutRegex': /Not logged in!/,
  1167. 'matchRegex': /Nothing found!/,
  1168. 'both': true},
  1169. { 'name': 'Tik-Req',
  1170. 'icon': 'https://i.imgur.com/bM8D1m2.png',
  1171. 'searchUrl': 'https://www.cinematik.net/viewrequests.php?search=%search_string%&filter=1',
  1172. 'loggedOutRegex': /Not logged in!/,
  1173. 'matchRegex': /No requests found!/,
  1174. 'both': true},
  1175. { 'name': 'TL',
  1176. 'searchUrl': 'https://www.torrentleech.org/torrents/browse/list/categories/8,9,11,12,13,14,15,29/query/%search_string% %year%',
  1177. 'goToUrl': 'http://www.torrentleech.org/torrents/browse/index/query/%search_string% %year%/categories/1,8,9,10,11,12,13,14,15,29',
  1178. 'loggedOutRegex': /Signup With Invite/,
  1179. 'matchRegex': /"numFound":0/,
  1180. 'rateLimit': 250,
  1181. 'spaceEncode': ' '},
  1182. { 'name': 'TL',
  1183. 'searchUrl': 'https://www.torrentleech.org/torrents/browse/list/categories/26,27,32/query/%search_string%',
  1184. 'goToUrl': 'http://www.torrentleech.org/torrents/browse/index/query/%search_string%/categories/2,26,27,32',
  1185. 'loggedOutRegex': /Signup With Invite/,
  1186. 'matchRegex': /"numFound":0/,
  1187. 'rateLimit': 250,
  1188. 'spaceEncode': ' ',
  1189. 'TV': true},
  1190. { 'name': 'TO',
  1191. 'searchUrl': 'https://theoccult.click/browse.php?incldead=0&country=&nonboolean=1&search=%tt%',
  1192. 'loggedOutRegex': /404 - Not Found|You need cookies enabled/,
  1193. 'matchRegex': /Try again with a refined search string/,
  1194. 'both': true},
  1195. { 'name': 'TP',
  1196. 'searchUrl': 'https://theplace.click/browse.php?incldead=0&country=&nonboolean=1&search=%tt%',
  1197. 'loggedOutRegex': /not found on this server|You need cookies enabled/,
  1198. 'matchRegex': /Try again with a refined search string/,
  1199. 'both': true},
  1200. { 'name': 'TRL',
  1201. 'searchUrl': 'https://torrent.ai/lt/torrents?in=2&search=%tt%',
  1202. 'loggedOutRegex': /Jums nepavyksta pasijungti/,
  1203. 'matchRegex': /nieko nerasta!/,
  1204. 'both': true},
  1205. { 'name': 'TRL',
  1206. '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',
  1207. 'loggedOutRegex': /Jums nepavyksta pasijungti/,
  1208. 'matchRegex': /nieko nerasta!/,
  1209. 'TV': true},
  1210. { 'name': 'TS',
  1211. 'searchUrl': 'https://theshow.click/browse.php?incldead=0&country=&nonboolean=1&search=%tt%',
  1212. 'loggedOutRegex': /404 - Not Found|You need cookies enabled/,
  1213. 'matchRegex': /Try again with a refined search string/,
  1214. 'both': true},
  1215. { 'name': 'TSeeds',
  1216. 'searchUrl': 'https://torrentseeds.org/browse.php?c50=1&c31=1&c3=1&c39=1&c62=1&c19=1&c49=1&c25=1&search=+%search_string_orig% +%year%&searchin=title&incldead=0',
  1217. 'loggedOutRegex': /Not logged in!/,
  1218. 'matchRegex': /Nothing found!/},
  1219. { 'name': 'TSeeds',
  1220. 'searchUrl': 'https://torrentseeds.org/browse.php?c67=1&c65=1&c61=1&c11=1&c23=1&c24=1&c18=1&c26=1&c64=1&search=+%search_string_orig%&searchin=title&incldead=0',
  1221. 'loggedOutRegex': /Not logged in!/,
  1222. 'matchRegex': /Nothing found!/,
  1223. 'TV': true},
  1224. { 'name': 'TTG',
  1225. 'searchUrl': 'https://totheglory.im/browse.php?c=M&search_field=imdb%nott%',
  1226. 'loggedOutRegex': /Forget your password/,
  1227. 'matchRegex': /Didn't match any titles/},
  1228. { 'name': 'TVCK',
  1229. 'searchUrl': 'https://www.tvchaosuk.com/browse.php?do=search&search_type=t_name&keywords=%search_string%',
  1230. 'loggedOutRegex': /404 Not Found/,
  1231. 'matchRegex': /<b>Nothing Found<\/b>/},
  1232. { 'name': 'TVV',
  1233. 'searchUrl': 'https://tv-vault.me/torrents.php?action=advanced&imdbid=%tt%&order_by=s3&order_way=desc',
  1234. 'loggedOutRegex': /Lost your password\?|Browse quota exceeded|Cloudflare Ray ID/,
  1235. 'matchRegex': /Nothing found<\/h2>/,
  1236. 'rateLimit': 250,
  1237. 'TV': true},
  1238. { 'name': 'TVV-Req',
  1239. 'icon': 'https://i.imgur.com/dNtCggC.png',
  1240. 'searchUrl': 'https://tv-vault.me/requests.php?search=&imdbid=%tt%',
  1241. 'loggedOutRegex': /Lost your password\?|Browse quota exceeded|Cloudflare Ray ID/,
  1242. 'matchRegex': /Nothing found|Yes/,
  1243. 'rateLimit': 250,
  1244. 'TV': true},
  1245. { 'name': 'U2',
  1246. 'searchUrl': 'https://u2.dmhy.org/torrents.php?incldead=0&spstate=0&inclbookmarked=0&search=%tt%&search_area=1&search_mode=0',
  1247. 'loggedOutRegex': /<title>Access Point :: U2<|Cloudflare Ray ID/,
  1248. 'matchRegex': /Nothing found/},
  1249. { 'name': 'UHDB',
  1250. 'searchUrl': 'https://uhdbits.org/torrents.php?action=advanced&groupname=%tt%',
  1251. 'loggedOutRegex': /Lost your password/,
  1252. 'matchRegex': /Your search did not match anything./},
  1253. { 'name': 'XS',
  1254. 'searchUrl': 'https://www.xspeeds.eu/browse.php?do=search&keywords=%search_string%&search_type=t_name&category=0&include_dead_torrents=yes',
  1255. 'loggedOutRegex': /Forget your password/,
  1256. 'matchRegex': /<b>Nothing Found<\/b>/}
  1257. ];
  1258.  
  1259. var subs_sites = [
  1260. { 'name': 'Addic7ed',
  1261. 'searchUrl': 'https://www.addic7ed.com/search.php?search=%search_string%&Submit=Search',
  1262. 'matchRegex': /returned zero results/,
  1263. 'inSecondSearchBar': true,
  1264. 'both': true},
  1265. { 'name': 'AniSubs (EN)',
  1266. 'searchUrl': 'https://anisubsblog.blogspot.com/search?q=%search_string_orig%',
  1267. 'matchRegex': /No posts matching/,
  1268. 'inSecondSearchBar': true,
  1269. 'both': true},
  1270. { 'name': 'ArgenTeam (ES)',
  1271. 'icon': 'http://www.argenteam.net/static/images/favicon.ico',
  1272. 'searchUrl': 'http://www.argenteam.net/search?filter=%search_string_orig%+%year%&movieFilter=on',
  1273. 'matchRegex': /No se encontraron coincidencias/,
  1274. 'inSecondSearchBar': true},
  1275. { 'name': 'ArgenTeam (ES)',
  1276. 'icon': 'http://www.argenteam.net/static/images/favicon.ico',
  1277. 'searchUrl': 'http://www.argenteam.net/search?filter=%search_string_orig%+%year%&serieFilter=on',
  1278. 'matchRegex': /No se encontraron coincidencias/,
  1279. 'inSecondSearchBar': true,
  1280. 'TV': true},
  1281. { 'name': 'Moviesubtitles',
  1282. 'searchUrl': 'http://www.moviesubtitles.org/search.php?q=%search_string_orig%',
  1283. 'matchRegex': /No results found/,
  1284. 'inSecondSearchBar': true},
  1285. { 'name': 'Napisy24 (PL)',
  1286. 'searchUrl': 'https://napisy24.pl/szukaj?page=1&lang=1&search=%search_string_orig%&typ=1#',
  1287. 'matchRegex': /Znalezione Napisy \(0\)/,
  1288. 'inSecondSearchBar': true},
  1289. { 'name': 'Napisy24 (PL)',
  1290. 'searchUrl': 'https://napisy24.pl/szukaj?page=1&lang=1&search=%search_string_orig%&typ=2#',
  1291. 'matchRegex': /Znalezione Napisy \(0\)/,
  1292. 'inSecondSearchBar': true,
  1293. 'TV': true},
  1294. { 'name': 'OpenSubsOnline',
  1295. 'icon': 'https://opensubtitles.online/images/favicon.ico',
  1296. 'searchUrl': 'https://opensubtitles.online/subtitles/search/?SubtitleSearch[stext]=%search_string_orig%&SubtitleSearch[lang_id]=0&SubtitleSearch[myear]=%year%',
  1297. 'matchRegex': /No results found/,
  1298. 'inSecondSearchBar': true,
  1299. 'both': true},
  1300. { 'name': 'OpenSubsOnline (EN)',
  1301. 'icon': 'https://opensubtitles.online/images/favicon.ico',
  1302. 'searchUrl': 'https://opensubtitles.online/subtitles/search/?SubtitleSearch[stext]=%search_string_orig%&SubtitleSearch[lang_id]=124&SubtitleSearch[myear]=%year%',
  1303. 'matchRegex': /No results found/,
  1304. 'inSecondSearchBar': true,
  1305. 'both': true},
  1306. { 'name': 'OpenSubtitles',
  1307. 'searchUrl': 'https://www.opensubtitles.org/en/search/imdbid-%tt%',
  1308. 'matchRegex': /div itemscope/,
  1309. 'positiveMatch': true,
  1310. 'inSecondSearchBar': true,
  1311. 'both': true},
  1312. { 'name': 'OpenSubtitles (EN)',
  1313. 'searchUrl': 'https://www.opensubtitles.org/en/search/sublanguageid-eng/imdbid-%tt%',
  1314. 'matchRegex': /div itemscope/,
  1315. 'positiveMatch': true,
  1316. 'inSecondSearchBar': true,
  1317. 'both': true},
  1318. { 'name': 'PlanetDP (TR)',
  1319. 'searchUrl': 'https://planetdp.org/movie/search/?title=%tt%',
  1320. 'matchRegex': /<span>Altyazılar/,
  1321. 'positiveMatch': true,
  1322. 'inSecondSearchBar': true,
  1323. 'both': true},
  1324. { 'name': 'Podnapisi',
  1325. 'searchUrl': 'https://www.podnapisi.net/en/subtitles/search/advanced?keywords=%search_string_orig%&year=%year%',
  1326. 'matchRegex': /table-responsive/,
  1327. 'positiveMatch': true,
  1328. 'inSecondSearchBar': true,
  1329. 'both': true},
  1330. { 'name': 'Podnapisi (EN)',
  1331. 'searchUrl': 'https://www.podnapisi.net/en/subtitles/search/advanced?keywords=%search_string_orig%&year=%year%&language=en',
  1332. 'matchRegex': /table-responsive/,
  1333. 'positiveMatch': true,
  1334. 'inSecondSearchBar': true,
  1335. 'both': true},
  1336. { 'name': 'RegieLive (RO)',
  1337. 'searchUrl': 'https://subtitrari.regielive.ro/cauta.html?s=%search_string_orig%',
  1338. 'matchRegex': /Nu au fost gasite subtitrari/,
  1339. 'inSecondSearchBar': true,
  1340. 'both': true},
  1341. { 'name': 'Subs4free (GR|EN)',
  1342. 'icon': 'https://www.subs4free.info/images/icons/favicon-32x32.png',
  1343. 'searchUrl': 'https://www.subs4free.info/search_report.php?search=%search_string%&searchType=1',
  1344. 'matchRegex': /any subtitles using your criteria|There is no subtitle/,
  1345. 'inSecondSearchBar': true},
  1346. { 'name': 'Subs4free (GR|EN)',
  1347. 'icon': 'https://www.subs4free.info/images/icons/favicon-32x32.png',
  1348. 'searchUrl': 'https://www.subs4free.info/search_report.php?search=%search_string%&searchType=2',
  1349. 'matchRegex': /any subtitles using your criteria|There is no subtitle/,
  1350. 'inSecondSearchBar': true,
  1351. 'TV': true},
  1352. { 'name': 'SubDivX (ES)',
  1353. 'searchUrl': 'http://www.subdivx.com/index.php?q=%search_string_orig%+%year%&accion=5&subtitulos=1',
  1354. 'matchRegex': /No encontramos resultados/,
  1355. 'inSecondSearchBar': true},
  1356. { 'name': 'SubDivX (ES)',
  1357. 'searchUrl': 'http://www.subdivx.com/index.php?q=%search_string%&accion=5&subtitulos=1',
  1358. 'matchRegex': /No encontramos resultados/,
  1359. 'inSecondSearchBar': true,
  1360. 'TV': true},
  1361. { 'name': 'Subs.com.ru (RU)',
  1362. 'searchUrl': 'http://subs.com.ru/index.php?e=search&sq=%search_string_orig%',
  1363. 'matchRegex': /Ничего не найдено/,
  1364. 'inSecondSearchBar': true,
  1365. 'both': true},
  1366. { 'name': 'Subs.ro',
  1367. 'icon': 'https://cdn.subs.ro/fav.ico',
  1368. 'searchUrl': 'https://subs.ro/subtitrari/imdbid/%nott%',
  1369. 'matchRegex': /Pagina solicitată/,
  1370. 'inSecondSearchBar': true,
  1371. 'both': true},
  1372. { 'name': 'Subscene',
  1373. 'searchUrl': 'https://subscene.com/subtitles/searchbytitle?query=%search_string%',
  1374. 'loggedOutRegex': /Please do not hammer/,
  1375. 'matchRegex': />Exact</,
  1376. 'positiveMatch': true,
  1377. 'rateLimit': 4500,
  1378. 'inSecondSearchBar': true},
  1379. { 'name': 'Subscene',
  1380. 'searchUrl': 'https://subscene.com/subtitles/searchbytitle?query=%search_string%',
  1381. 'loggedOutRegex': /Please do not hammer/,
  1382. 'matchRegex': />TV-Series</,
  1383. 'positiveMatch': true,
  1384. 'rateLimit': 4500,
  1385. 'inSecondSearchBar': true,
  1386. 'TV': true},
  1387. { 'name': 'SubsLand (BG)',
  1388. 'searchUrl': 'https://subsland.com/index.php?s=%search_string_orig%&w=name&category=1',
  1389. 'matchRegex': /Няма намерени субтитри|Не са открити/,
  1390. 'inSecondSearchBar': true,
  1391. 'both': true},
  1392. { 'name': 'SubsUnacs (BG)',
  1393. 'icon': 'https://i.imgur.com/vXegljj.png',
  1394. 'searchUrl': 'https://subsunacs.net/search.php?m=%search_string_orig%&y=%year%&t=Submit',
  1395. 'matchRegex': /transpDiv/,
  1396. 'positiveMatch': true,
  1397. 'inSecondSearchBar': true,
  1398. 'both': true},
  1399. { 'name': 'Subtitles.hr',
  1400. 'icon': 'https://i.imgur.com/QMpMiu0.png',
  1401. 'searchUrl': 'https://www.subtitles.hr/subtitles-search/?movie=%search_string_orig%',
  1402. 'matchRegex': /matched subtitles found/,
  1403. 'positiveMatch': true,
  1404. 'inSecondSearchBar': true,
  1405. 'both': true},
  1406. { 'name': 'Subtitry (RU)',
  1407. 'searchUrl': 'https://subtitry.ru/subtitles/?film=%search_string_orig%',
  1408. 'matchRegex': />0</,
  1409. 'inSecondSearchBar': true,
  1410. 'both': true},
  1411. { 'name': 'Titlovi (BiH|HR|MK|SLO|SRB)',
  1412. 'searchUrl': 'https://titlovi.com/titlovi/?prijevod=%tt%',
  1413. 'loggedOutRegex': /Cloudflare Ray ID|Checking your browser|security check to access|Još samo jedan/,
  1414. 'matchRegex': /<b>0<\/b> rezultata/,
  1415. 'inSecondSearchBar': true,
  1416. 'both': true},
  1417. { 'name': 'TransHeaven (BG)',
  1418. 'icon': 'https://i.imgur.com/f3zgy93.png',
  1419. 'searchUrl': 'http://subs.sab.bz/index.php?act=search&movie=%search_string_orig%&yr=%year%',
  1420. 'matchRegex': /<tr class="subs-row">/,
  1421. 'positiveMatch': true,
  1422. 'inSecondSearchBar': true,
  1423. 'both': true},
  1424. { 'name': 'TVsubtitles',
  1425. 'searchUrl': 'http://www.tvsubtitles.net/search.php?q=%search_string_orig%',
  1426. 'matchRegex': /No results found/,
  1427. 'inSecondSearchBar': true,
  1428. 'TV': true}
  1429. ];
  1430.  
  1431. var other_searchable_sites = [
  1432. { 'name': 'PreDB',
  1433. 'loggedOutRegex': /Cloudflare Ray ID|Checking your browser|security check to access|seconds to search again/,
  1434. 'searchUrl': 'https://predb.me/?search=%search_string%+%year%&cats=movies',
  1435. 'matchRegex': /Nothing found.../,
  1436. 'inSecondSearchBar': true},
  1437. { 'name': 'PreDB',
  1438. 'loggedOutRegex': /Cloudflare Ray ID|Checking your browser|security check to access|seconds to search again/,
  1439. 'searchUrl': 'https://predb.me/?search=%search_string%&cats=tv',
  1440. 'matchRegex': /Nothing found.../,
  1441. 'inSecondSearchBar': true,
  1442. 'TV': true},
  1443. { 'name': 'PreDB-Orig',
  1444. 'loggedOutRegex': /Cloudflare Ray ID|Checking your browser|security check to access|seconds to search again/,
  1445. 'searchUrl': 'https://predb.me/?search=%search_string_orig%+%year%&cats=movies',
  1446. 'matchRegex': /Nothing found.../,
  1447. 'inSecondSearchBar': true},
  1448. { 'name': 'PreDB-Orig',
  1449. 'loggedOutRegex': /Cloudflare Ray ID|Checking your browser|security check to access|seconds to search again/,
  1450. 'searchUrl': 'https://predb.me/?search=%search_string_orig%&cats=tv',
  1451. 'matchRegex': /Nothing found.../,
  1452. 'inSecondSearchBar': true,
  1453. 'TV': true},
  1454. { 'name': 'srrDB',
  1455. 'searchUrl': 'https://www.srrdb.com/browse/imdb:%nott%',
  1456. 'matchRegex': />0 results</,
  1457. 'inSecondSearchBar': true,
  1458. 'both': true},
  1459. { 'name': 'Ulož',
  1460. 'searchUrl': 'https://uloz.to/hledej?type=videos&q=%search_string_orig%',
  1461. 'matchRegex': /nebylo nic nalezeno/,
  1462. 'inSecondSearchBar': true,
  1463. 'both': true},
  1464. { 'name': 'xREL',
  1465. 'searchUrl': 'https://www.xrel.to/search.html?xrel_search_query=%tt%&lang=en_US',
  1466. 'matchRegex': /not return any results/,
  1467. 'inSecondSearchBar': true,
  1468. 'both': true}
  1469. ];
  1470.  
  1471. var sites = public_sites.concat(private_sites, subs_sites, other_searchable_sites);
  1472.  
  1473. var icon_sites = [
  1474. { 'name': 'AllMovie',
  1475. 'searchUrl': 'https://www.allmovie.com/search/movies/%search_string%',
  1476. 'showByDefault': false},
  1477. { 'name': 'Amazon',
  1478. 'searchUrl': 'https://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Dmovies-tv&field-keywords=%search_string%',
  1479. 'showByDefault': false},
  1480. { 'name': 'BCDB',
  1481. 'icon': 'https://i.imgur.com/IZwCRkn.png',
  1482. 'searchUrl': 'https://www.bcdb.com/bcdb/search.cgi?query=%search_string%'},
  1483. { 'name': 'Blu-ray.com',
  1484. 'searchUrl': 'https://www.blu-ray.com/search/?quicksearch=1&quicksearch_country=all&quicksearch_keyword=%search_string%+&section=bluraymovies',
  1485. 'showByDefault': false},
  1486. { 'name': 'Criticker',
  1487. 'searchUrl': 'https://www.criticker.com/?search=%search_string%&type=films'},
  1488. { 'name': 'Facebook',
  1489. 'searchUrl': 'https://www.facebook.com/search/str/%search_string%/keywords_pages',
  1490. 'showByDefault': false},
  1491. { 'name': 'FilmAffinity',
  1492. 'searchUrl': 'https://www.filmaffinity.com/en/advsearch.php?stext=%search_string%&stype[]=title&fromyear=%year%&toyear=%year%',
  1493. 'showByDefault': false},
  1494. { 'name': 'Google',
  1495. 'searchUrl': 'https://www.google.com/search?q=%search_string%'},
  1496. { 'name': 'iCheckMovies',
  1497. 'searchUrl': 'https://www.icheckmovies.com/search/movies/?query=%tt%'},
  1498. { 'name': 'Letterboxd',
  1499. 'searchUrl': 'https://letterboxd.com/imdb/%nott%'},
  1500. { 'name': 'Metacritic',
  1501. 'searchUrl': 'https://www.metacritic.com/search/all/%search_string%/results?cats[movie]=1&cats[tv]=1&search_type=advanced&sort=relevancy',
  1502. 'showByDefault': false},
  1503. { 'name': 'MoviePosterDB',
  1504. 'searchUrl': 'https://www.movieposterdb.com/search?category=title&q=%tt%',
  1505. 'showByDefault': false},
  1506. { 'name': 'Netflix',
  1507. 'searchUrl': 'https://www.netflix.com/search/%search_string%',
  1508. 'showByDefault': false},
  1509. { 'name': 'OpenSubtitles',
  1510. 'searchUrl': 'https://www.opensubtitles.org/en/search/imdbid-%tt%'},
  1511. { 'name': 'Rotten Tomatoes',
  1512. 'searchUrl': 'https://www.rottentomatoes.com/search/?search=%search_string%'},
  1513. { 'name': 'Subscene',
  1514. 'icon': 'https://subscene.com/favicon.ico',
  1515. 'searchUrl': 'https://subscene.com/subtitles/searchbytitle?query=%search_string%'},
  1516. { 'name': 'TMDB',
  1517. 'icon': 'https://www.themoviedb.org/assets/2/favicon-16x16-b362d267873ce9c5a39f686a11fe67fec2a72ed25fa8396c11b71aa43c938b11.png',
  1518. 'searchUrl': 'https://www.themoviedb.org/search?query=%search_string%'},
  1519. { 'name': 'Trakt.tv',
  1520. 'icon': 'https://walter.trakt.tv/hotlink-ok/public/favicon.ico',
  1521. 'searchUrl': 'https://trakt.tv/search/imdb?query=%tt%',
  1522. 'showByDefault': false},
  1523. { 'name': 'TVDB',
  1524. 'icon': 'https://www.thetvdb.com/images/icon.png',
  1525. 'searchUrl': 'https://www.thetvdb.com/search?query=%search_string%'},
  1526. { 'name': 'uNoGS',
  1527. 'searchUrl': 'https://unogs.com/?q=%tt%',
  1528. 'showByDefault': false},
  1529. { 'name': 'Wikipedia',
  1530. 'searchUrl': 'https://en.wikipedia.org/w/index.php?search=%search_string%&go=Go'},
  1531. { 'name': 'YouTube.com',
  1532. 'searchUrl': 'https://www.youtube.com/results?search_query="%search_string%"+%year%+trailer'}
  1533. ];
  1534.  
  1535. //==============================================================================
  1536. // Replace Search URL parameters
  1537. //==============================================================================
  1538.  
  1539. function replaceSearchUrlParams(site, movie_id, movie_title, movie_title_orig, movie_year) {
  1540. var search_url = site['searchUrl'];
  1541. // If an array, do a little bit of recursion
  1542. if ($.isArray(search_url)) {
  1543. var search_array = [];
  1544. $.each(search_url, function(index, url) {
  1545. search_array[index] = replaceSearchUrlParams(url, movie_id, movie_title, movie_title_orig);
  1546. });
  1547. return search_array;
  1548. }
  1549. var space_replace = ('spaceEncode' in site) ? site['spaceEncode'] : '+';
  1550. var search_string = movie_title.trim().replace(/ +\(.*|&/g, '').replace(/\s+/g, space_replace);
  1551. var search_string_orig = movie_title_orig.trim().replace(/ +\(.*|&/g, '').replace(/\s+/g, space_replace);
  1552. var movie_year = (onSearchPage) ? movie_year : document.title.replace(/^(.+) \((\D*|)(\d{4})(.*)$/gi, '$3');
  1553. var s = search_url.replace(/%tt%/g, 'tt' + movie_id)
  1554. .replace(/%nott%/g, movie_id)
  1555. .replace(/%search_string%/g, search_string)
  1556. .replace(/%search_string_orig%/g, search_string_orig)
  1557. .replace(/%year%/g, movie_year);
  1558. return s;
  1559. }
  1560.  
  1561. //==============================================================================
  1562. // Construct & return Title/List GM_config setting
  1563. //==============================================================================
  1564.  
  1565. function getPageSetting(key) {
  1566. return (onSearchPage ? GM_config.get(key + '_search') : GM_config.get(key + '_movie'));
  1567. }
  1568.  
  1569. //==============================================================================
  1570. // Get site's icon
  1571. //==============================================================================
  1572.  
  1573. function getFavicon(site, hide_on_err) {
  1574. var favicon;
  1575. if (typeof(hide_on_err) === 'undefined') { hide_on_err = false }
  1576. if ('icon' in site) {
  1577. favicon = site['icon'];
  1578. } else {
  1579. var url = new URL(site['searchUrl']);
  1580. favicon = url.origin + '/favicon.ico';
  1581. }
  1582. var img = $('<img />').attr({'style': '-moz-opacity: 0.4; border: 0; vertical-align: text-top',
  1583. 'width': GM_config.get('cfg_icons_size'),
  1584. 'src': favicon,
  1585. 'title': site['name'],
  1586. 'alt': site['name']});
  1587. if (hide_on_err) { img.attr('onerror', "this.style.display='none';") }
  1588. return img;
  1589. }
  1590.  
  1591. //==============================================================================
  1592. // Add search links to an element
  1593. //==============================================================================
  1594.  
  1595. // State should always be one of the values defined in valid_states
  1596. function addLink(elem, link_text, target, site, state) {
  1597. var link = $('<a />').attr('href', target).attr('target', '_blank');
  1598. if ($.inArray(state, valid_states) < 0) {
  1599. console.log("Unknown state " + state);
  1600. }
  1601. if (getPageSetting('use_mod_icons')) {
  1602. var icon = getFavicon(site);
  1603. (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'});
  1604. if (state == 'error' || state == 'logged_out') {
  1605. icon.css('border-color', 'red');
  1606. } else if (state == 'missing') {
  1607. icon.css('border-color', 'yellow');
  1608. } else {
  1609. icon.css('border-color', 'green');
  1610. }
  1611. link.append(icon);
  1612. } else {
  1613. if (state == 'missing' || state == 'error' || state == 'logged_out') {
  1614. link.append($('<s />').append(link_text));
  1615. } else {
  1616. link.append(link_text);
  1617. }
  1618. if (state == 'error' || state == 'logged_out') {
  1619. link.css('color', 'red');
  1620. }
  1621. }
  1622.  
  1623. var in_element_two = ('inSecondSearchBar' in site) ? site['inSecondSearchBar'] : false;
  1624. var in_element_three = ('inThirdSearchBar' in site) ? site['inThirdSearchBar'] : false;
  1625. if (onSearchPage && in_element_two || onSearchPage && in_element_three || in_element_two && in_element_three) {
  1626. // No second/third bar sites on Search/List/Watchlist page.
  1627. return;
  1628. } else if (!onSearchPage && in_element_two) {
  1629. $('#imdbscoutsecondbar_' + state).append(link).append(' ');
  1630. } else if (!onSearchPage && in_element_three) {
  1631. $('#imdbscoutthirdbar_' + state).append(link).append(' ');
  1632. } else if (!onSearchPage) {
  1633. $('#imdbscout_' + state).append(link).append(' ');
  1634. } else {
  1635. var result_box = $(elem).find('td.result_box');
  1636. if (result_box.length > 0) {
  1637. $(result_box).append(link);
  1638. } else {
  1639. $(elem).append($('<td />').append(link).addClass('result_box'));
  1640. }
  1641. }
  1642. }
  1643.  
  1644. //==============================================================================
  1645. // Determine whether a site should be displayed
  1646. //==============================================================================
  1647.  
  1648. function maybeAddLink(elem, link_text, search_url, site, movie_id, movie_title, movie_title_orig, movie_year) {
  1649. // If the search URL is an array, recurse briefly on the elements.
  1650. if ($.isArray(search_url)) {
  1651. $.each(search_url, function(index, url) {
  1652. maybeAddLink(elem, link_text + '_' + (index + 1).toString(), url, site);
  1653. });
  1654. return;
  1655. }
  1656. // Don't check the second/third bar sites if a 2nd/3rd bar is disabled in the preferences.
  1657. var in_element_two = ('inSecondSearchBar' in site) ? site['inSecondSearchBar'] : false;
  1658. var in_element_three = ('inThirdSearchBar' in site) ? site['inThirdSearchBar'] : false;
  1659. if (in_element_two && !GM_config.get('load_second_bar') || in_element_three && !GM_config.get('load_third_bar') || in_element_two && in_element_three) {
  1660. return;
  1661. }
  1662. // Don't check the second/third bar sites on a Search/List/Watchlist page.
  1663. if (in_element_two && onSearchPage || in_element_three && onSearchPage) {
  1664. return;
  1665. }
  1666. // Connection rate limiter per domain.
  1667. var set_rate = ('rateLimit' in site) ? site['rateLimit'] : 200;
  1668. var rate = (onSearchPage) ? set_rate * 4 : set_rate;
  1669. var domain = search_url.split('/')[2];
  1670. var now = (new Date())*1;
  1671. var lastLoaded = window.localStorage[domain+'_lastLoaded'];
  1672. if (!lastLoaded) {
  1673. lastLoaded = now - 50000;
  1674. } else {
  1675. lastLoaded = parseInt(lastLoaded);
  1676. }
  1677. if (now - lastLoaded < rate) {
  1678. window.setTimeout(maybeAddLink.bind(undefined, elem, site['name'], search_url, site, movie_id, movie_title, movie_title_orig, movie_year), rate);
  1679. return;
  1680. } else {
  1681. window.localStorage[domain+'_lastLoaded'] = (new Date())*1;
  1682. }
  1683.  
  1684. var target = search_url;
  1685. if ('goToUrl' in site) {
  1686. target = replaceSearchUrlParams({'searchUrl': site['goToUrl']}, movie_id, movie_title, movie_title_orig, movie_year);
  1687. }
  1688.  
  1689. var success_match = ('positiveMatch' in site) ? site['positiveMatch'] : false;
  1690. GM_xmlhttpRequest({
  1691. method: 'GET',
  1692. url: search_url,
  1693. onload: function(response) {
  1694. if (response.responseHeaders.indexOf('efresh: 0; url') > -1) {
  1695. addLink(elem, link_text, target, site, 'logged_out');
  1696. } else if (site['positiveMatch'] && site['loggedOutRegex'] && String(response.responseText).match(site['loggedOutRegex'])) {
  1697. addLink(elem, link_text, target, site, 'logged_out');
  1698. } else if (String(response.responseText).match(site['matchRegex']) ? !(success_match) : success_match) {
  1699. if (getPageSetting('highlight_missing').split(',').includes(site['name'])) {
  1700. if (elem.style) {
  1701. elem.parentNode.style.background = 'rgba(255,104,104,0.7)';
  1702. } else {
  1703. document.querySelector('#imdbscout_missing').style.background = 'rgba(255,104,104,0.7)';
  1704. }
  1705. }
  1706. if (!getPageSetting('hide_missing')) {
  1707. addLink(elem, link_text, target, site, 'missing');
  1708. }
  1709. } else if (site['loggedOutRegex'] && String(response.responseText).match(site['loggedOutRegex'])) {
  1710. addLink(elem, link_text, target, site, 'logged_out');
  1711. } else {
  1712. addLink(elem, link_text, target, site, 'found');
  1713. }
  1714. },
  1715. onerror: function() {
  1716. addLink(elem, link_text, target, site, 'error');
  1717. },
  1718. onabort: function() {
  1719. addLink(elem, link_text, target, site, 'error');
  1720. }
  1721. });
  1722. }
  1723.  
  1724. //==============================================================================
  1725. // Perform code to create fields and display sites
  1726. //==============================================================================
  1727.  
  1728. function perform(elem, movie_id, movie_title, movie_title_orig, is_tv, is_movie, movie_year) {
  1729. var site_shown = false;
  1730. $.each(sites, function(index, site) {
  1731. if (site['show']) {
  1732. site_shown = true;
  1733. // For TV Series show only TV links. TV Special, TV Movie, Episode & Documentary are treated as TV and Movie.
  1734. if ((Boolean(site['TV']) == is_tv || Boolean(site['both'])) || (!is_tv && !is_movie) || getPageSetting('ignore_type')) {
  1735. var searchUrl = replaceSearchUrlParams(site, movie_id, movie_title, movie_title_orig, movie_year);
  1736. if ('goToUrl' in site && getPageSetting('call_http_mod')) {
  1737. maybeAddLink(elem, site['name'], searchUrl, site, movie_id, movie_title, movie_title_orig, movie_year);
  1738. }
  1739. if ('goToUrl' in site && !getPageSetting('call_http_mod')) {
  1740. searchUrl = replaceSearchUrlParams({'searchUrl': site['goToUrl']}, movie_id, movie_title, movie_title_orig, movie_year);
  1741. addLink(elem, site['name'], searchUrl, site, 'found');
  1742. }
  1743. if (!('goToUrl' in site) && getPageSetting('call_http_mod')) {
  1744. maybeAddLink(elem, site['name'], searchUrl, site);
  1745. }
  1746. if (!('goToUrl' in site) && !getPageSetting('call_http_mod')){
  1747. addLink(elem, site['name'], searchUrl, site, 'found');
  1748. }
  1749. }
  1750. }
  1751. });
  1752. if (!site_shown) {
  1753. $(elem).append('No sites enabled! "IMDb Scout Mod Preferences" button you can find on Monkeys plugin icon.');
  1754. }
  1755. }
  1756.  
  1757. //==============================================================================
  1758. // 'Load' button code
  1759. //==============================================================================
  1760.  
  1761. // Runs when "Load on Start?" is disabled.
  1762. function displayButton() {
  1763. var p = $('<p />').attr('id', 'imdbscout_button');
  1764. p.append($('<button>Load IMDb Scout</button>').click(function() {
  1765. $('#imdbscout_button').remove();
  1766. if (onSearchPage) {
  1767. performSearch();
  1768. } else {
  1769. performPage();
  1770. }
  1771. }));
  1772. if (onSearchPage) {
  1773. $('#sidebar').append(p);
  1774. } else if ($('h1.header:first').length) {
  1775. $('h1.header:first').parent().append(p);
  1776. } else if (GM_config.get('use_new_layout') && $('.button_panel.navigation_panel').length) {
  1777. $('.button_panel.navigation_panel').after(p);
  1778. } else if (GM_config.get('use_new_layout') && $('.title_block').length) {
  1779. $('.title_block').after(p);
  1780. } else if ($('#title-overview-widget').length) {
  1781. $('#title-overview-widget').parent().append(p);
  1782. } else if ($('.titlereference-header').length) {
  1783. $('.titlereference-header').append(p);
  1784. } else {
  1785. $('#tn15rating').before(p);
  1786. }
  1787. }
  1788.  
  1789. //==============================================================================
  1790. // Icons at top bar on Title page
  1791. //==============================================================================
  1792.  
  1793. // Unlike the other URLs, they aren't checked to see if the movie exists.
  1794. function addIconBar(movie_id, movie_title, movie_title_orig) {
  1795. var iconbar;
  1796. if ($('h1.header:first').length) {
  1797. iconbar = $('h1.header:first').append($('<br/>'));
  1798. } else if ($('.title_wrapper h1').length) {
  1799. iconbar = $('.title_wrapper h1').append($('<br/>'));
  1800. } else if ($('h3[itemprop="name"]').length) {
  1801. iconbar = $('h3[itemprop="name"]').append($('<br/>'));
  1802. } else {
  1803. iconbar = $('#tn15title .title-extra');
  1804. }
  1805. $.each(icon_sites, function(index, site) {
  1806. if (site['show']) {
  1807. var search_url = replaceSearchUrlParams(site, movie_id, movie_title, movie_title_orig);
  1808. var image = getFavicon(site);
  1809. var html = $('<span />').append("&nbsp;").attr('style', 'font-size: 11px;').append(
  1810. $('<a />').attr('href', search_url)
  1811. .addClass('iconbar_icon').append(image));
  1812. iconbar.append(html).append();
  1813. }
  1814. });
  1815. //If we have access to the openInTab function, add an Open All feature
  1816. if (GM_openInTab) {
  1817. var aopenall = $('<a />').text('Open All')
  1818. .prepend("&nbsp;")
  1819. .attr('href', 'javascript:;')
  1820. .attr('style', 'font-weight:bold;font-size:11px;font-family: Calibri, Verdana, Arial, Helvetica, sans-serif;');
  1821. aopenall.click(function() {
  1822. $('.iconbar_icon').each(function() {
  1823. GM_openInTab($(this).attr('href'));
  1824. });
  1825. }, false);
  1826. iconbar.append(aopenall);
  1827. }
  1828. }
  1829.  
  1830. //==============================================================================
  1831. // Search/List/Watchlist page code
  1832. //==============================================================================
  1833.  
  1834. function performSearch() {
  1835. //Add css for the new table cells we're going to add
  1836. var styles = '.result_box {width: 975px}';
  1837. styles += '.result_box a { margin-right: 5px; color: #444;}';
  1838. styles += '.result_box a:visited { color: #551A8B; }';
  1839. styles += '#content-2-wide #main, #content-2-wide';
  1840. styles += '.maindetails_center {margin-left: 5px; width: 1001px;}';
  1841. GM_addStyle(styles);
  1842.  
  1843. var showsites = sites.reduce(function (n, x) {
  1844. return n + (x.show == true); }, 0);
  1845.  
  1846. var search_page = (Boolean(location.href.match('/search/'))) ? true : false;
  1847. if($('.lister-list').children().length !== 0) {
  1848. $('.lister-list').children().each(function() {
  1849. var elem = (search_page) ? $(this).find('.lister-item-content') : $(this);
  1850. var link = $(this).find('.lister-item-image>a');
  1851. var movie_id = link.attr('href').match(/tt([0-9]*)\/?.*/)[1];
  1852. performSearchSecondPart(elem, link, movie_id, showsites);
  1853. });
  1854. }
  1855. }
  1856.  
  1857. function performSearchSecondPart(elem, link, movie_id, showsites) {
  1858. // Connection rate limiter for IMDb.
  1859. var rate;
  1860. if (!(GM_config.get('call_http_mod_search'))) {
  1861. rate = 400;
  1862. } else if (showsites > 99) {
  1863. rate = 6000;
  1864. } else if (showsites > 80) {
  1865. rate = 5000;
  1866. } else if (showsites > 60) {
  1867. rate = 3500;
  1868. } else if (showsites > 40) {
  1869. rate = 2500;
  1870. } else if (showsites > 20) {
  1871. rate = 2000;
  1872. } else if (showsites > 10) {
  1873. rate = 1500;
  1874. } else {
  1875. rate = 1000;
  1876. }
  1877. var domain = "https://www.imdb.com";
  1878. var now = (new Date())*1;
  1879. var lastLoaded = window.localStorage[domain+'_lastLoaded'];
  1880. if (!lastLoaded) {
  1881. lastLoaded = now - 8000;
  1882. } else {
  1883. lastLoaded = parseInt(lastLoaded);
  1884. }
  1885. if (now - lastLoaded < rate) {
  1886. window.setTimeout(performSearchSecondPart.bind(undefined, elem, link, movie_id, showsites), rate);
  1887. return;
  1888. } else {
  1889. window.localStorage[domain+'_lastLoaded'] = (new Date())*1;
  1890. }
  1891.  
  1892. GM_xmlhttpRequest ({
  1893. method: "GET",
  1894. url: "https://www.imdb.com" + link.attr('href'),
  1895. onload: function(response) {
  1896. var parser = new DOMParser();
  1897. var result = parser.parseFromString(response.responseText, "text/html");
  1898.  
  1899. var is_tv = Boolean($(result).find('title').text().match('TV Series')) || Boolean($(result).find('.tv-extra').length);
  1900. var is_movie = (Boolean($(result).find('.subtext').text().match('TV Special'))) ? false : Boolean($(result).find('title').text().match(/.*? \(([0-9]*)\)/));
  1901. if (Boolean($(result).find('.subtext').text().match('Documentary'))) {
  1902. is_tv = false;
  1903. is_movie = false;
  1904. }
  1905. var movie_year = result.title.replace(/^(.+) \((\D*|)(\d{4})(.*)$/gi, '$3');
  1906. var movie_title = $(result).find('.title_wrapper>h1').clone().children().remove().end().text();
  1907. var movie_title_orig = $(result).find('.originalTitle').clone().children().remove().end().text();
  1908. if (movie_title_orig === "") {
  1909. movie_title_orig = movie_title;
  1910. }
  1911. perform(elem, movie_id, movie_title, movie_title_orig, is_tv, is_movie, movie_year);
  1912. }
  1913. });
  1914. }
  1915.  
  1916. //==============================================================================
  1917. // Title page code
  1918. //==============================================================================
  1919.  
  1920. function performPage() {
  1921. var movie_title = $('.title_wrapper>h1').clone().children().remove().end().text();
  1922. if (movie_title === "") {
  1923. movie_title = $('h3[itemprop="name"]').text().trim();
  1924. }
  1925. var movie_title_orig = $('.originalTitle').clone().children().remove().end().text();
  1926. if (movie_title_orig === "") {
  1927. movie_title_orig = movie_title;
  1928. }
  1929. var movie_id = document.URL.match(/\/tt([0-9]+)\//)[1].trim('tt');
  1930. var is_tv = Boolean($('title').text().match('TV Series')) || Boolean($('.tv-extra').length);
  1931. var is_movie = (Boolean($('.subtext').text().match('TV Special')) || Boolean($('li.ipl-inline-list__item').text().match('TV Special'))) ? false : Boolean($('title').text().match(/.*? \(([0-9]*)\)/));
  1932. if (Boolean($('.subtext').text().match('Documentary')) || Boolean($('li.ipl-inline-list__item').text().match('Documentary'))) {
  1933. is_tv = false;
  1934. is_movie = false;
  1935. }
  1936. //Create areas to put links in
  1937. if (GM_config.get('load_second_bar') && !GM_config.get('load_third_bar')) {
  1938. getLinkAreaSecond(GM_config.get('load_second_bar'));
  1939. } else if (!GM_config.get('load_second_bar') && GM_config.get('load_third_bar')) {
  1940. getLinkAreaThird();
  1941. } else if (GM_config.get('load_second_bar') && GM_config.get('load_third_bar') && !GM_config.get('switch_bars')) {
  1942. getLinkAreaThird();
  1943. getLinkAreaSecond();
  1944. } else if (GM_config.get('load_second_bar') && GM_config.get('load_third_bar') && GM_config.get('switch_bars')) {
  1945. getLinkAreaSecond();
  1946. getLinkAreaThird();
  1947. }
  1948. perform(getLinkArea(), movie_id, movie_title, movie_title_orig, is_tv, is_movie);
  1949. addIconBar(movie_id, movie_title, movie_title_orig);
  1950. }
  1951.  
  1952. //==============================================================================
  1953. // Create elements for the 1st search bar on Title page
  1954. //==============================================================================
  1955.  
  1956. function getLinkArea() {
  1957. // If it already exists, just return it
  1958. if ($('#imdbscout_header').length) {
  1959. return $('#imdbscout_header');
  1960. }
  1961. var p = $('<p />').append('<h2>' + GM_config.get('imdbscoutmod_header_text') + '</h2>').attr('id', 'imdbscout_header').css({
  1962. 'padding': '0px 20px',
  1963. 'font-weight': 'bold'
  1964. });
  1965. var background_color = (GM_config.get('new_layout_dark')) ? '#333333' : '#EEEEEE';
  1966. var txt_color = (GM_config.get('new_layout_dark')) ? '#EEEEEE' : '#333333';
  1967. var p_new = $('<p />').append(GM_config.get('imdbscoutmod_header_text')).attr('id', 'imdbscout_header').css({
  1968. 'padding': '4px 11px',
  1969. 'font-weight': 'bold',
  1970. 'background-color': background_color,
  1971. 'margin-top': '0px',
  1972. 'margin-bottom': '0px',
  1973. 'overflow': 'hidden',
  1974. 'color': txt_color
  1975. });
  1976. if (GM_config.get('use_new_layout')) {
  1977. var p = p_new;
  1978. }
  1979. $.each(valid_states, function(i, name) {
  1980. if (GM_config.get('one_line')) {
  1981. p.append($('<span />').attr('id', 'imdbscout_' + name));
  1982. } else {
  1983. var title = $('<span>' + name.replace('_', ' ') + ': </span>').css({
  1984. 'textTransform': 'capitalize',
  1985. 'min-width': '100px',
  1986. 'display': 'inline-block'
  1987. });
  1988. p.append($('<div />').attr('id', 'imdbscout_' + name).append(title));
  1989. }
  1990. });
  1991. if ($('h1.header:first').length) {
  1992. $('h1.header:first').parent().append(p);
  1993. } else if (GM_config.get('use_new_layout') && $('.button_panel.navigation_panel').length) {
  1994. $('.button_panel.navigation_panel').after(p);
  1995. } else if (GM_config.get('use_new_layout') && $('.title_block').length) {
  1996. $('.title_block').after(p);
  1997. } else if ($('#title-overview-widget').length) {
  1998. $('#title-overview-widget').parent().append(p);
  1999. } else if ($('.titlereference-header').length) {
  2000. $('.titlereference-header').append(p);
  2001. } else {
  2002. $('#tn15rating').before(p);
  2003. }
  2004. return $('#imdbscout_header');
  2005. }
  2006.  
  2007. //==============================================================================
  2008. // Create elements for the 2nd search bar on Title page
  2009. //==============================================================================
  2010.  
  2011. function getLinkAreaSecond() {
  2012. // If it already exists, just return it
  2013. if ($('#imdbscoutsecondbar_header').length) {
  2014. return $('#imdbscoutsecondbar_header');
  2015. }
  2016. var p = $('<p />').append('<h2>' + GM_config.get('imdbscoutsecondbar_header_text') + '</h2>').attr('id', 'imdbscoutsecondbar_header').css({
  2017. 'padding': '0px 20px',
  2018. 'font-weight': 'bold'
  2019. });
  2020. var background_color = (GM_config.get('new_layout_dark')) ? '#333333' : '#EEEEEE';
  2021. var txt_color = (GM_config.get('new_layout_dark')) ? '#EEEEEE' : '#333333';
  2022. var p_new = $('<p />').append(GM_config.get('imdbscoutsecondbar_header_text')).attr('id', 'imdbscoutsecondbar_header').css({
  2023. 'padding': '4px 11px',
  2024. 'font-weight': 'bold',
  2025. 'background-color': background_color,
  2026. 'margin-top': '0px',
  2027. 'margin-bottom': '0px',
  2028. 'overflow': 'hidden',
  2029. 'color': txt_color
  2030. });
  2031. if (GM_config.get('use_new_layout')) {
  2032. var p = p_new;
  2033. }
  2034. $.each(valid_states, function(i, name) {
  2035. if (GM_config.get('one_line')) {
  2036. p.append($('<span />').attr('id', 'imdbscoutsecondbar_' + name));
  2037. } else {
  2038. var title = $('<span>' + name.replace('_', ' ') + ': </span>').css({
  2039. 'textTransform': 'capitalize',
  2040. 'min-width': '100px',
  2041. 'display': 'inline-block'
  2042. });
  2043. p.append($('<div />').attr('id', 'imdbscoutsecondbar_' + name).append(title));
  2044. }
  2045. });
  2046. if ($('h1.header:first').length) {
  2047. $('h1.header:first').parent().append(p);
  2048. } else if (GM_config.get('use_new_layout') && $('.button_panel.navigation_panel').length) {
  2049. $('.button_panel.navigation_panel').after(p);
  2050. } else if (GM_config.get('use_new_layout') && $('.title_block').length) {
  2051. $('.title_block').after(p);
  2052. } else if ($('#title-overview-widget').length) {
  2053. $('#title-overview-widget').parent().append(p);
  2054. } else if ($('.titlereference-header').length) {
  2055. $('.titlereference-header').append(p);
  2056. } else {
  2057. $('#tn15rating').before(p);
  2058. }
  2059. return $('#imdbscoutsecondbar_header');
  2060. }
  2061.  
  2062. //==============================================================================
  2063. // Create elements for the 3rd search bar on Title page
  2064. //==============================================================================
  2065.  
  2066. function getLinkAreaThird() {
  2067. // If it already exists, just return it
  2068. if ($('#imdbscoutthirdbar_header').length) {
  2069. return $('#imdbscoutthirdbar_header');
  2070. }
  2071. var p = $('<p />').append('<h2>' + GM_config.get('imdbscoutthirdbar_header_text') + '</h2>').attr('id', 'imdbscoutthirdbar_header').css({
  2072. 'padding': '0px 20px',
  2073. 'font-weight': 'bold'
  2074. });
  2075. var background_color = (GM_config.get('new_layout_dark')) ? '#333333' : '#EEEEEE';
  2076. var txt_color = (GM_config.get('new_layout_dark')) ? '#EEEEEE' : '#333333';
  2077. var p_new = $('<p />').append(GM_config.get('imdbscoutthirdbar_header_text')).attr('id', 'imdbscoutthirdbar_header').css({
  2078. 'padding': '4px 11px',
  2079. 'font-weight': 'bold',
  2080. 'background-color': background_color,
  2081. 'margin-top': '0px',
  2082. 'margin-bottom': '0px',
  2083. 'overflow': 'hidden',
  2084. 'color': txt_color
  2085. });
  2086. if (GM_config.get('use_new_layout')) {
  2087. var p = p_new;
  2088. }
  2089. $.each(valid_states, function(i, name) {
  2090. if (GM_config.get('one_line')) {
  2091. p.append($('<span />').attr('id', 'imdbscoutthirdbar_' + name));
  2092. } else {
  2093. var title = $('<span>' + name.replace('_', ' ') + ': </span>').css({
  2094. 'textTransform': 'capitalize',
  2095. 'min-width': '100px',
  2096. 'display': 'inline-block'
  2097. });
  2098. p.append($('<div />').attr('id', 'imdbscoutthirdbar_' + name).append(title));
  2099. }
  2100. });
  2101. if ($('h1.header:first').length) {
  2102. $('h1.header:first').parent().append(p);
  2103. } else if (GM_config.get('use_new_layout') && $('.button_panel.navigation_panel').length) {
  2104. $('.button_panel.navigation_panel').after(p);
  2105. } else if (GM_config.get('use_new_layout') && $('.title_block').length) {
  2106. $('.title_block').after(p);
  2107. } else if ($('#title-overview-widget').length) {
  2108. $('#title-overview-widget').parent().append(p);
  2109. } else if ($('.titlereference-header').length) {
  2110. $('.titlereference-header').append(p);
  2111. } else {
  2112. $('#tn15rating').before(p);
  2113. }
  2114. return $('#imdbscoutthirdbar_header');
  2115. }
  2116.  
  2117. //==============================================================================
  2118. // Create the config name (GM_config)
  2119. //==============================================================================
  2120.  
  2121. function configName(site) {
  2122. if ('configName' in site) {
  2123. return 'show_' + site['configName'] + (site['TV'] ? '_TV' : '');
  2124. } else {
  2125. return 'show_' + site['name'] + (site['TV'] ? '_TV' : '');
  2126. }
  2127. }
  2128.  
  2129.  
  2130. //================================ MAIN ====================================//
  2131.  
  2132.  
  2133. //==============================================================================
  2134. // Preferences Menu (GM_config)
  2135. //==============================================================================
  2136.  
  2137. var config_fields = {
  2138. 'imdbscoutmod_header_text': {
  2139. 'label': 'Header text for the 1st bar:',
  2140. 'type': 'text',
  2141. 'default': ''
  2142. },
  2143. 'imdbscoutsecondbar_header_text': {
  2144. 'label': 'Header text for the 2nd bar:',
  2145. 'type': 'text',
  2146. 'default': ''
  2147. },
  2148. 'imdbscoutthirdbar_header_text': {
  2149. 'label': 'Header text for the 3rd bar:',
  2150. 'type': 'text',
  2151. 'default': ''
  2152. },
  2153. 'cfg_icons_size': {
  2154. 'label': 'Size of the icons (pixels):',
  2155. 'type': 'text',
  2156. 'default': '20'
  2157. },
  2158. 'loadmod_on_start_movie': {
  2159. 'section': 'Title Page:'.bold(),
  2160. 'type': 'checkbox',
  2161. 'label': 'Load on start?',
  2162. 'default': true
  2163. },
  2164. 'load_second_bar': {
  2165. 'type': 'checkbox',
  2166. 'label': 'Enable the 2nd search bar?',
  2167. 'default': false
  2168. },
  2169. 'load_third_bar': {
  2170. 'type': 'checkbox',
  2171. 'label': 'Enable the 3rd search bar?',
  2172. 'default': false
  2173. },
  2174. 'switch_bars': {
  2175. 'type': 'checkbox',
  2176. 'label': 'Swap 2nd and 3rd bars?',
  2177. 'default': false
  2178. },
  2179. 'use_new_layout': {
  2180. 'type': 'checkbox',
  2181. 'label': 'Use the new layout?',
  2182. 'default': true
  2183. },
  2184. 'new_layout_dark': {
  2185. 'type': 'checkbox',
  2186. 'label': 'Dark background for the new layout?',
  2187. 'default': true
  2188. },
  2189. 'call_http_mod_movie': {
  2190. 'type': 'checkbox',
  2191. 'label': 'Actually check for the search results?',
  2192. 'default': true
  2193. },
  2194. 'hide_missing_movie': {
  2195. 'type': 'checkbox',
  2196. 'label': 'Hide missing links?',
  2197. 'default': false
  2198. },
  2199. 'use_mod_icons_movie': {
  2200. 'type': 'checkbox',
  2201. 'label': 'Use icons instead of text?',
  2202. 'default': true
  2203. },
  2204. 'one_line': {
  2205. 'type': 'checkbox',
  2206. 'label': 'Show results on one line?',
  2207. 'default': true
  2208. },
  2209. 'ignore_type_movie': {
  2210. 'type': 'checkbox',
  2211. 'label': 'Search all sites, ignoring movie/tv distinction?',
  2212. 'default': false
  2213. },
  2214. 'highlight_missing_movie': {
  2215. 'label': 'Highlight when not on:',
  2216. 'type': 'text',
  2217. 'default': ''
  2218. },
  2219. 'loadmod_on_start_search': {
  2220. 'section': 'Search/List/Watchlist Page:'.bold(),
  2221. 'type': 'checkbox',
  2222. 'label': 'Load on start?',
  2223. 'default': false
  2224. },
  2225. 'call_http_mod_search': {
  2226. 'type': 'checkbox',
  2227. 'label': 'Actually check for the search results?',
  2228. 'default': true
  2229. },
  2230. 'hide_missing_search': {
  2231. 'type': 'checkbox',
  2232. 'label': 'Hide missing links?',
  2233. 'default': false
  2234. },
  2235. 'use_mod_icons_search': {
  2236. 'type': 'checkbox',
  2237. 'label': 'Use icons instead of text?',
  2238. 'default': true
  2239. },
  2240. 'ignore_type_search': {
  2241. 'type': 'checkbox',
  2242. 'label': 'Search all sites, ignoring movie/tv distinction?',
  2243. 'default': false
  2244. },
  2245. 'highlight_missing_search': {
  2246. 'label': 'Highlight when not on:',
  2247. 'type': 'text',
  2248. 'default': ''
  2249. }
  2250. };
  2251.  
  2252. //==============================================================================
  2253. // Add sites to preferences (GM_config)
  2254. //==============================================================================
  2255.  
  2256. $.each(public_sites, function(index, site) {
  2257. config_fields[configName(site)] = {
  2258. 'section': (index == 0) ? ['Public download sites:'.bold()] : '',
  2259. 'type': 'checkbox',
  2260. 'label': ' ' + site['name'] + (site['TV'] ? ' (TV)' : '')
  2261. };
  2262. });
  2263.  
  2264. $.each(private_sites, function(index, site) {
  2265. config_fields[configName(site)] = {
  2266. 'section': (index == 0) ? ['Private download sites:'.bold()] : '',
  2267. 'type': 'checkbox',
  2268. 'label': ' ' + site['name'] + (site['TV'] ? ' (TV)' : '')
  2269. };
  2270. });
  2271.  
  2272. $.each(subs_sites, function(index, site) {
  2273. config_fields[configName(site)] = {
  2274. 'section': (index == 0) ? ['Subtitles sites (in 2nd bar):'.bold()] : '',
  2275. 'type': 'checkbox',
  2276. 'label': ' ' + site['name'] + (site['TV'] ? ' (TV)' : '')
  2277. };
  2278. });
  2279.  
  2280. $.each(other_searchable_sites, function(index, site) {
  2281. config_fields[configName(site)] = {
  2282. 'section': (index == 0) ? ['Other searchable sites (in 2nd bar):'.bold()] : '',
  2283. 'type': 'checkbox',
  2284. 'label': ' ' + site['name'] + (site['TV'] ? ' (TV)' : '')
  2285. };
  2286. });
  2287.  
  2288. $.each(icon_sites, function(index, icon_site) {
  2289. config_fields['show_icon_' + icon_site['name']] = {
  2290. 'section': (index == 0) ? ['Other sites (no search):'.bold()] : '',
  2291. 'type': 'checkbox',
  2292. 'label': ' ' + icon_site['name'],
  2293. 'default': ('showByDefault' in icon_site) ?
  2294. icon_site['showByDefault'] : true
  2295. };
  2296. });
  2297.  
  2298. //==============================================================================
  2299. // Initialize and register GM_config
  2300. //==============================================================================
  2301.  
  2302. GM_config.init({
  2303. 'id': 'imdb_scout',
  2304. 'title': 'IMDb Scout Mod Preferences',
  2305. 'fields': config_fields,
  2306. 'css': '.section_header { \
  2307. background: white !important; \
  2308. color: black !important; \
  2309. border: 0px !important; \
  2310. text-align: left !important;} \
  2311. .field_label { \
  2312. font-weight: normal !important;}',
  2313. 'events':
  2314. {
  2315. 'open': function() {
  2316. $('#imdb_scout').contents().find('#imdb_scout_section_2').find('.field_label').each(function(index, label) {
  2317. var url = new URL(public_sites[index].searchUrl);
  2318. $(label).append(' ' + '<a class="grey_link" target="_blank" style="color: gray; text-decoration : none" href="' + url.origin + '">'
  2319. + (/www./.test(url.hostname) ? url.hostname.match(/www.(.*)/)[1] : url.hostname) + '</a>');
  2320. $(label).prepend(getFavicon(public_sites[index], true));
  2321. });
  2322. $('#imdb_scout').contents().find('#imdb_scout_section_3').find('.field_label').each(function(index, label) {
  2323. var url = new URL(private_sites[index].searchUrl);
  2324. $(label).append(' ' + '<a class="grey_link" target="_blank" style="color: gray; text-decoration : none" href="' + url.origin + '">'
  2325. + (/www./.test(url.hostname) ? url.hostname.match(/www.(.*)/)[1] : url.hostname) + '</a>');
  2326. $(label).prepend(getFavicon(private_sites[index], true));
  2327. });
  2328. $('#imdb_scout').contents().find('#imdb_scout_section_4').find('.field_label').each(function(index, label) {
  2329. var url = new URL(subs_sites[index].searchUrl);
  2330. $(label).append(' ' + '<a class="grey_link" target="_blank" style="color: gray; text-decoration : none" href="' + url.origin + '">'
  2331. + (/www./.test(url.hostname) ? url.hostname.match(/www.(.*)/)[1] : url.hostname) + '</a>');
  2332. $(label).prepend(getFavicon(subs_sites[index], true));
  2333. });
  2334. $('#imdb_scout').contents().find('#imdb_scout_section_5').find('.field_label').each(function(index, label) {
  2335. var url = new URL(other_searchable_sites[index].searchUrl);
  2336. $(label).append(' ' + '<a class="grey_link" target="_blank" style="color: gray; text-decoration : none" href="' + url.origin + '">'
  2337. + (/www./.test(url.hostname) ? url.hostname.match(/www.(.*)/)[1] : url.hostname) + '</a>');
  2338. $(label).prepend(getFavicon(other_searchable_sites[index], true));
  2339. });
  2340. $('#imdb_scout').contents().find('#imdb_scout_section_6').find('.field_label').each(function(index, label) {
  2341. $(label).prepend(getFavicon(icon_sites[index], true));
  2342. });
  2343. }
  2344. }
  2345. });
  2346.  
  2347. GM_registerMenuCommand('IMDb Scout Mod Preferences', function() {GM_config.open()});
  2348.  
  2349. //==============================================================================
  2350. // Fetch per-site values from GM_config
  2351. //==============================================================================
  2352.  
  2353. $.each(sites, function(index, site) {
  2354. site['show'] = GM_config.get(configName(site));
  2355. });
  2356.  
  2357. $.each(icon_sites, function(index, icon_site) {
  2358. icon_site['show'] = GM_config.get('show_icon_' + icon_site['name']);
  2359. });
  2360.  
  2361. //==============================================================================
  2362. // Global variables
  2363. //==============================================================================
  2364.  
  2365. // For internal use (order matters).
  2366. var valid_states = [
  2367. 'found',
  2368. 'missing',
  2369. 'logged_out',
  2370. 'error'
  2371. ];
  2372.  
  2373. // Are we on a search/list page?
  2374. var onSearchPage = Boolean(location.href.match('/search/'))
  2375. || Boolean(location.href.match('/list/'))
  2376. || Boolean(location.href.match('watchlist'));
  2377.  
  2378. //==============================================================================
  2379. // Start: Display 'Load' button or add links to sites
  2380. //==============================================================================
  2381.  
  2382. $('title').ready(function() {
  2383. if (window.top == window.self) {
  2384. if (!onSearchPage && GM_config.get('loadmod_on_start_movie')) {
  2385. performPage();
  2386. } else if (onSearchPage && GM_config.get('loadmod_on_start_search')) {
  2387. performSearch();
  2388. } else {
  2389. displayButton();
  2390. }
  2391. }
  2392. });