XVideos Filter

Filter xvideos search results based on preferences

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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