XVideos Filter

Filter xvideos search results based on preferences

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 or Violentmonkey 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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         XVideos Filter
// @namespace    XVideos Filter
// @version      0.1
// @description  Filter xvideos search results based on preferences
// @author       EmersonxD
// @match        https://www.xvideos.com/tags/*
// @grant        none
// ==/UserScript==

(function() {
  'use strict';

  // Define your search terms and preferences here
  var searchTerm = "conhece";
  var preferences = ["HD", "1080p", "longa"];

  // Get the search results page
  var url = `https://www.xvideos.com/tags/${searchTerm}`;
  var xhr = new XMLHttpRequest();
  xhr.open('GET', url, true);
  xhr.onload = function() {
    if (xhr.status === 200) {
      var soup = new DOMParser().parseFromString(xhr.responseText, 'text/html');
      var videos = [];
      var videoElements = soup.querySelectorAll('div.thumb');
      for (var i = 0; i < videoElements.length; i++) {
        var video = videoElements[i];
        var title = video.querySelector('a.title').textContent.trim();
        var duration = video.querySelector('span.duration').textContent.trim();
        var quality = video.querySelector('span.quality').textContent.trim();
        
        if (preferences.every(p => quality.includes(p))) {
          videos.push({ title, duration, quality });
        }
      }
      
      // Print the filtered videos
      for (var i = 0; i < videos.length; i++) {
        console.log(`Title: ${videos[i].title}, Duration: ${videos[i].duration}, Quality: ${videos[i].quality}`);
      }
    }
  };
  xhr.send();
})();