GP Captcha Sover

Save time

目前為 2023-03-14 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        GP Captcha Sover
// @namespace   GP Captcha Sover
// @version     0.4
// @description Save time
// @author      vikiweb
// @match       *://*/*
// @license     MIT
// ==/UserScript==

(function () {
    'use strict';

    if(document.querySelector('#gpcaptcha')){

        const captchaImgs = document.querySelectorAll('#gpcaptcha .svg-padding');
        const hashes = [
            {"key": "M512 176.001C512 273.203"},
            {"flag": "M349.565 98.783C295.978"},
            {"heart": "M414.9 24C361.8 24 312"},
            {"car": "M499.991 168h-54.815l-7.854-20"},
            {"plane": "M472 200H360.211L256.013"},
            {"house" :"M488 312.7V456c0 13.3-10.7"},
            {"cup":"M192 384h192c53 0 96-43"},
            {"tree" : "M377.33 375.429L293.906"},
            {"star" : "M259.3 17.8L194 150.2 47.9"},
            {"truck":"M624 352h-16V243.9c0-12.7-5"}
        ]

        const selectedText = document.querySelector('#gpcaptcha p .text-capitalize').innerText;
        const checkHash = hashes.find(hash => Object.keys(hash)[0] === selectedText);
        const flagValue = checkHash ? Object.values(checkHash)[0] : null;

        function checkImages() {
            Array.from(captchaImgs).forEach((img, i) => {
                const svg = img.querySelector('svg path').getAttribute('d');
                if (svg.startsWith(flagValue)) {
                    img.click()
                    console.log('Matched');
                }else{
                    console.log('Doesnt match');
                }
            });
        }

        setInterval(function(){
            checkImages();
        },10000)
    }

})();