// ==UserScript== // @name CS-Torrent-Assistant // @namespace http://tampermonkey.net/ // @version 1.4.11 // @description 财神审种助手 // @author Exception & 7ommy & wiiii & shun // @match *://*.cspt.top/details.php* // @match *://*.cspt.top/edit.php* // @match *://*.cspt.top/web/torrent-approval-page?torrent_id=* // @match *://*.cspt.cc/details.php* // @match *://*.cspt.cc/edit.php* // @match *://*.cspt.cc/web/torrent-approval-page?torrent_id=* // @match *://*.cspt.date/details.php* // @match *://*.cspt.date/edit.php* // @match *://*.cspt.date/web/torrent-approval-page?torrent_id=* // @icon https://cspt.top/favicon.ico // @require https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/jquery/3.5.1/jquery.min.js // @grant GM_setValue // @grant GM_getValue // @grant GM_registerMenuCommand // @grant GM_xmlhttpRequest // @license MIT // @downloadURL https://update.greasyfork.icu/scripts/536211/CS-Torrent-Assistant.user.js // @updateURL https://update.greasyfork.icu/scripts/536211/CS-Torrent-Assistant.meta.js // ==/UserScript== /* * 改自SpringSunday-Torrent-Assistant */ (function() { 'use strict'; var isWaitImgLoad = 0; // 自定义参数 var review_info_position = 2; // 错误提示信息位置:1:页面最上方,2:主标题正下方,3:主标题正上方 var fontsize = "9pt"; // 一键通过按钮的字体大小 var timeout = 200; // 弹出页内鼠标点击间隔,单位毫秒,设置越小点击越快,但是对网络要求更高 var biggerbuttonsize = "40pt"; // 放大的按钮大小 var autoback = 0; // 一键通过后返回上一页面 let biggerbutton = GM_getValue("biggerbutton"); let autoclose = GM_getValue("autoclose"); let add_link_before_img = GM_getValue("add_link_before_img"); // 获取当前页面的域名 const currentDomain = window.location.hostname; // 配置信息 const config = { base_url: `https://${currentDomain}/details.php`, base_url_dialog: `https://${currentDomain}/web/torrent-approval-page?torrent_id=`, official_tags:["csweb", "cspt"] }; // 构建正则表达式 const regexPattern = new RegExp(`^${config.base_url}`); const dialogRegexPattern = new RegExp(`^${config.base_url_dialog}`); registerMenuCommand(); // 注册脚本菜单 function registerMenuCommand() { GM_registerMenuCommand(`${ GM_getValue("biggerbutton", false) ? '✅':'❌'} 审核按钮放大`, function(){ biggerbutton = !biggerbutton; GM_setValue("biggerbutton", biggerbutton); location.reload(); }); GM_registerMenuCommand(`${ GM_getValue("autoclose", false) ? '✅':'❌'} 自动关闭页面`, function(){ autoclose = !autoclose; GM_setValue("autoclose", autoclose); location.reload(); }); GM_registerMenuCommand(`${ GM_getValue("add_link_before_img", false) ? '✅':'❌'} 打开图片链接`, function(){ add_link_before_img = !add_link_before_img; GM_setValue("add_link_before_img", add_link_before_img); location.reload(); }); } // 定义函数来判断字符串是否包含 official_tags 中的任何一个字符串 function containsOfficialTag(inputString, officialTags) { for (let tag of officialTags) { if (inputString.includes(tag)) { return true; } } return false; } const userAgent = navigator.userAgent; const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent); if (isMobile){ biggerbuttonsize = "120pt"; autoclose = 0; autoback = 1; } // var cat_constant = { // 401: '电影', // 402: '电视剧', // 403: '综艺', // 404: '纪录片', // 405: '动漫', // 406: 'MV', // 407: '体育', // 408: '音频', // 409: '其他', // 410: '短剧' // }; var categoryMapping = { 'Movie': 401, 'TV Series': 402, 'TV Shows': 403, 'Documentaries': 404, 'Anime': 405, 'MV': 406, 'Sports': 407, 'Audio': 408, 'Misc': 409, 'Music': 411, 'Software': 412, 'Game': 413, 'E-Book': 415, 'Comic': 416, 'Education': 417, 'Picture': 418, 'Playlet': 419, '电影': 401, '电视剧': 402, '综艺': 403, '纪录片': 404, '动漫': 405, '动画': 405, '体育': 407, '音频': 408, '其他': 409, '短剧': 410 }; var type_constant = { 10: 'UHD Blu-ray', 11: 'Blu-ray', 12: 'Remux', 13: 'Encode', 14: 'WEB-DL', 15: 'HDTV', 16: 'DVD', 17: 'CD', 18: 'Track', 19: 'Other' }; var encode_constant = { 6: 'H.264/AVC', 7: 'H.265/HEVC', 8: 'VC-1', 9: 'MPEG-2', 10: 'AV1', 11: 'Other' }; var audio_constant = { 8: 'ALAC', 9: 'AAC', 10: 'APE', 11: 'TrueHD Atmos', 12: 'DDP/E-AC3', 13: 'DD/AC3', 14: 'LPCM', 15: 'TrueHD', 16: 'DTS:X', 17: 'DTS-HD MA', 18: 'DTS', 19: 'M4A', 20: 'WAV', 21: 'MP3', 22: 'FLAC', 23: 'Other' }; var resolution_constant = { 5: '480p/480i', 6: '720p/720i', 7: '1080p/1080i', 8: '4K/2160p/2160i', 9: '8K/4320p/4320i', 10: 'Other' }; var area_constant = { } var group_constant = { 4: 'WiKi', 3: 'MySiLU', 1: 'HDS', 2: 'CHD', 5: 'Other', 7: 'rainweb', 6: 'rain', 8: 'Tangweb' }; const brief = $("#kdescr").text().toLowerCase(); // 获取简介 const containsIMDbLink = brief.includes("imdb.com"); // 检查内容是否包含 imdb.com 链接 const containsDoubanLink = brief.includes("douban.com"); // 检查内容是否包含 douban.com 链接 const containsTMDBLink = brief.includes("themoviedb.org"); // 检查内容是否包含 themoviedb.org 链接 var hasChildren = false; var hasComedy = false; var categoryMatch = brief.match(/类\s+别\s*([^\n]+)/); if(!categoryMatch) { categoryMatch = brief.match(/keywords\s*:\s*([^\n]+)/i); } if (categoryMatch) { // 处理关键词:去空格+转小写 const categories = categoryMatch[1].split('/').map(item => item.replace(/\s+/g, '').toLowerCase()); // 检查关键词(统一小写比较) hasComedy = categories.some(item => ['喜剧', '搞笑', 'comedy', 'funny'].includes(item) ); hasChildren = categories.some(item => ['儿童', 'animated', 'child', 'kids'].includes(item) ); console.log(categories) } // console.log(brief); var dbUrl; // 是否包含影片链接 if (containsIMDbLink || containsDoubanLink || containsTMDBLink) { dbUrl = true; // console.log("内容中包含 IMDb 或 Douban 链接"); } else { dbUrl = false; // console.log("内容中不包含 IMDb 或 Douban 链接"); } var isBriefContainsInfo = false; //是否包含Mediainfo if (brief.includes("general") && brief.includes("video") && brief.includes("audio")) { isBriefContainsInfo = true; // console.log("简介中包含Mediainfo"); } // 中文详细info if (brief.includes("概览") && brief.includes("视频") && brief.includes("音频")) { isBriefContainsInfo = true; // console.log("简介中包含Mediainfo"); } if (brief.includes("disc info") || brief.includes("disc size") || brief.includes(".release.info") || brief.includes("general information")) { isBriefContainsInfo = true; } // 杜比官种 if (brief.includes("nfo信息")) { isBriefContainsInfo = true; } // frds官种 if (brief.includes("release date") && brief.includes("source")) { isBriefContainsInfo = true; } if (brief.includes("release.name") || brief.includes("release.size")) { isBriefContainsInfo = true; } // CMCT/HDCTV官种 if ((brief.includes("文件名") || brief.includes("文件名称")) && (brief.includes("体 积")||brief.includes("体 积")||brief.includes("文件体积"))) { isBriefContainsInfo = true; } // HDChina官种 if (brief.includes("source type") || brief.includes("video bitrate")) { isBriefContainsInfo = true; } var isBriefContainsForbidReseed = false; //是否包含禁止转载 if (brief.includes("禁止转载")) { isBriefContainsForbidReseed = true; } var isBriefContainsMovieBrief = true; if (!(brief.replace(/\s/g,'').includes("片名") || brief.replace(/\s/g,'').includes("译名"))) { isBriefContainsMovieBrief = false; } var title = $('#top').text(); // 主标题 var exclusive = 0; if (title.indexOf('禁转') >= 0) { exclusive = 1; } title = title.replace(/禁转|\((已审|冻结|待定)\)|\[(免费|50%|2X免费|30%|2X 50%)\]|\(限时\d+.*\)|\[2X\]|\[(推荐|热门|经典|已审)\]/g, '').trim(); title = title.replace(/剩余时间.*/g,'').trim(); title = title.replace("(禁止)",'').trim(); console.log(title); var title_lowercase = title.toLowerCase(); console.log(title_lowercase); var officialSeed = 0; //官组种子 var godDramaSeed = 0; //驻站短剧组种子 var officialMusicSeed = 0; //官组音乐种子 var haresSeed = 0; //白兔官种 if(containsOfficialTag(title_lowercase, config.official_tags)) { officialSeed = 1; //console.log("官种"); } if(title_lowercase.includes("goddramas")) { godDramaSeed = 1; //console.log("短剧种"); } if(title_lowercase.includes("agsvmus")) { officialMusicSeed = 1; //console.log("音乐官种"); } if(title_lowercase.includes("hares")) { haresSeed = 1; //console.log("官种"); } // console.log("title_lowercase:"+title_lowercase); var title_type, title_encode, title_audio, title_resolution, title_group, title_is_complete, title_is_episode, title_x265, title_x264; // 媒介 if(title_lowercase.includes("web-dl") || title_lowercase.includes("webdl") || title_lowercase.includes("webrip") || title_lowercase.includes("web-rip")){ title_type = 14; } else if (title_lowercase.includes("remux")) { title_type = 12; } else if ((title_lowercase.includes("blu-ray") || title_lowercase.includes("bluray")) && !title_lowercase.includes("uhd") && !title_lowercase.includes("264") && !title_lowercase.includes("265")) { title_type = 11; } else if (title_lowercase.includes("encode") || title_lowercase.includes("264") || title_lowercase.includes("265")) { title_type = 13; } else if (title_lowercase.includes("hdtv")) { title_type = 15; } else if (title_lowercase.includes("uhd blu-ray") || title_lowercase.includes("uhd bluray") || title_lowercase.includes(" uhd ")) { title_type = 10; } else if (title_lowercase.includes("dvd")) { title_type = 16; } else if (title_lowercase.includes("cd")) { title_type = 17; } else if (title_lowercase.includes("track")) { title_type = 18; } else { title_type = 19; } // 视频编码 if(title_lowercase.includes("264") || title_lowercase.includes("avc")){ title_encode = 6; } else if (title_lowercase.includes("265") || title_lowercase.includes("hevc")) { title_encode = 7; } else if (title_lowercase.includes("vc") || title_lowercase.includes("vc-1")) { title_encode = 8; } else if (title_lowercase.includes("mpeg2") || title_lowercase.includes("mpeg-2")) { title_encode = 9; } else if (title_lowercase.includes("av1") || title_lowercase.includes("av-1")) { title_encode = 10; } else if (title_lowercase.includes("av1") || title_lowercase.includes("av-1")) { title_encode = 11; } //console.log("title_encode:"+title_encode); // 音频 可能有多个音频,选择与标题不一致,跳过 if (title_lowercase.includes("flac")) { title_audio = 22; } else if (title_lowercase.includes("lpcm")) { title_audio = 14; } else if (title_lowercase.includes(" ddp") || title_lowercase.includes(" dd+") || title.search(/E-?AC-?3/) != -1) { title_audio = 12; } else if (title_lowercase.includes("aac")) { title_audio = 9; } else if (title_lowercase.includes(" ac3") || title_lowercase.includes(" dd")) { title_audio = 13; } else if (title_lowercase.includes("truehd") && title_lowercase.includes("atmos")) { title_audio = 11; } else if (title_lowercase.includes("dts-hd ma") || title_lowercase.includes("dts-hdma") || title_lowercase.includes("dts-hd")) { title_audio = 17; } else if (title_lowercase.includes("dts:x") || title_lowercase.includes("dts: x") || title_lowercase.includes("dtsx") || title_lowercase.includes("dts-x")) { title_audio = 16; } else if (title_lowercase.includes("dts") && !title_lowercase.includes("dts-x")) { title_audio = 18; } else if (title_lowercase.includes("alac")) { title_audio = 8; } else if (title_lowercase.includes("ape")) { title_audio = 10; } else if (title_lowercase.includes("truehd") && !title_lowercase.includes("atmos")) { title_audio = 15; } else if (title_lowercase.includes("m4a")) { title_audio = 19; } else if (title_lowercase.includes("wav")) { title_audio = 20; } else if (title_lowercase.includes("mp3")) { title_audio = 21; } else { title_audio = 23; } // 分辨率 if(title_lowercase.includes("1080p") || title_lowercase.includes("1080i")){ title_resolution = 7; } else if (title_lowercase.includes("720p") || title_lowercase.includes("720i")) { title_resolution = 6; } else if (title_lowercase.includes("480p") || title_lowercase.includes("480i")) { title_resolution = 5; } else if (title_lowercase.includes("4k") || title_lowercase.includes("2160p") || title_lowercase.includes("2160i") || title_lowercase.includes("uhd")) { title_resolution = 8; } else if (title_lowercase.includes("8k") || title_lowercase.includes("4320p") || title_lowercase.includes("4320i")) { title_resolution = 9; } else { title_resolution = 10; } if (title_lowercase.includes("complete")) { title_is_complete = true; } // if (title_lowercase.match(/s\d+e\d+/i) || title_lowercase.match(/ep\d+/i)) { if (title_lowercase.match(/s\d+\s*e\d+/i)) { // if (title_lowercase.match(/s\d+e\d+/i)) { title_is_episode = true; // console.log("===============================当前为分集"); } if (title_lowercase.includes("x265")) { title_x265 = true; } if (title_lowercase.includes("x264")) { title_x264 = true; } // 检测标题是否包含不被信任的制作组 const keywords = [ "fgt", "hao4k", "mp4ba", "rarbg", "gpthd", "seeweb", "dreamhd", "blacktv", "xiaomi", "huawei", "momohd", "ddhdtv", "nukehd", "tagweb", "sonyhd", "minihd", "bitstv", "-alt", "rarbg", "mp4ba", "fgt", "hao4k", "batweb", "dbd-raws","xunlei", "zerotv","lelvetv" ]; function containsKeyword(text) { const lowerCaseText = text.toLowerCase(); for (let keyword of keywords) { if (lowerCaseText.includes(keyword)) { return true; } } return false; } var is_untrusted_group = false; if(containsKeyword(title_lowercase)) { is_untrusted_group = true; } var subtitle, cat, type, encode, audio, resolution, area, group, anonymous, is_complete,category; var poster; var fixtd, douban, imdb, mediainfo, mediainfo_short,mediainfo_err; var subtitle_is_episode = false; //副标题中是否包含分集 var isGroupSelected = false; //是否选择了制作组 var hasBQ = true; var isReseedProhibited = false; //是否选择了禁转标签 var isOfficialSeedLabel = false; //是否选择了官种标签 var isIceSeedLabel = false; //是否选择了官种标签 var isMediainfoEmpty = false; //Mediainfo栏内容是否为空 var isEpisode = false; //电视剧是否为分集 var isTagAudioChinese = false; //标签是否选择国语 var isTagTextChinese = false; //标签是否选择中字 var isTagTextEnglish = false; //标签是否选择英字 var isTagResident = false; //标签是否选择驻站 var isTagBigTorrent = false; //标签是否选择大包 var isTagArcProj = false; //标签是否选择方舟 var isBiggerThan1T = false; //种子体积是否大于1T var isAudioChinese = false; var isTextChinese = false; var isTextEnglish = false; var mi_x265 = false; var mi_x264 = false; var isSubtitleAnime = false; //副标题是是否包含动画 var bqByz1 = false; var bqByz2 = false; var tdlist = $('#outer').find('td'); for (var i = 0; i < tdlist.length; i ++) { var td = $(tdlist[i]); if (td.text() == '副标题' || td.text() == '副標題') { subtitle = td.parent().children().last().text(); if (subtitle.includes("动画")) { isSubtitleAnime = true; } if (subtitle.match(/第\d+集/i)) { subtitle_is_episode = true; } } if (td.text() == '添加') { var text = td.parent().children().last().text(); if (text.indexOf('匿名') >= 0) { anonymous = 1; } } if (td.text() == '标签') { var text = td.parent().children().last().text(); console.log('标签: '+text); if(text.includes("儿童") !== hasChildren){ bqByz1 = true; } if(text.includes("喜剧") !== hasComedy){ bqByz2 = true; } if(text.includes("禁转")){ isReseedProhibited = true; // console.log("已选择禁转标签"); } if(text.includes("官方") || text.includes("官种")){ isOfficialSeedLabel = true; // console.log("已选择官方标签"); } if(text.includes("冰种")){ isIceSeedLabel = true; // console.log("已选择冰种标签"); } if(text.includes("驻站")){ isTagResident = true; // console.log("已选择驻站标签"); } if(text.includes("分集")){ isEpisode = true; // console.log("已选择官方标签"); } if(text.includes("国语")){ isTagAudioChinese = true; // console.log("已选择官方标签"); } if(text.includes("中字")){ isTagTextChinese = true; // console.log("已选择官方标签"); } if(text.includes("英字")){ isTagTextEnglish = true; // console.log("已选择官方标签"); } if(text.includes("大包")){ isTagBigTorrent = true; // console.log("已选择大包标签"); } if (text.indexOf('完结') >= 0) { is_complete = true; } if (text.indexOf('方舟') >= 0) { isTagArcProj = true; } hasBQ = false; } if (td.text() == '基本信息') { var text = td.parent().children().last().text(); if(text.includes("制作组")){ isGroupSelected = true; //console.log("已选择制作组"); } if(text.includes("TB")){ isBiggerThan1T = true; //console.log("种子体积大于1T"); } // console.log(text) // 类型 // 使用公共方法来查找分类 cat = findCategory(text, categoryMapping); // console.log("cat:"+cat); // 格式 if (text.indexOf('UHD Blu-ray') >= 0) { type = 10; } else if (text.indexOf('DVD') >= 0) { type = 16; } else if (text.indexOf('Remux') >= 0) { type = 12; } else if (text.indexOf('HDTV') >= 0) { type = 15; } else if (text.indexOf('Encode') >= 0) { type = 13; } else if (text.indexOf('CD') >= 0) { type = 17; } else if (text.indexOf('WEB-DL') >= 0) { type = 14; } else if (text.indexOf('Blu-ray') >= 0) { type = 11; } else if (text.indexOf('Track') >= 0) { type = 18; } else if (text.indexOf('媒介: Other') >= 0) { type = 19; } // console.log("type:"+type); // 视频编码 if (text.indexOf('H.265/HEVC') >= 0) { encode = 7; } else if (text.indexOf('H.264/AVC') >= 0) { encode = 6; } else if (text.indexOf('VC-1') >= 0) { encode = 8; } else if (text.indexOf('MPEG-2') >= 0) { encode = 9; } else if (text.indexOf('AV1') >= 0) { encode = 10; }else if (text.indexOf('编码: Other') >= 0) { encode = 11; } // console.log("encode:"+encode); //console.log("audio:"+audio); // 音频编码 if (text.indexOf('DTS-HD MA') >= 0) { audio = 17; } else if (text.indexOf('DTS:X') >= 0) { audio = 16; } else if (text.indexOf('DTS') >= 0) { audio = 18; } else if (text.indexOf('TrueHD Atmos') >= 0) { audio = 11; } else if (text.indexOf('TrueHD') >= 0) { audio = 15; } else if (text.indexOf('LPCM') >= 0) { audio = 14; } else if (text.indexOf('DD/AC3') >= 0) { audio = 13; } else if (text.indexOf('AAC') >= 0) { audio = 9; } else if (text.indexOf('FLAC') >= 0) { audio = 22; } else if (text.indexOf('APE') >= 0) { audio = 10; } else if (text.indexOf('WAV') >= 0) { audio = 20; } else if (text.indexOf('MP3') >= 0) { audio = 21; } else if (text.indexOf('M4A') >= 0) { audio = 19; } else if (text.indexOf('DDP/E-AC3') >= 0) { audio = 12; } else if (text.indexOf('音频编码: Other') >= 0) { audio = 23; } // console.log("audio:"+audio); // 分辨率 if (text.indexOf('2160p') >= 0) { resolution = 8; } else if (text.indexOf('1080p') >= 0) { resolution = 7; } else if (text.indexOf('4320p') >= 0) { resolution = 9; } else if (text.indexOf('720p') >= 0) { resolution = 6; } else if (text.indexOf('480') >= 0) { resolution = 5; } else if (text.indexOf('分辨率: Other') >= 0) { resolution = 10; } // console.log("resolution:"+resolution); // 地区 if (text.indexOf('Mainland(大陆)') >= 0) { area = 1; } else if (text.indexOf('Hongkong(香港)') >= 0) { area = 2; } else if (text.indexOf('Taiwan(台湾)') >= 0) { area = 3; } else if (text.indexOf('West(欧美)') >= 0) { area = 4; } else if (text.indexOf('Japan(日本)') >= 0) { area = 5; } else if (text.indexOf('Korea(韩国)') >= 0) { area = 6; } else if (text.indexOf('India(印度)') >= 0) { area = 7; } else if (text.indexOf('Russia(俄国)') >= 0) { area = 8; } else if (text.indexOf('Thailand(泰国)') >= 0) { area = 9; } else if (text.indexOf('地区: Other(其他)') >= 0) { area = 99; } if (text.indexOf('GodDramas') >= 0) { category = 24; } else if (text.indexOf('AGSVPT') >= 0) { category = 6; } else if (text.indexOf('AGSVMUSIC') >= 0) { category = 20; } else if (text.indexOf('AGSVWEB') >= 0) { category = 21; } else if (text.indexOf('Hares') >= 0) { category = 23; } else if (text.indexOf('Pack') >= 0) { category = 16; } else if (text.indexOf('制作组: Other') >= 0) { category = 22; } // console.log("category:"+category) } if (td.text() == '行为') { fixtd = td.parent().children().last(); } if (td.text().trim() == '海报') { poster = $('#kposter').children().attr('src'); } /* if (td.text().trim() == "IMDb信息") { if (td.parent().last().find("a").text() == "这里"){ var fullUrl = new URL(href, window.location.origin).toString(); td.parent().find("a").attr("href",fullUrl); let href = td.parent().last().find("a").attr("href").trim(); td.parent().last().find("a").click(); } }*/ if (td.text() == "MediaInfo"){ //$(this).find("") let md = td.parent().children().last(); if(md.text()==""){ isMediainfoEmpty = true; //console.log("MediaInfo栏为空"); } //console.log(md.text()) //console.log(md.children('div').length) //console.log(md.children('table').length) if (md.children('div').length>0) { mediainfo_short = md.text().replace(/\s+/g, ''); mediainfo = md.text().replace(/\s+/g, ''); } else if (md.children('table').length>0) { mediainfo_short = md.children().children().children().eq(0).text().replace(/\s+/g, ''); mediainfo = md.children().children().children().eq(1).text().replace(/\s+/g, ''); } if ((containsBBCode(mediainfo) || containsBBCode(mediainfo_short)) && mediainfo_short === mediainfo){ mediainfo_err = "MediaInfo中含有bbcode" } // 根据 Mediainfo 判断标签选择 // console.log("===========================mediainfo:"+mediainfo); const audioMatch = mediainfo.match(/Audio.*?Language:(\w+)/); const audioLanguage = audioMatch ? audioMatch[1] : 'Not found'; // console.log(`The language of the audio is: ${audioLanguage}`); if (!audioLanguage.includes("Text") && (audioLanguage.includes("Chinese") || audioLanguage.includes("Mandarin"))){ isAudioChinese = true; } const textMatches = mediainfo.match(/Text#.*?Language:(\w+)/g) || []; //console.log("=====================textMatches:" + textMatches); const textLanguages = textMatches.map(text => { const match = text.match(/Language:(\w+)/); return match ? match[1] : 'Not found'; }); var textLanguage = textLanguages.join(',') // console.log(`The languages of the text are: ${textLanguage}`); if (textLanguage.includes("Chinese")){ //console.log("中字"); isTextChinese = true; } if (textLanguage.includes("English")){ //console.log("英字"); isTextEnglish = true; } if (mediainfo.includes("x264")){ mi_x264 = true; } if (mediainfo.includes("x265")){ mi_x265 = true; } // alert(isAudioChinese.toString() + isTextChinese.toString() + isTextEnglish.toString()); } } function containsBBCode(str) { // 创建一个正则表达式来匹配 [/b]、[/color] 等结束标签 const regex = /\[\/(b|color|i|u|img)\]/; // 使用正则表达式的 test 方法来检查字符串 return regex.test(str); } let imdbUrl = $('#kimdb a').attr("href") /* if (imdbText.indexOf('douban') >= 0) { douban = $(element).attr('title'); } */ // console.log(imdbUrl) /* if (imdbText.indexOf('imdb') >= 0) { imdb = $(element).attr('title'); } */ function checkImage(url) { return new Promise((resolve) => { const img = new Image(); img.onload = () => { // 图片加载成功,表示有效 resolve(true); }; img.onerror = () => { // 图片加载失败,表示无效 resolve(false); }; img.src = url; }); } var screenshot = ''; var pngCount = 0; var imgCount = 0; var isBriefContainsInfoImg = false; //是否包含冗余的影片参数图片 var loadedImages = 0; // 加载成功的图片数量 var failedImages = 0; // 加载失败的图片数量 $('#kdescr img').each(function(index, element) { var src = $(element).attr('src'); if(src != undefined) { if (index != 0) { screenshot += '\n'; } screenshot += src.trim(); if (src.includes("img.pterclub.com/images/2024/01/10/49401952f8353abd4246023bff8de2cc.png") || src.includes("Mediainfo.png")) { isBriefContainsInfoImg = true; } } if (src.indexOf('.png') >= 0) { pngCount++; } imgCount++; console.log("==========$(element).naturalWidth: "+$(element).naturalWidth); }); let error = false; let warning = false; switch(review_info_position) { case 1: $('#outer').prepend('