Last active
April 8, 2026 11:33
-
-
Save bre7/99be2fe91cc52c93fd0388f0640beffc to your computer and use it in GitHub Desktop.
MyEpisodes.com torrent finder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name MyEpisodes torrent finder | |
| // @version 1.4.1 | |
| // @author You | |
| // @match https://www.myepisodes.com/views.php* | |
| // @match https://www.myepisodes.com/quickcheck/ | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=www.myepisodes.com | |
| // @grant GM_addStyle | |
| // @updateURL https://gist.githubusercontent.com/bre7/99be2fe91cc52c93fd0388f0640beffc/raw | |
| // ==/UserScript== | |
| function addStyles() { | |
| GM_addStyle('.links { width:15%; text-align: center; }'); | |
| } | |
| function TPBLink(showName, showSeason, showEpisode) { | |
| return `https://thepiratebay.org/search/${showName}%20s${showSeason}e${showEpisode}%201080p%20x265/0/99/0` | |
| } | |
| function icon(className) { | |
| return `<div class="torrentIcon ${className}"></div>` | |
| } | |
| function RARBGLink(showName, showSeason, showEpisode) { | |
| return `https://rarbg.to/torrents.php?search=${showName.replaceAll("'", "")} s${showSeason}e${showEpisode}` | |
| } | |
| function x1377Link(showName, showSeason, showEpisode) { | |
| return `https://www.1377x.to/sort-search/${showName.replaceAll("'", "")} s${showSeason}e${showEpisode}/time/desc/1/` | |
| } | |
| function magnetDlLink(showName, showSeason, showEpisode) { | |
| return `https://www.magnetdl.com/i/${showName.replaceAll("'", "")} s${showSeason}e${showEpisode}/`.replaceAll(" ", "-").toLowerCase() | |
| } | |
| function megaLink(showName, showSeason, showEpisode) { | |
| return `https://www.reddit.com/r/megalinks/search?q=${showName.replaceAll("'", "")} s${showSeason}e${showEpisode}&restrict_sr=on&sort=new&t=all` | |
| } | |
| function addTorrentLinks() { | |
| const table = document.querySelector(`#myepisodes_views table.mylist`) | |
| const showNameHeader = table.querySelector(`tbody tr.header:nth-child(1) th:nth-child(3)`) | |
| let newHeader = showNameHeader.cloneNode(true) | |
| newHeader.textContent = `Torrent` | |
| showNameHeader.insertAdjacentElement(`afterend`, newHeader) | |
| table.querySelectorAll(`th.headershowname`).forEach((el, i) => { | |
| el.colSpan = el.colSpan + 1 | |
| }) | |
| table.querySelectorAll(`td.showname`).forEach((el, i) => { | |
| const searchLinks = (() => { | |
| if ( el.parentNode.classList.contains('past') || el.parentNode.classList.contains('today') ) { | |
| const showname = el.querySelector('a').textContent.normalize('NFKD').replace(/[\u0300-\u036f]/g, "")//.replace(/[^\w]/g, '') | |
| const seasonEpNumber = el.parentNode.querySelector('td.longnumber').textContent.split('x') | |
| const ssnnum = seasonEpNumber[0] | |
| const epnum = seasonEpNumber[1] | |
| return `<td class="links"><a href="${TPBLink(showname, ssnnum, epnum)}">tpb</a> | <a href="${x1377Link(showname, ssnnum, epnum)}">1377x</a> | <a href="${magnetDlLink(showname, ssnnum, epnum)}">magnetDL</a></td>` | |
| } else if (window.location.pathname === `/quickcheck/`) { | |
| const showname = el.querySelector('a').textContent.normalize('NFKD').replace(/[\u0300-\u036f]/g, "")//.replace(/[^\w]/g, '') | |
| const seasonEpNumber = el.parentNode.querySelector('td.longnumber').textContent.split('x') | |
| const ssnnum = seasonEpNumber[0] | |
| const epnum = seasonEpNumber[1] | |
| return `<td class="links"><a href="${TPBLink(showname, ssnnum, epnum)}">tpb</a> | <a href="${x1377Link(showname, ssnnum, epnum)}">1377x</a> | <a href="${magnetDlLink(showname, ssnnum, epnum)}">magnetDL</a></td>` | |
| } else { | |
| return `<td class="links"></td>` | |
| } | |
| })() | |
| el.insertAdjacentHTML(`afterend`, searchLinks) | |
| }) | |
| } | |
| function ready(fn) { | |
| if (document.readyState != 'loading'){ | |
| fn(); | |
| } else { | |
| document.addEventListener('DOMContentLoaded', fn); | |
| } | |
| } | |
| ready( () => { | |
| addStyles(); | |
| setTimeout(addTorrentLinks, 2_000); | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment