Tinder Deblur

Simple script using the official Tinder API to get clean photos of the users who liked you

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Tinder Deblur
// @description  Simple script using the official Tinder API to get clean photos of the users who liked you
// @author       spatch
// @version      1.0
// @license      MIT
// @namespace    https://greasyfork.org/en/scripts/517571-tinder-deblur/code
// @icon         https://www.google.com/s2/favicons?sz=64&domain=tinder.com
// @match        https://tinder.com/*
// @grant        none
// ==/UserScript==

// This async function fetches the first 10 teaser profiles from the Tinder API and unblurs them by
// setting the appropriate images as the background of the corresponding teaser elements on the page.
async function unblur() {
  const teasers = await fetch(
    "https://api.gotinder.com/v2/fast-match/teasers",
    {
      headers: {
        "X-Auth-Token": localStorage.getItem("TinderWeb/APIToken"), // Use the stored Tinder API token for authentication
        platform: "android",
      },
    }
  )
    .then((res) => res.json()) // Parse the API response as JSON
    .then((res) => res.data.results); // Extract the teaser profiles from the response

  // Select all teaser elements in the page where the unblurred images will be applied
  const teaserElements = document.querySelectorAll(
    ".Expand.enterAnimationContainer > div:nth-child(1)"
  );

  // Iterate over each teaser and apply the unblurred image as the background of the corresponding element
  teasers.forEach((teaser, index) => {
    const teaserElement = teaserElements[index];
    if (teaserElement) {
      // Set the teaser image as the background
      const teaserImage = `https://preview.gotinder.com/${teaser.user._id}/original_${teaser.user.photos[0].id}.jpeg`;
      teaserElement.style.backgroundImage = `url(${teaserImage})`;
    }
  });
}

// This function repeatedly checks if the teaser elements are present on the page.
// If they are, it calls the unblur function to unblur them. If not, it continues to recheck every 2 seconds.
function checkAndRunUnblur() {
  const teaserElements = document.querySelectorAll(
    ".Expand.enterAnimationContainer > div:nth-child(1)"
  );

  if (teaserElements.length > 0) {
    unblur(); // If teasers are found, start the unblur process
    setTimeout(checkAndRunUnblur, 2000); // Recheck after 2 seconds
  } else {
    console.log("Teasers not found, retrying in 2 seconds...");
    setTimeout(checkAndRunUnblur, 2000); // Recheck after 2 seconds
  }
}

// Start the unblur process after the page fully loads
window.addEventListener("load", checkAndRunUnblur);