Linkfy TL NFO Links

NFO urls beginning with http become clickable

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        Linkfy TL NFO Links
// @namespace   pootz10
// @description NFO urls beginning with http become clickable
// @include     /(^https?:\/\/www\.|^https?:\/\/)torrentleech\.org\/(torrent).*/
// @version     1.5
// @history     1.5 - Language added on highlight list
// @history     1.4 - fix issue where script stopped working after firefox 84.x
// @history     1.3 - highlight subtitles (não lançado na net)
// @history     1.2 - minor fix, a missing space between ' " could not change color of the link on some browsers
// @history     1.1 - update regex to detect when url has only www.
// @license     GNU
// @require     https://code.jquery.com/jquery-2.1.1.min.js
// @grant       GM_addStyle
// @run-at      document-idle
// ==/UserScript==

$('#nfo_text').each( function() {

    var re = /\(?(?:https?:\/\/|www\.)(\S+)/g;
    var link = '<a href="https://' + "$1" + ' " style="color:yellow;" target="_blank">https://' + "$1" + '</a>';

    //var reSUBs    = /(Subtitles|Subtitles.+?$|Subs[\W].+?$|SUBTITLES:?$|Language\s+:?\s?[A-Za-z]+$)/mg;
    var reSUBs    = /(Subs[\W].+?$|SUBTITLES:?$|Language\s+:?\s?[A-Za-z, ]+$|Subtitles?:?(\s|\.)+[A-Za-z, ]+$|Subtitles.+?$|Subtitles)/gm;
    var subs      = '<font' + ' style="color:lime;" >' + "$1" + '<font style="color:white;">';

    var linkify = $(this).text().replace(re, link).replace(reSUBs, subs);
    linkify = linkify.replace(/https?:\/\/https?:\/\//g, "https://");
    linkify = linkify.replace(/\/'|\/"/g, "/");
    $(this).html(linkify);

});