Greasy Fork

Quality filters - torrentgalaxy.to

Feel some of the benefits of Private trackers.

目前为 2023-12-04 提交的版本。查看 最新版本

// ==UserScript==
// @name        Quality filters - torrentgalaxy.to
// @namespace   Violentmonkey Scripts
// @match       https://torrentgalaxy.to/*
// @grant       GM_addStyle
// @version     0.20
// @run-at      document-end
// @author      https://github.com/webdevsk
// @description Feel some of the benefits of Private trackers.
// @license     MIT
// ==/UserScript==

// Scene release*: Orange background
// High Quality Encoders*: Yellow background
// Micro encoders*: Hidden
// XXX uploaders: Hidden

// In search result, torrents under some categories have been hidden as well.
// // Blocked Categories
//  //   SD
//  //  Episodes SD
//  //  XXX
//  //  CAM/TS
//  //  XXX - SD


// *Scene: Source WEB-DL uploads. But renames to WEBRip for some reason.
// *High Quality Encoders: Rips in almost close to Blu-ray/WEB-DL source.
// *Micro encoders: Very tiny file size which greatly impacts quality.

// Why not JS?         With JS I would have to take page-load, async functions into account.
// Why not on Firefox  Firefox doesn't support modern CSS selectors yet. Tell them to upgrade.

// Torrent links ENDING with these strings
// TGx] translates to TGx- in their urls
const blockAdultContent = true

const scene = [
  'TGx-',
  'FLUX',
  'CMRG',
  'Ntb',
]

// Torrent links ENDING with these strings
const quality = [
  'QxR-',
  'FGT',
  'FraMeSToR',
  'Prof-',
  'Vyndros-'
]

// uploader profile href="/profile/EACH_STRING"
// for landing page
const blocked = !blockAdultContent ? [] : [
  'TheDarkRider',
  'GalaxyRG',
  'Pornbits',
  'NoisyBoY',
  'sbudennogo',
  'GalaXXXy',
  'Pornlake',
]

const blockedCategory = {
  'Movies - SD'       : 1,
  'TV - Episodes SD'  : 5,
  'Movies - CAM/TS'   : 45,
}

if (blockAdultContent) {
  Object.assign(blockedCategory, {
  'XXX - Misc'        : 47,
  'XXX - HD'          : 35,
  'XXX - 4K UHD'      : 48,
  'XXX - SD'          : 34
  })
}


const sceneTemplates = scene.map(s => `[href$="${s}"]`)
const qualityTemplates = quality.map(q => `[href$="${q}"]`)
const blockedTemplates = blocked.map(b => `[href="/profile/${b}"]`)
const categoryTemplates = Object.values(blockedCategory).map(cat => `[href="/torrents.php?cat=${cat}"]`)


GM_addStyle(
    `
  /*-----------------------   Scene   -----------------------*/
  .tgxtable .tgxtablerow:has( :is(${ sceneTemplates })){
    background: #ffd700;
    color: #1b1b1b;
  }


  .tgxtable .tgxtablerow:has( :is(${ sceneTemplates })) .tgxtablecell{
    border-bottom: 1px solid #333;
  }

  .tgxtable .tgxtablerow:has( :is(${ sceneTemplates })) a:not([title="comments"]){
    color: #1b1b1b;
    text-shadow: none;
  }

  /*-----------------------   Quality Rippers   -----------------------*/
  .tgxtable .tgxtablerow:has( :is(${ qualityTemplates })){
    background: #f2970e;
    color: #1b1b1b;
  }


  .tgxtable .tgxtablerow:has( :is(${ qualityTemplates })) .tgxtablecell{
    border-bottom: 1px solid #333;
  }

  .tgxtable .tgxtablerow:has( :is(${ qualityTemplates })) a:not([title="comments"]){
    color: #1b1b1b;
    text-shadow: none;
  }

  /*-----------------------       Blocked         -----------------------*/
  .tgxtable .tgxtablerow:has( :is(${ blockedTemplates })){
    display: none;
  }

  /*-----------------------       Block by Category        -----------------------*/

  .tgxtable .tgxtablerow:has( :is(${ categoryTemplates })){
    display: none;
  }
  `
)