Linkfy TL NFO Links

NFO urls beginning with http become clickable

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==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);

});