From 2ba49d41ad06b888d5eee17af01e492b4278158e Mon Sep 17 00:00:00 2001 From: darkred Date: Sun, 8 Aug 2021 18:52:45 +0300 Subject: [PATCH 01/77] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 4dc9225..9f80759 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -50,6 +50,7 @@ body: attributes: label: Script Manager description: (Tampermonkey and Violentmonkey are supported - Greasemonkey is NOT supported) + placeholder: e.g. Tampermonkey 4.14 validations: required: true - type: input @@ -57,5 +58,6 @@ body: attributes: label: Browser(s) used description: (make sure it is the latest version - old versions are NOT supported) + placeholder: e.g. Chrome 92 validations: required: true From cd27ffc29fdc8f7a082ccded7c574d49432be19b Mon Sep 17 00:00:00 2001 From: darkred Date: Sat, 14 Aug 2021 13:45:13 +0300 Subject: [PATCH 02/77] Update package.json Added 'eslint-plugin-userscripts' plugin (following Tampermonkey v4.14.6142) --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index f8c5c8a..2a03a61 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "devDependencies": { "eslint": "*", "eslint-plugin-clean-regex": "*", - "eslint-plugin-regexp": "*" + "eslint-plugin-regexp": "*", + "eslint-plugin-userscripts": "*" } } From a5fe4ce5ec3dd6a83f579c95af224452694711be Mon Sep 17 00:00:00 2001 From: darkred Date: Sat, 14 Aug 2021 13:45:33 +0300 Subject: [PATCH 03/77] Update 1337x_-_torrent_and_magnet_links.user.js Simplified the script --- .../1337x_-_torrent_and_magnet_links.user.js | 84 ++++++++----------- 1 file changed, 36 insertions(+), 48 deletions(-) diff --git a/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js b/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js index d19671f..fef8516 100644 --- a/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js +++ b/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name 1337x - torrent and magnet links // @namespace darkred -// @version 2021.7.29 +// @version 2021.8.14 // @description Adds a column with torrent and magnet links in lists // @author darkred // @contributor NotNeo @@ -71,53 +71,47 @@ GM_addStyle(` function appendColumn() { - + const allTables = document.querySelectorAll('.table-list-wrap'); + const isSeries = window.location.href.includes('/series/'); const title = 'ml dl'; - let headers = document.querySelectorAll('.table-list > thead > tr:not(.blank) > th:nth-child(1)'); // the initial column 'Files' after of which the extra column will be appended - let cells = document.querySelectorAll('.table-list > tbody > tr:not(.blank) > td:nth-child(1)'); // the initial column 'Files' after of which the extra column will be appended - - for (let i = 0; i < headers.length; i++) { - headers[i].insertAdjacentHTML('afterend', `` + title + ``); // creation of the extra column - } - - for (let i = 0; i < cells.length; i++) { - cells[i].insertAdjacentHTML('afterend', `` + '' + ``); - } - - - let headersNew = document.querySelectorAll('.table-list > thead > tr:not(.blank) > th:nth-child(2)'); // the first cell (the header cell) of the new column - let cellsNew = document.querySelectorAll('.table-list > tbody > tr:not(.blank) > td:nth-child(2)'); // the rest cells of the new column tr:not(.blank) is for lists that also have empty lines e.g. https://1337x.to/series/a-to-z/1/13/ - for (let i = 0; i < headersNew.length; i++) { - headersNew[i].innerHTML = title; - headersNew[i].setAttribute('class', 'coll-1b'); - } - - for (let i = 0; i < cellsNew.length; i++) { - cellsNew[i].classList.add('coll-1b'); - cellsNew[i].classList.add('dl-buttons'); - } + allTables.forEach((table) => { + const headersCellsInitial = table.querySelectorAll(`.table-list > thead > tr:not(.blank) > th:nth-child(1), + .table-list > tbody > tr:not(.blank) > td:nth-child(1)`); + headersCellsInitial.forEach((cell, index) => { + if (index === 0 && !isSeries) { + cell.insertAdjacentHTML('afterend', `` + title + ``); + } else { + cell.insertAdjacentHTML('afterend', `` + title + ``); + } + }); + + const headersCellsNew = table.querySelectorAll(`.table-list > thead > tr:not(.blank) > th:nth-child(2), + .table-list > tbody > tr:not(.blank) > td:nth-child(2)`); + headersCellsNew.forEach((cell, index) => { + cell.classList.add('coll-1b'); + if (index === 0 && !isSeries) { + cell.innerHTML = title; + } else { + cell.classList.add('dl-buttons'); + + let href; + if (!isSeries){ + href = headersCellsInitial[index].firstElementChild.nextElementSibling.href; + } else { // e.g. https://1337x.to/series/a-to-z/1/13/ + href = headersCellsInitial[index].firstElementChild.href; + } + + cell.innerHTML = ``; + cell.innerHTML += ``; + } + }); - let newColumn = document.querySelectorAll('.table-list > tbody > tr:not(.blank) > td:nth-child(2)'); // new column - let oldColumn = document.querySelectorAll('.table-list > tbody > tr:not(.blank) > td:nth-child(1)'); // old column - - for (let i = 0; i < newColumn.length; i++) { - - let href; - if (!window.location.href.includes('/series/')){ - href = oldColumn[i].firstElementChild.nextElementSibling.href; - } else { // e.g. https://1337x.to/series/a-to-z/1/13/ - href = oldColumn[i].firstElementChild.href; - } - - newColumn[i].innerHTML = ''; - - newColumn[i].innerHTML += ''; + }); - } } @@ -140,13 +134,7 @@ function addClickListeners(links, type){ let container = document.implementation.createHTMLDocument().documentElement; container.innerHTML = xhr.responseText; - let retrievedLink; - if (type === 'ml'){ - retrievedLink = container.querySelector('a[href^="magnet:"]'); // the 'magnet link' element in the retrieved page - } else { - retrievedLink = container.querySelector('.dropdown-menu > li > a'); // the 'download link' element in the retrieved page - } - + let retrievedLink = (type === 'ml') ? container.querySelector('a[href^="magnet:"]') : container.querySelector('.dropdown-menu > li > a'); if (retrievedLink) { links[i].setAttribute('href', retrievedLink.href.replace('http:', 'https:')); // the links are http and as such are blocked in Chrome From 4ed5365182cfb41839cadb1b3098dc56d69e51c6 Mon Sep 17 00:00:00 2001 From: darkred Date: Sat, 14 Aug 2021 15:06:31 +0300 Subject: [PATCH 04/77] Update 1337x_-_torrent_and_magnet_links.user.js --- .../1337x_-_torrent_and_magnet_links.user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js b/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js index fef8516..22a2fd1 100644 --- a/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js +++ b/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js @@ -71,8 +71,8 @@ GM_addStyle(` function appendColumn() { - const allTables = document.querySelectorAll('.table-list-wrap'); - const isSeries = window.location.href.includes('/series/'); + const allTables = document.querySelectorAll('.table-list-wrap'); // for pages with multiple tables e.g. https://1337x.to/home/ + const isSeries = window.location.href.includes('/series/'); // for pages with tables that have no header e.g. https://1337x.to/series/a-to-z/1/13/ const title = 'ml dl'; @@ -100,7 +100,7 @@ function appendColumn() { let href; if (!isSeries){ href = headersCellsInitial[index].firstElementChild.nextElementSibling.href; - } else { // e.g. https://1337x.to/series/a-to-z/1/13/ + } else { href = headersCellsInitial[index].firstElementChild.href; } From 15abbde299f36729a67e43b98a2b666c17344fec Mon Sep 17 00:00:00 2001 From: darkred Date: Sun, 15 Aug 2021 02:15:48 +0300 Subject: [PATCH 05/77] Update 1337x_-_torrent_and_magnet_links.user.js --- .../1337x_-_torrent_and_magnet_links.user.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js b/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js index 22a2fd1..9f42f1b 100644 --- a/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js +++ b/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name 1337x - torrent and magnet links // @namespace darkred -// @version 2021.8.14 +// @version 2021.8.15 // @description Adds a column with torrent and magnet links in lists // @author darkred // @contributor NotNeo @@ -119,9 +119,9 @@ function appendColumn() { function addClickListeners(links, type){ - for(let i = 0; i < links.length; i++) { + links.forEach((link) => { - links[i].addEventListener('click', function(event){ + link.addEventListener('click', function(event){ let href = this.getAttribute('href'); if (href === 'javascript:void(0)') { @@ -137,8 +137,8 @@ function addClickListeners(links, type){ let retrievedLink = (type === 'ml') ? container.querySelector('a[href^="magnet:"]') : container.querySelector('.dropdown-menu > li > a'); if (retrievedLink) { - links[i].setAttribute('href', retrievedLink.href.replace('http:', 'https:')); // the links are http and as such are blocked in Chrome - links[i].click(); + link.setAttribute('href', retrievedLink.href.replace('http:', 'https:')); // the links are http and as such are blocked in Chrome + link.click(); } @@ -149,7 +149,7 @@ function addClickListeners(links, type){ }, false); - } + }); } From 5ef0e037b2e89243f8f781b6a1291afe19f0177c Mon Sep 17 00:00:00 2001 From: darkred Date: Tue, 17 Aug 2021 01:31:30 +0300 Subject: [PATCH 06/77] Improvements to the `table.table-list td.dl-buttons` CSS rule (thanks to barn852) --- .../1337x_-_torrent_and_magnet_links.user.js | 10 +++++----- 1337x_-_torrent_and_magnet_links/README.md | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js b/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js index 9f42f1b..fbc4142 100644 --- a/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js +++ b/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js @@ -1,10 +1,10 @@ // ==UserScript== // @name 1337x - torrent and magnet links // @namespace darkred -// @version 2021.8.15 +// @version 2021.8.17 // @description Adds a column with torrent and magnet links in lists // @author darkred -// @contributor NotNeo +// @contributor NotNeo, barn852 // @license MIT // @include /^https:\/\/(www\.)?1337x\.(to|st|ws|eu|se|is|gd|unblocked\.dk)((?!\/torrent)).*$/ // @grant GM_addStyle @@ -35,13 +35,13 @@ GM_addStyle(` table.table-list td.dl-buttons { border-left: 1px solid #f6f6f6; + border-right: 1px solid #c0c0c0; padding-left: 2.5px; padding-right: 2.5px; text-align: center !important; position: relative; - display: inline-block !important; - /* width: 50px; */ - width: 52px; + display: table-cell !important; /* proper height of cell on multiple row torrent name */ + width: 6%; } td.dl-buttons > a, diff --git a/1337x_-_torrent_and_magnet_links/README.md b/1337x_-_torrent_and_magnet_links/README.md index 3ff0759..826ea84 100644 --- a/1337x_-_torrent_and_magnet_links/README.md +++ b/1337x_-_torrent_and_magnet_links/README.md @@ -8,4 +8,5 @@ Notes: - initially, as its destination (`href`) a: `javascript:void(0)`, - as tooltip: "`DL/ML via XHR`". - As you click a DL/ML icon, the relevant target page will be retrieved via XHR in the background (so, after clicking an icon, it will now have the magnet link). -- Thanks to NotNeo: most of the CSS used is taken from this script https://greasyfork.org/en/scripts/373230-1337x-magnet-torrent-links-everywhere . +- Thanks to NotNeo: most of the CSS used is taken from this script https://greasyfork.org/en/scripts/373230-1337x-magnet-torrent-links-everywhere , +- and to barn852 (for [this](https://greasyfork.org/en/scripts/420754-1337x-torrent-and-magnet-links/discussions/96026) contribution).- From a3da874b90cf833f4758c97a76cd3b66df642e68 Mon Sep 17 00:00:00 2001 From: darkred Date: Tue, 17 Aug 2021 20:30:08 +0300 Subject: [PATCH 07/77] Update 1337x_-_torrent_and_magnet_links.user.js --- .../1337x_-_torrent_and_magnet_links.user.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js b/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js index fbc4142..d02aa12 100644 --- a/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js +++ b/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js @@ -10,10 +10,14 @@ // @grant GM_addStyle // @run-at document-idle // -// Thanks to NotNeo: most of the CSS used is taken from this script https://greasyfork.org/en/scripts/373230-1337x-magnet-torrent-links-everywhere . +// Thanks to: +// - NotNeo: most of the CSS used is taken from this script: https://greasyfork.org/en/scripts/373230-1337x-magnet-torrent-links-everywhere . +// - barn852 for his contribution here: https://greasyfork.org/en/scripts/420754-1337x-torrent-and-magnet-links/discussions/96026 +// +// Official mirrors list: https://1337x.to/about +// // ==/UserScript== -// Official mirrors list: https://1337x.to/about GM_addStyle(` From ba05a762d22a155026ba41aac684fe9dd38bf970 Mon Sep 17 00:00:00 2001 From: darkred Date: Mon, 23 Aug 2021 20:05:29 +0300 Subject: [PATCH 08/77] Create codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 71 +++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..e610910 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,71 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ master ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ master ] + schedule: + - cron: '23 10 * * 6' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'javascript' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] + # Learn more: + # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 From e5a869183f637e0d4150a14a70996064ccbfc1b3 Mon Sep 17 00:00:00 2001 From: darkred Date: Sat, 4 Sep 2021 19:06:17 +0300 Subject: [PATCH 09/77] Update README.md --- 1337x_-_torrent_and_magnet_links/README.md | 23 +++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/1337x_-_torrent_and_magnet_links/README.md b/1337x_-_torrent_and_magnet_links/README.md index 826ea84..899c5f6 100644 --- a/1337x_-_torrent_and_magnet_links/README.md +++ b/1337x_-_torrent_and_magnet_links/README.md @@ -1,12 +1,17 @@ -Adds a column with torrent and magnet links in 1337x lists: -![](https://i.imgur.com/S4nzRP8.jpg) +Adds a column with torrent and magnet links in 1337x lists: +![](https://i.imgur.com/goYAFQH.jpg) -Notes: +Notes: - The script generates all links via XHR: - - The DL/ML links will have: - - initially, as its destination (`href`) a: `javascript:void(0)`, - - as tooltip: "`DL/ML via XHR`". - - As you click a DL/ML icon, the relevant target page will be retrieved via XHR in the background (so, after clicking an icon, it will now have the magnet link). -- Thanks to NotNeo: most of the CSS used is taken from this script https://greasyfork.org/en/scripts/373230-1337x-magnet-torrent-links-everywhere , -- and to barn852 (for [this](https://greasyfork.org/en/scripts/420754-1337x-torrent-and-magnet-links/discussions/96026) contribution).- + - The DL/ML links will have: + - as tooltip: "`ml/dl via xhr`". + - as destination (href): + - initially: `javascript:void(0)` *(to avoid taking the user back to the top of the page, which occurred if having `#`, instead)*, + - as you click a ml/dl icon, the relevant target URL will be retrieved via XHR in the background. +- Thanks to: + - NotNeo: most of the CSS is from his [1337X - Magnet/Torrent links everywhere](https://greasyfork.org/en/scripts/373230-1337x-magnet-torrent-links-everywhere) script, + - barn852 for [this](https://greasyfork.org/en/scripts/420754-1337x-torrent-and-magnet-links/discussions/96026) contribution . +- Tampermonkey and Violentmonkey are supported - Greasemonkey is NOT supported. + +[Hosted at GitHub](https://github.com/darkred/Userscripts) From a0f51d72ac70f9a9362ad5d109bdb89f687f9239 Mon Sep 17 00:00:00 2001 From: darkred Date: Thu, 16 Sep 2021 17:10:43 +0300 Subject: [PATCH 10/77] Improve selector specificity (the "Recommended torrents" elements are one more) --- RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js b/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js index 2a24c11..19ca8a9 100644 --- a/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js +++ b/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name RARBG - various tweaks // @namespace darkred -// @version 2021.4.27 +// @version 2021.9.16 // @description Various tweaks for RARBG torrent detail pages, listings and search-by-IMDb-id pages. // @author darkred // @license MIT @@ -235,9 +235,11 @@ if (!isOnTorrentListPage) { } else { // i.e. if isOnTorrentListPage === true - var links = document.querySelectorAll('a[onmouseover~="return"]'); + // var links = document.querySelectorAll('a[onmouseover^="return"]'); + var links = document.querySelectorAll('td[valign="top"] > a[onmouseover^="return overlib"]'); // The "Recommended torrents" elements on https://rarbgproxy.org/torrents.php* . - for(let i = 0; i < 8; i++) { + // for(let i = 0; i < 9; i++) { + for(let i = 0; i < links.length; i++) { links[i].addEventListener('click', function(event){ From e3dd1760d02b0bd3d16528b48084f07dfd7f50cd Mon Sep 17 00:00:00 2001 From: darkred Date: Thu, 16 Sep 2021 17:55:47 +0300 Subject: [PATCH 11/77] Lint --- .../RARBG_-_various_tweaks.user.js | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js b/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js index 19ca8a9..47ba48f 100644 --- a/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js +++ b/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js @@ -18,7 +18,7 @@ // Automatically redirect e.g. // https://rarbgproxy.org/torrents.php?search=tt6139732 to // https://rarbgproxy.org/torrents.php?imdb=tt6139732 -if (/torrents\.php\?search=tt[0-9]+/.test(window.location.href)) { +if (/torrents\.php\?search=tt\d+/.test(window.location.href)) { // window.location.href = window.location.href.replace('?search=', '?imdb='); window.location.replace(window.location.href.replace('?search=', '?imdb=')); // Use window.location.replace(url) if you want to redirect the user in a way that the current page is forgotten by the back button, ( https://stackoverflow.com/a/3170964 ) throw 'Reloading page'; // Stop script execution @@ -66,7 +66,7 @@ if (!isOnTorrentListPage) { var ratingByUsersElement = document.querySelector('.ratingblock p'); var text = document.querySelector('.ratingblock p').innerHTML; ratingByUsersElement.title = ratingByUsersElement.innerText; - var regex = /[\s]+[\s]+([\d.]+)<\/strong>\/([\d.]+)(.*)/; + var regex = /\s+\s+([\d.]+)<\/strong>\/([\d.]+)(.*)/; var average = text.match(regex)[1] * 2; var votes = text.match(regex)[2] * 2; var rest = text.match(regex)[3]; @@ -139,7 +139,7 @@ if (!isOnTorrentListPage) { var rtTomatometerNode = $(".header2:contains('RT Tomatometer, Audience Score:')").next(); if (rtTomatometerNode.length !== 0) - $(rtTomatometerNode).html($(rtTomatometerNode).html().replace(/(.*) ([\d]+%)(.*)s ([\d]+%)/, function(m, s1, s2, s3, s4) { return s1 + ''+ s2 + '' + s3 + ''+ s4 + '' ;})); + $(rtTomatometerNode).html($(rtTomatometerNode).html().replace(/(.*) (\d+%)(.*)s (\d+%)/, function(m, s1, s2, s3, s4) { return s1 + ''+ s2 + '' + s3 + ''+ s4 + '' ;})); var rtCriticsAvgNode = $(".header2:contains('RT Critics Avg:')").next(); @@ -258,7 +258,7 @@ if (!isOnTorrentListPage) { if (retrievedLink) { let currentDomainName = window.location.hostname; - links[i].setAttribute('href', 'https://' + currentDomainName + '/torrents.php?imdb=' + retrievedLink.match(/.*(tt[0-9]*).*/)[1]); // example URL: https://rarbgproxy.org/torrents.php?imdb=tt7605074 + links[i].setAttribute('href', 'https://' + currentDomainName + '/torrents.php?imdb=' + retrievedLink.match(/(tt\d+)/)[1]); // example URL: https://rarbgproxy.org/torrents.php?imdb=tt7605074 } @@ -298,9 +298,9 @@ if (!isOnTorrentListPage) { function removePipesLinebreaks(s){ if (s) { - return s.replace(/(\ \|)/gm,',') - .replace(/(\|)/gm,',') - .replace(/(\r\n|\n|\r| |
)/gm,' '); + return s.replace(/( \|)/g,',') + .replace(/(\|)/g,',') + .replace(/(\r\n|\n|\r| |
)/g,' '); } } @@ -328,7 +328,7 @@ if (rtPlotStored === null || rtPlotStored === 'undefined') { if (isOnSearchbyIMDbIdPage) { let searchListingHeader = document.querySelector('h1.black').textContent; - const imdbIdRegex = /tt[0-9]+/; + const imdbIdRegex = /tt\d+/; let imdbId; if (imdbIdRegex.test(searchListingHeader)){ imdbId = imdbIdRegex.exec(searchListingHeader)[0]; @@ -428,23 +428,23 @@ if (isOnSearchbyIMDbIdPage) { // make bold (example URL: https://rarbgproxy.org/torrents.php?imdb=tt6146586) let imdbRefRatingElement = $("b:contains('IMDb Rating:')").parent(); - let imdbRatingBoldRegex = /(.*IMDb<\/a> Rating:<\/b> )([0-9.]+)(\/.*)/; - let rtCriticsBoldRegex = /(.*RT Critics Avg:<\/b> )([0-9.]+)(\/.*)/; - let rtTomatometerBoldRegex = /(.*RT Tomatometer:<\/b> )([\d]+%.*[\d]+%)(.*)/; + let imdbRatingBoldRegex = /(.*IMDb<\/a> Rating:<\/b> )([\d.]+)(\/.*)/; + let rtCriticsBoldRegex = /(.*RT Critics Avg:<\/b> )([\d.]+)(\/.*)/; + let rtTomatometerBoldRegex = /(.*RT Tomatometer:<\/b> )(\d+%.*\d+%)(.*)/; imdbRefRatingElement.html(makeBold(imdbRefRatingElement.html(), imdbRatingBoldRegex)); imdbRefRatingElement.html(makeBold(imdbRefRatingElement.html(), rtCriticsBoldRegex)); imdbRefRatingElement.html(makeBold(imdbRefRatingElement.html(), rtTomatometerBoldRegex)); // duration from min to h:mm - let durationRegex = /(.*Runtime:<\/b> )([\d]+)(.*)/; + let durationRegex = /(.*Runtime:<\/b> )(\d+)(.*)/; if (durationRegex.test(imdbRefRatingElement.html())){ imdbRefRatingElement.html(imdbRefRatingElement.html().replace(durationRegex, function(m, s1, s2, s3) { return s1 + minsToHoursMins(s2) + s3 ;})); } // rearrange: IMDb Summary --> IMDb Rating --> RT Tomatometer --> RT Critics Avg --> RT Critics Consensus - var rearrangeRegex = /([\s\S]+)(IMDb<\/a> Rating:.*10
)?(IMDb Summary:<\/b>.*<\/span>
)[\s]*(RT Critics Avg:.*10
)?[\s]*(RT Tomatometer:.*%<\/b>[\s]+
)?(RT Critics Consensus:.*)?/; + var rearrangeRegex = /([\s\S]+)(
IMDb<\/a> Rating:.*10
)?(IMDb Summary:<\/b>.*<\/span>
)\s*(RT Critics Avg:.*10
)?\s*(RT Tomatometer:.*%<\/b>\s+
)?(RT Critics Consensus:.*)?/; if (rearrangeRegex.test(imdbRefRatingElement.html())){ imdbRefRatingElement.html(imdbRefRatingElement.html().replace(rearrangeRegex, function(m, s1, s2, s3, s4, s5, s6) { if (!s2) s2=''; if (!s3) s3=''; if (!s4) s4=''; if (!s5) s5=''; if (!s6) s6=''; return s1 + s3 + s2 + s5 + s4 + s6 ;})); } From 1497e334f30f076fbd6c189f28461090109dc024 Mon Sep 17 00:00:00 2001 From: darkred Date: Sat, 18 Sep 2021 00:54:03 +0300 Subject: [PATCH 12/77] Separated the regex for the tweaks in search-by-IMDb-id pages, in order to make it work consistently --- .../RARBG_-_various_tweaks.user.js | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js b/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js index 47ba48f..f980902 100644 --- a/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js +++ b/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name RARBG - various tweaks // @namespace darkred -// @version 2021.9.16 +// @version 2021.9.18 // @description Various tweaks for RARBG torrent detail pages, listings and search-by-IMDb-id pages. // @author darkred // @license MIT @@ -219,8 +219,8 @@ if (!isOnTorrentListPage) { // pgRating .insertAfter(tableLastRow()); imdbLink .insertAfter(tableLastRow()); trailer .insertAfter(tableLastRow()); - imdbSummary .insertAfter(tableLastRow()); imdbRating .insertAfter(tableLastRow()); + imdbSummary .insertAfter(tableLastRow()); RTTomatometer .insertAfter(tableLastRow()); RTCriticsAvg .insertAfter(tableLastRow()); RTCriticsCons .insertAfter(tableLastRow()); @@ -442,12 +442,27 @@ if (isOnSearchbyIMDbIdPage) { imdbRefRatingElement.html(imdbRefRatingElement.html().replace(durationRegex, function(m, s1, s2, s3) { return s1 + minsToHoursMins(s2) + s3 ;})); } + imdbRefRatingElement.html(imdbRefRatingElement.html().replace('RT Tomatometer:', 'RT Tomatometer/Audience Score:')); + + let preferredPatterns = [ + /([\S\s]+
)\s+
IMDb<\/a> Rating:.*\.
)/, + /(RT Critics Avg:.*10
)/, + // /(RT Tomatometer:.*%<\/b>\s+
)/, + /(RT Tomatometer\/Audience Score:.*%<\/b>\s+
)/, + /(RT Critics Consensus:.*)/, + ]; - // rearrange: IMDb Summary --> IMDb Rating --> RT Tomatometer --> RT Critics Avg --> RT Critics Consensus - var rearrangeRegex = /([\s\S]+)(
IMDb<\/a> Rating:.*10
)?(IMDb Summary:<\/b>.*<\/span>
)\s*(RT Critics Avg:.*10
)?\s*(RT Tomatometer:.*%<\/b>\s+
)?(RT Critics Consensus:.*)?/; - if (rearrangeRegex.test(imdbRefRatingElement.html())){ - imdbRefRatingElement.html(imdbRefRatingElement.html().replace(rearrangeRegex, function(m, s1, s2, s3, s4, s5, s6) { if (!s2) s2=''; if (!s3) s3=''; if (!s4) s4=''; if (!s5) s5=''; if (!s6) s6=''; return s1 + s3 + s2 + s5 + s4 + s6 ;})); + let result = []; + + for (let i=0; i < preferredPatterns.length;i++) { + if(RegExp(preferredPatterns[i]).test(imdbRefRatingElement.html())) { + result[i] = imdbRefRatingElement.html().match(preferredPatterns[i])[1]; + } else { + result[i] = ''; + } } + imdbRefRatingElement.html(result[0] + result[1] + result[3] + result[2] + result[4]); } From dda1d160f01a7b7dcc5e92792416a9f19ab41525 Mon Sep 17 00:00:00 2001 From: darkred Date: Sat, 18 Sep 2021 02:29:14 +0300 Subject: [PATCH 13/77] Update RARBG_-_various_tweaks.user.js --- RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js b/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js index f980902..56318ce 100644 --- a/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js +++ b/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name RARBG - various tweaks // @namespace darkred -// @version 2021.9.18 +// @version 2021.9.18.1 // @description Various tweaks for RARBG torrent detail pages, listings and search-by-IMDb-id pages. // @author darkred // @license MIT @@ -445,7 +445,7 @@ if (isOnSearchbyIMDbIdPage) { imdbRefRatingElement.html(imdbRefRatingElement.html().replace('RT Tomatometer:', 'RT Tomatometer/Audience Score:')); let preferredPatterns = [ - /([\S\s]+
)\s+
IMDb<\/a> Rating:.*\.
)/, /(RT Critics Avg:.*10
)/, // /(RT Tomatometer:.*%<\/b>\s+
)/, @@ -456,7 +456,7 @@ if (isOnSearchbyIMDbIdPage) { let result = []; for (let i=0; i < preferredPatterns.length;i++) { - if(RegExp(preferredPatterns[i]).test(imdbRefRatingElement.html())) { + if (preferredPatterns[i].test(imdbRefRatingElement.html())) { result[i] = imdbRefRatingElement.html().match(preferredPatterns[i])[1]; } else { result[i] = ''; From 629f82abd0b2dad0f8ff85b252f43c776c93df01 Mon Sep 17 00:00:00 2001 From: darkred Date: Sun, 19 Sep 2021 03:15:24 +0300 Subject: [PATCH 14/77] Fix for RARBG torrent detail pages, where there is only 1 user vote cast yet e.g. https://rarbgproxy.org/torrent/xn1lke6 --- RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js b/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js index 56318ce..7429fd2 100644 --- a/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js +++ b/RARBG_-_various_tweaks/RARBG_-_various_tweaks.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name RARBG - various tweaks // @namespace darkred -// @version 2021.9.18.1 +// @version 2021.9.19 // @description Various tweaks for RARBG torrent detail pages, listings and search-by-IMDb-id pages. // @author darkred // @license MIT @@ -150,7 +150,7 @@ if (!isOnTorrentListPage) { var userRating = $(".header2:contains('Rating:')").filter(function() { return $.trim($(this).text()) === "Rating:"; }).parent(); - userRating = $("p:contains('votes cast')"); + userRating = $("p:contains('votes cast'), p:contains('vote cast')"); $(userRating).css('font-size', '11px'); $(userRating).html($(userRating).html().replace('Rating:', '')); $(userRating).replaceWith(function() { @@ -463,6 +463,7 @@ if (isOnSearchbyIMDbIdPage) { } } + // rearrange: IMDb Summary --> IMDb Rating --> RT Tomatometer --> RT Critics Avg --> RT Critics Consensus imdbRefRatingElement.html(result[0] + result[1] + result[3] + result[2] + result[4]); } From 25da7f7b03e535151b0b126f6170c3845b04b2eb Mon Sep 17 00:00:00 2001 From: darkred Date: Sun, 10 Oct 2021 03:51:15 +0300 Subject: [PATCH 15/77] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 29 +++++++++++---------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 9f80759..21b4063 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -13,30 +13,25 @@ body: id: terms attributes: label: "Please ensure:" + options: + - label: "I included in the issue title the script name I'm referring to." + required: true + - label: I performed a search of the [issue tracker](https://github.com/darkred/Userscripts/issues) and in the relevant Greasyfork [feedback page](https://greasyfork.org/en/users/2160-darkred?sort=updated) to avoid opening a duplicate issue. + required: true + - label: The bug is caused by the script itself. It doesn't happen if I disable the script, or in a fresh browser profile. + required: true + - type: checkboxes + attributes: + label: 'Include in this issue:' options: - - label: "I included in the issue title the script name I'm referring to." - required: true - - label: I performed a search of the [issue tracker](https://github.com/darkred/Userscripts/issues) and in the relevant Greasyfork [feedback page](https://greasyfork.org/en/users/2160-darkred?sort=updated) to avoid opening a duplicate issue. - required: true - - label: The bug is caused by the script itself. It doesn't happen if I disable the script, or in a fresh browser profile. - required: true + - label: Screenshots/video/gif demonstrating the bug, if it’s visual + - label: Console errors, if any - type: textarea id: the-problem attributes: label: Describe the problem and how to replicate it validations: required: true - - type: textarea - id: screenshots - attributes: - label: Screenshots/video/gif showing the issue, if it’s visual - description: Files can be dropped in this field - - type: textarea - id: logs - attributes: - label: Console errors - description: If any - render: shell - type: input id: example-url attributes: From 9ffc0dbd747ed3c74cd6e0e2ec01ee0b943d4e9b Mon Sep 17 00:00:00 2001 From: darkred Date: Sun, 10 Oct 2021 03:52:37 +0300 Subject: [PATCH 16/77] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 21b4063..eaba567 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -13,13 +13,13 @@ body: id: terms attributes: label: "Please ensure:" - options: - - label: "I included in the issue title the script name I'm referring to." - required: true - - label: I performed a search of the [issue tracker](https://github.com/darkred/Userscripts/issues) and in the relevant Greasyfork [feedback page](https://greasyfork.org/en/users/2160-darkred?sort=updated) to avoid opening a duplicate issue. - required: true - - label: The bug is caused by the script itself. It doesn't happen if I disable the script, or in a fresh browser profile. - required: true + options: + - label: "I included in the issue title the script name I'm referring to." + required: true + - label: I performed a search of the [issue tracker](https://github.com/darkred/Userscripts/issues) and in the relevant Greasyfork [feedback page](https://greasyfork.org/en/users/2160-darkred?sort=updated) to avoid opening a duplicate issue. + required: true + - label: The bug is caused by the script itself. It doesn't happen if I disable the script, or in a fresh browser profile. + required: true - type: checkboxes attributes: label: 'Include in this issue:' From 1bc70f3bf75e620b9bfbe4c28cfc7974b56bbab8 Mon Sep 17 00:00:00 2001 From: darkred Date: Wed, 13 Oct 2021 03:24:12 +0300 Subject: [PATCH 17/77] Update RARBG_-_torrent_and_magnet_links.user.js --- .../RARBG_-_torrent_and_magnet_links.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RARBG_-_torrent_and_magnet_links/RARBG_-_torrent_and_magnet_links.user.js b/RARBG_-_torrent_and_magnet_links/RARBG_-_torrent_and_magnet_links.user.js index 525ed7d..d08018a 100644 --- a/RARBG_-_torrent_and_magnet_links/RARBG_-_torrent_and_magnet_links.user.js +++ b/RARBG_-_torrent_and_magnet_links/RARBG_-_torrent_and_magnet_links.user.js @@ -2,7 +2,7 @@ // @name RARBG - torrent and magnet links // @namespace darkred // @version 2021.7.3 -// @description Adds a column with torrent and magnet links in RARBG lists +// @description Adds a column with torrent and magnet links in lists // @author darkred // @contributor sxe, dandyclubs, lx19990999 // @license MIT From aa9f7ed4adb72245eab9d13f377aac733da19d38 Mon Sep 17 00:00:00 2001 From: darkred Date: Wed, 27 Oct 2021 00:28:50 +0300 Subject: [PATCH 18/77] Create .eslintignore --- .eslintignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..db181dd --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +**/*.min.js From 4759e25cd3ade8be7ad72ff8a7c6ca74e2a000d2 Mon Sep 17 00:00:00 2001 From: darkred Date: Wed, 27 Oct 2021 00:31:11 +0300 Subject: [PATCH 19/77] Added 'no-jquery' eslint plugin --- .eslintrc.js | 11 ++++++++--- package.json | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index c233581..8d36bd9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -12,13 +12,18 @@ module.exports = { // "eslint:all", "eslint:recommended", // "plugin:clean-regex/recommended" - // "plugin:regexp/all" - "plugin:regexp/recommended" + "plugin:no-jquery/deprecated", + // "plugin:no-jquery/recommended", + // "plugin:no-jquery/slim", + // "plugin:no-jquery/all", + // "plugin:regexp/all", + "plugin:regexp/recommended", ], "plugins": [ // "clean-regex" - "regexp" + "regexp", + "no-jquery", ], "parserOptions": { // "ecmaVersion": 12, diff --git a/package.json b/package.json index 2a03a61..ff83b77 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "devDependencies": { "eslint": "*", - "eslint-plugin-clean-regex": "*", + "eslint-plugin-no-jquery": "*", "eslint-plugin-regexp": "*", "eslint-plugin-userscripts": "*" } From 31cc6d82b24b3c03a3439b564b1f95c433d8dff3 Mon Sep 17 00:00:00 2001 From: darkred Date: Mon, 8 Nov 2021 17:28:22 +0200 Subject: [PATCH 20/77] Timezone change due to DST --- ..._-_convert_torrent_timestamps_to_relative_format.user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RARBG_-_convert_torrent_timestamps_to_relative_format/RARBG_-_convert_torrent_timestamps_to_relative_format.user.js b/RARBG_-_convert_torrent_timestamps_to_relative_format/RARBG_-_convert_torrent_timestamps_to_relative_format.user.js index e2ebefa..6cf42f2 100644 --- a/RARBG_-_convert_torrent_timestamps_to_relative_format/RARBG_-_convert_torrent_timestamps_to_relative_format.user.js +++ b/RARBG_-_convert_torrent_timestamps_to_relative_format/RARBG_-_convert_torrent_timestamps_to_relative_format.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name RARBG - convert torrent timestamps to relative format // @namespace darkred -// @version 2021.7.3 +// @version 2021.11.8 // @description Converts torrent upload timestamps to relative format // @author darkred // @license MIT @@ -23,8 +23,8 @@ // This is no typo: // const serverTimezone = 'Etc/GMT+2'; // -02:00 -02:00 (=no DST) -const serverTimezone = 'Etc/GMT-2'; // +02:00 +02:00 (=no DST) -// const serverTimezone = 'Etc/GMT-1'; // +01:00 +01:00 (=no DST) +// const serverTimezone = 'Etc/GMT-2'; // +02:00 +02:00 (=no DST) +const serverTimezone = 'Etc/GMT-1'; // +01:00 +01:00 (=no DST) const localTimezone = moment.tz.guess(); // In my case ----> +02:00 +03:00 (DST) From d1e29697199bcc9c4c3439aa94167fbcf3b7cb87 Mon Sep 17 00:00:00 2001 From: darkred Date: Tue, 9 Nov 2021 00:02:10 +0200 Subject: [PATCH 21/77] Use the timezone from the page footer timestamp text --- ...vert_torrent_timestamps_to_relative_format.user.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/RARBG_-_convert_torrent_timestamps_to_relative_format/RARBG_-_convert_torrent_timestamps_to_relative_format.user.js b/RARBG_-_convert_torrent_timestamps_to_relative_format/RARBG_-_convert_torrent_timestamps_to_relative_format.user.js index 6cf42f2..2dfb259 100644 --- a/RARBG_-_convert_torrent_timestamps_to_relative_format/RARBG_-_convert_torrent_timestamps_to_relative_format.user.js +++ b/RARBG_-_convert_torrent_timestamps_to_relative_format/RARBG_-_convert_torrent_timestamps_to_relative_format.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name RARBG - convert torrent timestamps to relative format // @namespace darkred -// @version 2021.11.8 +// @version 2021.11.9 // @description Converts torrent upload timestamps to relative format // @author darkred // @license MIT @@ -17,14 +17,19 @@ /* global moment */ -// Based on the timestamp on the footer of each RARBG page --> "Sat, 01 May 2020 20:14:56 +0200", -// the script takes that the server time is GMT+2 and that it doesn't take DST. +// Based on the timestamp on the footer of each RARBG page --> "Sat, 01 May 2020 20:14:56 +0200", the script takes that the server time is GMT+2 and that it doesn't take DST. +// Otherwise, when it's e.g. --> "Mon, 08 Nov 2021 21:26:11 +0100", it takes that the server time is GMT+1 and that it doesn't take DST. // Also, the script uses the 'moment-timezone' library as it takes DST offsets into account when converting the timestamps to user/local timezone. +/* // This is no typo: // const serverTimezone = 'Etc/GMT+2'; // -02:00 -02:00 (=no DST) // const serverTimezone = 'Etc/GMT-2'; // +02:00 +02:00 (=no DST) const serverTimezone = 'Etc/GMT-1'; // +01:00 +01:00 (=no DST) +*/ +let serverTimezone; +$('div:contains("SUPPORT :")').contents().last().text().trim().slice(-5) === '+0200' ? serverTimezone = 'Etc/GMT-2' : serverTimezone = 'Etc/GMT-1'; + const localTimezone = moment.tz.guess(); // In my case ----> +02:00 +03:00 (DST) From b1c6e9a6dbc32c2abd9513a4a3b383a7823aebd7 Mon Sep 17 00:00:00 2001 From: darkred Date: Fri, 19 Nov 2021 23:55:27 +0200 Subject: [PATCH 22/77] Create lint.yml Create main.yml Update lint.yml --- .github/workflows/lint.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..4a3779f --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,29 @@ +# from https://github.com/tophf/mpiv/blob/master/.github/workflows/lint.yml +# and https://github.com/stefanoeb/eslint-action/blob/master/README.md + +name: ESLint + +on: + push: + branches: [ master ] + paths-ignore: + - '.github/**' # this yml is also excluded so you need to re-run it explicitly if necessary + - .editorconfig + - LICENSE + - README.md + pull_request: + branches: [ master ] + paths-ignore: + - '.github/**' # this yml is also excluded so you need to re-run it explicitly if necessary + - .editorconfig + - LICENSE + - README.md +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install modules + run: npm install + - name: Run ESLint + run: eslint . --ext .js From 69d8d146a6c19d2af53f2686b946ac69c2131016 Mon Sep 17 00:00:00 2001 From: darkred Date: Fri, 26 Nov 2021 23:59:27 +0200 Subject: [PATCH 23/77] Update .eslintrc.js --- .eslintrc.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 8d36bd9..d81d25f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -9,19 +9,19 @@ module.exports = { // "extends": "eslint:all", // "extends": "eslint:recommended", "extends": [ - // "eslint:all", "eslint:recommended", - // "plugin:clean-regex/recommended" - "plugin:no-jquery/deprecated", + // "eslint:all", // "plugin:no-jquery/recommended", + "plugin:no-jquery/deprecated", // "plugin:no-jquery/slim", // "plugin:no-jquery/all", - // "plugin:regexp/all", + // "plugin:clean-regex/recommended" "plugin:regexp/recommended", + // "plugin:regexp/all", ], "plugins": [ - // "clean-regex" + // "clean-regex", "regexp", "no-jquery", ], From b019d5113b5ad54bc950f973df6c740edb299560 Mon Sep 17 00:00:00 2001 From: darkred Date: Sat, 27 Nov 2021 00:24:21 +0200 Subject: [PATCH 24/77] Update lint.yml --- .github/workflows/lint.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4a3779f..45705e4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,7 +3,7 @@ name: ESLint -on: +on: push: branches: [ master ] paths-ignore: @@ -18,6 +18,8 @@ on: - .editorconfig - LICENSE - README.md + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: jobs: lint: runs-on: ubuntu-latest @@ -26,4 +28,4 @@ jobs: - name: Install modules run: npm install - name: Run ESLint - run: eslint . --ext .js + run: npx eslint . --ext .user.js From 4568f5860389978cdb79c2f8bcf33c89d014c5d1 Mon Sep 17 00:00:00 2001 From: darkred Date: Mon, 13 Dec 2021 01:50:39 +0200 Subject: [PATCH 25/77] Update Instagram_-_visible_images_counter.user.js Updated most selectors after recent changes in Instagram HTML --- .../Instagram_-_visible_images_counter.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js index 8eac977..653d9fc 100644 --- a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js +++ b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Instagram - visible images counter // @namespace darkred -// @version 2021.4.12 +// @version 2021.12.13 // @description Shows in instagram profile pages how many images out of total (as a number and as a percentage) are currently visible, as you scroll down the page. // @author darkred // @license MIT @@ -40,8 +40,8 @@ var total; function showCounter() { // var totalString = $(`span:contains('posts'):last-child > span, .g47SY`).html(); // The 'total' value (it's a string). The ".g47SY" selector is for localized pages, e.g. https://www.instagram.com/instagram/?hl=de - var totalString = document.querySelector(`#react-root > section > main > div > header > section > ul > li:nth-child(1) > span > span, - #react-root > section > main > div > header > section > ul > li:nth-child(1) > a > span`).textContent; // The 'total' value (it's a string). The ".g47SY" selector is for localized pages, e.g. https://www.instagram.com/instagram/?hl=de + var totalString = document.querySelector(`#react-root > div > div > section > main > div > header > section > ul > li:nth-child(1) > span > span, + #react-root > div > div > section > main > div > header > section > ul > li:nth-child(1) > a > span`).textContent; // The 'total' value (it's a string). The ".g47SY" selector is for localized pages, e.g. https://www.instagram.com/instagram/?hl=de total = totalString.replace(',', '').replace('.', ''); // strip the thousand comma/dot seperator @@ -125,7 +125,7 @@ var observer; // var avatarSelector = 'h1.rhpdm'; // the profile name element // var avatarSelector = 'span.-nal3'; // the 'posts' count element, e.g. 683 posts // var avatarSelector = 'ul.k9GMp'; // the profile's 3 counters container element -var avatarSelector = '.nZSzR'; // the profile's username container element +var avatarSelector = '.eC4Dz'; // the profile's username container element // var avatarSelector = 'main > article > header > section > div._ienqf > div > button'; // the 3-dots icon // var avatarSelector = 'div[style="flex-direction: column; padding-bottom: 0px; padding-top: 0px;"]'; // the 3-dots icon From d82413b9c1ae10578853521666d58e952f3ca892 Mon Sep 17 00:00:00 2001 From: darkred Date: Sat, 18 Dec 2021 20:26:34 +0200 Subject: [PATCH 26/77] Update Instagram_-_visible_images_counter.user.js Restored a previous selector after recent changes in Instagram HTML --- .../Instagram_-_visible_images_counter.user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js index 653d9fc..0036b50 100644 --- a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js +++ b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Instagram - visible images counter // @namespace darkred -// @version 2021.12.13 +// @version 2021.12.18 // @description Shows in instagram profile pages how many images out of total (as a number and as a percentage) are currently visible, as you scroll down the page. // @author darkred // @license MIT @@ -40,8 +40,8 @@ var total; function showCounter() { // var totalString = $(`span:contains('posts'):last-child > span, .g47SY`).html(); // The 'total' value (it's a string). The ".g47SY" selector is for localized pages, e.g. https://www.instagram.com/instagram/?hl=de - var totalString = document.querySelector(`#react-root > div > div > section > main > div > header > section > ul > li:nth-child(1) > span > span, - #react-root > div > div > section > main > div > header > section > ul > li:nth-child(1) > a > span`).textContent; // The 'total' value (it's a string). The ".g47SY" selector is for localized pages, e.g. https://www.instagram.com/instagram/?hl=de + var totalString = document.querySelector(`#react-root > section > main > div > header > section > ul > li:nth-child(1) > span > span, + #react-root > section > main > div > header > section > ul > li:nth-child(1) > a > span`).textContent; // The 'total' value (it's a string). The ".g47SY" selector is for localized pages, e.g. https://www.instagram.com/instagram/?hl=de total = totalString.replace(',', '').replace('.', ''); // strip the thousand comma/dot seperator From 113651ee6c948d4f58d0ea3258bd9387ddd72258 Mon Sep 17 00:00:00 2001 From: darkred Date: Thu, 6 Jan 2022 18:27:09 +0200 Subject: [PATCH 27/77] Update Markdown_toolbar_for_redditcom.user.js Closes #45 --- .../Markdown_toolbar_for_redditcom.user.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Markdown_toolbar_for_reddit.com/Markdown_toolbar_for_redditcom.user.js b/Markdown_toolbar_for_reddit.com/Markdown_toolbar_for_redditcom.user.js index 3801e94..4d9a6ef 100644 --- a/Markdown_toolbar_for_reddit.com/Markdown_toolbar_for_redditcom.user.js +++ b/Markdown_toolbar_for_reddit.com/Markdown_toolbar_for_redditcom.user.js @@ -1,12 +1,14 @@ // ==UserScript== // @name Markdown toolbar for reddit.com // @namespace darkred -// @version 1.3 +// @version 1.4.1 // @description Creates a Markdown toolbar whenever you make/edit text posts or comments in reddit.com // @author wOxxOm, darkred // @license MIT // @include https://www.reddit.com/*submit* +// @include https://old.reddit.com/*submit* // @include https://www.reddit.com/*comments* +// @include https://old.reddit.com/*comments* // @grant GM_addStyle // @icon https://raw.githubusercontent.com/dcurtis/markdown-mark/master/png/66x40-solid.png // @@ -30,7 +32,7 @@ else { var textareas = document.querySelectorAll('textarea'); // ADD TOOLBAR: TO EDITING YOUR POST, TO 'NEW COMMENT' FORM AND TO EDITING YOUR EXISTING COMMENT(S) - for (var i = 0; i < textareas.length - 2; i++) { + for (var i = 0; i < textareas.length; i++) { x = document.querySelectorAll('textarea') [i].parentNode; addFeatures(x); } From c1db0e320107601657c2a5e5da4f9b2f2eb5661f Mon Sep 17 00:00:00 2001 From: darkred Date: Thu, 6 Jan 2022 19:42:47 +0200 Subject: [PATCH 28/77] Removed unused var --- .../1337x_-_torrent_and_magnet_links.user.js | 2 +- ..._timestamps_and_add_link_to_the_FB_comments_area.user.js | 6 ++++-- .../Instagram_-_visible_images_counter.user.js | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js b/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js index d02aa12..a6244e8 100644 --- a/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js +++ b/1337x_-_torrent_and_magnet_links/1337x_-_torrent_and_magnet_links.user.js @@ -125,7 +125,7 @@ function addClickListeners(links, type){ links.forEach((link) => { - link.addEventListener('click', function(event){ + link.addEventListener('click', function(){ let href = this.getAttribute('href'); if (href === 'javascript:void(0)') { diff --git a/Blabbermouth_-_generate_timestamps_and_add_link_to_the_FB_comments_area/Blabbermouth_-_generate_timestamps_and_add_link_to_the_FB_comments_area.user.js b/Blabbermouth_-_generate_timestamps_and_add_link_to_the_FB_comments_area/Blabbermouth_-_generate_timestamps_and_add_link_to_the_FB_comments_area.user.js index 357a4aa..5afeca5 100644 --- a/Blabbermouth_-_generate_timestamps_and_add_link_to_the_FB_comments_area/Blabbermouth_-_generate_timestamps_and_add_link_to_the_FB_comments_area.user.js +++ b/Blabbermouth_-_generate_timestamps_and_add_link_to_the_FB_comments_area/Blabbermouth_-_generate_timestamps_and_add_link_to_the_FB_comments_area.user.js @@ -17,6 +17,8 @@ /* global moment */ +/* eslint-disable no-console */ + 'use strict'; @@ -75,7 +77,7 @@ if ( threshold: 0 }; - let callback = (entries, observer) => { + let callback = (entries) => { entries.forEach(entry => { if (!entry.target.classList.contains('done')){ @@ -124,7 +126,7 @@ if ( const targetNode2 = document.querySelector('.infinite_scroll'); const config2 = { attributes: false, childList: true, subtree: false }; - const callback2 = function(mutationsList, observer2) { + const callback2 = function(mutationsList) { for(const mutation of mutationsList) { if (mutation.type === 'childList') { var allTimestamps = document.querySelectorAll('span.date-time'); diff --git a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js index 0036b50..7929161 100644 --- a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js +++ b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js @@ -12,6 +12,7 @@ // @supportURL https://github.com/darkred/Userscripts/issues // ==/UserScript== +/* eslint-disable no-console */ var stylesheet = `