您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Search and cleaners
当前为
// ==UserScript== // @name AZNude - Video Search & UI Tweaks // @namespace brazenvoid // @version 2.0.3 // @author brazenvoid // @license GPL-3.0-only // @description Search and cleaners // @include https://www.aznude.com/* // @require https://greasyfork.org/scripts/375557-brazenvoid-s-base-resource/code/Brazenvoid's%20Base%20Resource.js?version=658367 // @run-at document-end // ==/UserScript== // Settings & Defaults let settings = { duration: { // In Seconds minimum: 30, maximum: 0, }, showUIAlways: false, // Desktop Only removeAdBoxes: true, removeRecommendations: true, removeSponsoredVideos: true, debugLogging: false, } // Base Resource Initializations const scriptPrefix = 'az-sui-' let storage = new LocalStore(scriptPrefix + 'settings', settings) settings = storage.retrieve().get() let logger = new Logger(settings.debugLogging) let selectorGenerator = new SelectorGenerator(scriptPrefix) let statistics = new StatisticsRecorder(logger, selectorGenerator) let filters = new Filters(statistics) let uiGenerator = new UIGenerator(settings.showUIAlways, selectorGenerator) let sponsoredRegex = new RegExp('azncdn', 'ig') // Local Store Events let refreshUI = function () { document.getElementById(selectorGenerator.getSettingsInputSelector('Min Duration')).value = this.get().duration.minimum } storage.onDefaultsLoaded = refreshUI storage.onRetrieval = refreshUI storage.onUpdated = refreshUI // Validators // -- Duration validation let validateDuration = function (videoItem) { let videoDuration = videoItem.querySelector('.video-time') if ((settings.duration.minimum > 0 || settings.duration.maximum > 0) && (videoDuration !== null)) { videoDuration = videoDuration.textContent.split(':') videoDuration = (parseInt(videoDuration[0]) * 60) + parseInt(videoDuration[1]) return filters.validateRange('Duration', videoDuration, [settings.duration.minimum, settings.duration.maximum]) } return true } // -- Sponsored video validation let validateSponsoredVideo = function (videoItem) { if (settings.removeSponsoredVideos) { let validationCheck = videoItem.querySelector('.show-clip').href.match(sponsoredRegex) !== null statistics.record('Sponsored', validationCheck) return validationCheck } return true } // -- Compliance logic let complianceCallback = function () { let videoItems = document.querySelectorAll('.albuma2') let videoComplies for (let videoItem of videoItems) { videoComplies = validateDuration(videoItem) && validateSponsoredVideo(videoItem) if (videoComplies) { videoItem.style.display = 'inline-block' } else { videoItem.style.display = 'none' } logger.logSeparator() } statistics.updateUI() } // UI Composition // -- Control Panel let section = uiGenerator.createSection('settings', '#ffa31a', '200px', [ uiGenerator.createSettingsFormGroup('Min Duration', settings.duration.minimum), uiGenerator.createFormButton('Apply', function () { settings.duration.minimum = document.getElementById(selectorGenerator.getSettingsInputSelector('Min Duration')).value statistics.reset() complianceCallback() statistics.updateUI() }), uiGenerator.createSeparator(), uiGenerator.createStoreUpdateButton(storage), uiGenerator.createStoreReloadButton(storage), uiGenerator.createStoreResetButton(storage), uiGenerator.createStoreDeleteButton(storage), uiGenerator.createSeparator(), uiGenerator.createStatisticsFormGroup('Duration', 'Short'), uiGenerator.createStatisticsFormGroup('Sponsored'), uiGenerator.createStatisticsFormGroup('Total'), uiGenerator.createFormButton('Hide', function () { document.getElementById(selectorGenerator.getSelector('settings')).style.display = 'none' }), ]) uiGenerator.appendToBody(section) // -- Settings Button let controlButton = uiGenerator.createSettingShowButton('Search & Tweaks', section) uiGenerator.appendToBody(controlButton) logger.logTaskCompletion('Building UI') // Remove Ad Boxes if (settings.removeAdBoxes) { let ads = document.querySelectorAll('.ad-box-video') for (const ad of ads) { ad.remove() } } // Remove Recommendations if (settings.removeRecommendations) { let recommendationSections = document.querySelectorAll('.recommended') for (const recommendationSection of recommendationSections) { recommendationSection.remove() } } // Script run complianceCallback()