├── README.md └── gazelle_collapse_duplicates.user.js /README.md: -------------------------------------------------------------------------------- 1 | # Requirements 2 | This is a userscript. You need a compatible browser with an extension to run this type of scripts. 3 | 4 | If you need help on setting up your browser, have a look at [greasyfork](https://greasyfork.org/en). 5 | 6 | # Installation 7 | Simply point your browser to the [raw](https://github.com/colligere/collapse_duplicates/raw/master/gazelle_collapse_duplicates.user.js) version of the script. Your browser add-on will automatically prompt you to install the script. 8 | -------------------------------------------------------------------------------- /gazelle_collapse_duplicates.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name gazelle collapse duplicates 3 | // @include /https?://www\.empornium\.(me|sx|is)/torrents\.php.*/ 4 | // @exclude /https?://www\.empornium\.(me|sx|is)/torrents\.php\?id.*/ 5 | // @include /https?://www\.empornium\.(me|sx|is)/user\.php.*/ 6 | // @include /https?://femdomcult\.org/torrents\.php.*/ 7 | // @exclude /https?://femdomcult\.org/torrents\.php\?id.*/ 8 | // @include /https?://femdomcult\.org/user\.php.*/ 9 | // @include /https?://www\.cheggit\.me/torrents\.php.*/ 10 | // @exclude /https?://www\.cheggit\.me/torrents\.php\?id.*/ 11 | // @include /https?://www\.cheggit\.me/user\.php.*/ 12 | // @include /https?://pornbay\.org/torrents\.php.*/ 13 | // @exclude /https?://pornbay\.org/torrents\.php\?id.*/ 14 | // @include /https?://pornbay\.org/user\.php.*/ 15 | // @include /https?://(www\.)?enthralled\.me/torrents\.php.*/ 16 | // @exclude /https?://(www\.)?enthralled\.me/torrents\.php\?id.*/ 17 | // @include /https?://(www\.)?enthralled\.me/user\.php.*/ 18 | // @version 27.0 19 | // @updateURL https://github.com/colligere/collapse_duplicates/raw/master/gazelle_collapse_duplicates.user.js 20 | // @require http://code.jquery.com/jquery-2.1.1.js 21 | // @require https://raw.githubusercontent.com/jashkenas/underscore/1.8.3/underscore.js 22 | // @grant GM.setValue 23 | // @grant GM.getValue 24 | // @grant GM_setValue 25 | // @grant GM_getValue 26 | // ==/UserScript== 27 | 28 | 'use strict'; 29 | 30 | // About 31 | // This userscript groups variations (different resolution, container, ...) of the same torrent together to unclutter the torrent list. 32 | // 33 | // The original version of this script was written by node998 but hasn't been maintained in a while. I have now forked the script on github to incorporate some recent fixes and additions. 34 | 35 | // Changelog: 36 | // * version 27.0 37 | // - Added an option to collapse chronologically (you'll see the group in the newest post's location) 38 | // * version 26.2 39 | // - Added support for enthralled.me 40 | // * version 26.1 41 | // - Added PSVR variant 42 | // * version 26.0 43 | // - support for pornbay 44 | // - new option to preserve original title 45 | // * version 25.7 46 | // - improved handling of x265 47 | // * version 25.6 48 | // - settings button now shows on the .is domain 49 | // * version 25.5 50 | // - modified regexes for VR (to support occulus go) and resolutions (to support non-standard resolutions) 51 | // * version 25.4 52 | // - added empornium.is domain 53 | // * version 25.3 54 | // - support all *K resolutions 55 | // * version 25.2 56 | // - workaround for violentmonkey bug https://github.com/violentmonkey/violentmonkey/issues/713 57 | // * version 25.1 58 | // - change to download URL 59 | // * version 25 60 | // - Updates for new emp icons 61 | // * version 24.4 62 | // - Added support for new bookmark icons 63 | // * version 24.3 64 | // - Some more compatibility fixes 65 | // * version 24.2 66 | // - Fixed compatibility with direct thumbnails script (at least in vertical layout) 67 | // * version 24.1 68 | // - Disabled the new config options for engines that don't support GM functions 69 | // * version 24 70 | // - Added a configuration dialog (accessible through the user menu on emp) 71 | // - Added options to bring back the emp freeleech/warned/checked icons (off by default) 72 | // - Added horizontal stacking of versions (off by default) 73 | // - Requires 2 extra grants (GM.setValue and GM.getValue) to store settings 74 | // * version 23 75 | // - Improved handling of VR tags 76 | // * version 22 77 | // - Removed absolute positioning for freeleech & warning icons 78 | // * version 21 79 | // - Further GM4 & FF57+ fixes 80 | // - fixed: The script would get executed twice when using the browser back/forward buttons (fix by sapphreak) 81 | // * version 20 82 | // - Compatibility with greasemonkey 4.0 83 | // - Replaced GM_addStyle 84 | // - Removed jQuery.noConflict (fix by sapphreak) 85 | // * version 19 86 | // - improvement: collapse patterns are now category-specific 87 | // * version 18.4 88 | // - improvement: added ipad variation 89 | // * version 18.3 90 | // - improvement: included vive 91 | // - improvement: added @updateURL metadata 92 | // * version 18.2 93 | // - improvement: included game platforms PC and MAC 94 | // * version 18.1 95 | // - fixed: PornBay compatibility (fix by Starbuck) 96 | // * version 18 97 | // - fixed: only one torrent is visible (fix by starbuck) 98 | // - improvement: include variations mobile-high,mobile-medium and mobile-low 99 | // - improvement: included video containers 3gp and mpeg4 100 | // - change: this script is now forked on github 101 | // * version 17 102 | // - added option for freeleech icon 103 | // - added option for warning icon 104 | // * version 16 105 | // - added resolutions 240, 380, 960, 1440, 1600, 1920 106 | // - added image resolutions 1600px, 2000px, 3000px 107 | // - added variations h.265, h265, hevc, uhd 108 | // - added variations Oculus, Playstation 109 | // - added variations "lower bitrate", "higher bitrate" 110 | // - added resolution suffix * 111 | // - added support for pornbay.org 112 | // - added support for cheggit.me 113 | // * version 15 114 | // - added variation lq 115 | // - added variations 30 fps, 60 fps 116 | // - added variations Samsung, Smartphone 117 | // * version 14 118 | // - improved detection of VR variations 119 | // - added resolution 416 120 | // - added bitstream variations 1K, 2K 121 | // * version 13 122 | // - removed leading space on empty version title (without symbols) 123 | // - added comments indicator (links directly to comments section) 124 | // - simplified version title css selector 125 | // - added variation Mps 126 | // - added variation "Oculus Rift" 127 | // - added variation "Virtual Reality" 128 | // - added variations "Desktop VR", "Smartphone VR", "Gear VR", "Oculus VR" 129 | // - added variations ultrahd, hi-res 130 | // - added variations splitsceces, split-scenes, "split sceces" 131 | // * version 12 132 | // - added resolution 405 133 | // - added support for notifications page 134 | // * version 11 135 | // - added freeleech icon ∞ 136 | // - added warning icon ⚑ 137 | // - added option to add tags from collapsed duplicates 138 | // - added resolutions 272, 326, 392, 408, 450 139 | // - moved mov and wmv to video_containers group 140 | // - added variations fhd, mkv 141 | // - added variations "images", "picture set" 142 | // - extracted Group and Version from main code 143 | // - fixed and improved sorting (720p > SD) 144 | // - small changes to css 145 | // * version 10 146 | // - reworked and extracted matching algorithm to separate module with 3 specialized engines 147 | // - added precise trimmers to remove remaining delimiters (space , - / +) while collapsing 148 | // - added support for ** containers 149 | // - added support for {} containers 150 | // - added resolutions 352, 544, 558, 640, 1072 151 | // - added variations hq, uhq, sd, hd 152 | // - added variations "w images" and "with images" 153 | // - normalization for multiple spaces 154 | // - replace left delimiter with space 155 | // - improved performance 125ms -> 87ms 156 | // - less hacky solution for [MP4]s 157 | // - versions and variations are now surrounded by parenthesis [] 158 | // - small adjustment to css 159 | // - new dependency underscore.js 160 | // * version 9 161 | // - fix css for direct thumbnails (when replace_categories is off) 162 | // - added support for femdomcult.org 163 | // * version 8 164 | // - symmetric variations (before or after resolution) 165 | // - support for new variations: web-dl, mov, wmv 166 | // - fixed version title being wrapped on user pages 167 | // - more reliable delimiter 168 | // * version 7 169 | // - download icons for every resolutions 170 | // - checked by staff symbol for versions (replaces icon) 171 | // - bookmark symbol for versions (replaces icon) 172 | // - support for bitrate variation eg. [5Mbps] 173 | // - support for classic resolutions eg. [1920x1080] 174 | // * version 6 175 | // - small changes to patterns 176 | // * version 5 177 | // - small changes to patterns 178 | // * version 4 179 | // - added support for bookmarks 180 | // - fixed duplicates with the same name 181 | // - added default thumbnails on hover 182 | // * version 3 183 | // - added support for stream "[]s" variation 184 | // - added support for "H.265/HEVC" variation that appears after resolution 185 | // - greatly improved sorting for combined versions 186 | // * version 2 187 | // - now it works on user pages 188 | // * version 1 189 | // - initial version 190 | 191 | var comment_icon = [ 192 | 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAz', 193 | 'klEQVQoU43QPysEABjH8YfJv8tg8wLEaJTBrhRlUYTFcK/gJpuSN6FkvE0mqywG+Rh1y0km', 194 | 'V1d3SbjHcC7uurv0HZ7h95meEMNrn0XnXqWU7pRMdINDXz9jp6qFX7DbM7Z7MtkBD31BOrB', 195 | 'mRYTmAHBsw5ulcDsAbCtJ12FVq89MQUVqhrCj0TPfmHUmpfsQplSkupp3VWWb5lxJqWU9hB', 196 | 'Nl+8YVzFtWdOlTSg17nU+2G7XlwosPNXXp0Vg3+Nu0I89OB4MQRswMByH+Ab4BEZhLmRFDo', 197 | 'vgAAAAASUVORK5CYII=' 198 | ].join(''); 199 | 200 | var css = [ 201 | '/* hide default icons */', 202 | '.torrent .cats_col + td > span, .torrent .cats_cols + td > span {', 203 | ' display: none;', 204 | '}', 205 | '/* exception to display .newtorrent flag */', 206 | '.torrent .cats_col + td > span.newtorrent, .torrent .cats_cols + td > span.newtorrent {', 207 | ' display: initial;', 208 | ' margin-right: 0;', 209 | '}', 210 | '.torrent.collapse-hidden {', 211 | ' display: none;', 212 | '}', 213 | '.torrent .icon {', 214 | ' float: none;', 215 | ' margin-left: 0;', 216 | ' margin-top: 0;', 217 | ' margin-right: 4px;', 218 | ' vertical-align: bottom;', 219 | '}', 220 | '.torrent a[href^="/torrents.php?action=download"] {', 221 | ' margin-left: 0;', 222 | '}', 223 | '.torrent a[href^="torrents.php?action=download"] {', 224 | ' vertical-align: bottom;', 225 | '}', 226 | '.torrent .version .collapsed-title {', 227 | ' display: inline-block;', 228 | ' padding-top: 3px;', 229 | ' vertical-align: top;', 230 | '}', 231 | '.collapsed-freeleech, .collapsed_warning, .collapsed_okay, .collapsed_bookmarked {', 232 | ' margin-left: 5px !important;', 233 | ' top: 2px;', 234 | '}', 235 | '.torrent .version {', 236 | ' white-space: nowrap;', 237 | ' position: relative;', 238 | '}', 239 | '.torrent .version:first-of-type {', 240 | ' padding-top: 3px;', 241 | '}', 242 | '.torrent .version_horizontal {', 243 | ' float: left;', 244 | '}', 245 | '.torrent .version .comment {', 246 | ' background-image: url("' + comment_icon + '");', 247 | ' background-repeat: no-repeat;', 248 | ' background-position: 0 -2px;', 249 | ' padding-left: 19px;', 250 | ' margin-left: 5px;', 251 | ' text-align: right;', 252 | '}', 253 | '.torrent .version .comment_vertical {', 254 | ' position: absolute;', 255 | ' right: 0;', 256 | ' background-position: 0 1px;', 257 | '}', 258 | '.torrent .horizontal_separator {', 259 | ' float: none;', 260 | ' margin-left: 11px;', 261 | ' margin-right: 10px;', 262 | ' vertical-align: super;', 263 | ' color: #004DC0;', 264 | ' font-weight: bold;', 265 | '}', 266 | '.torrent_icon_container {', 267 | ' display: none', 268 | '}', 269 | '.version .icon_stack {', 270 | ' width: 18px;', 271 | ' height: 22px;', 272 | ' animation-play-state: paused;', 273 | '}', 274 | '.version .icon_stack:hover {', 275 | ' animation-play-state: running;', 276 | '}', 277 | '.version img {', 278 | ' vertical-align: bottom;', 279 | ' margin-right: 3px;', 280 | '}', 281 | ].join('\n'); 282 | 283 | // Replacement for GM_addStyle, which isn't available on greasemonkey > v4.0 284 | function add_css(styles, id) { 285 | var params = {'type': "text/css"}; 286 | if (id) params.id = id; 287 | var element = jQuery("