Giter Club home page Giter Club logo

captchasolver's People

Contributors

cracker0dks avatar dependabot[bot] avatar hvc3000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

captchasolver's Issues

Linux Version not working

Hi,

I got twice Ubuntu Desktop and Ubuntu Server (both 20.04) running.

I tried to setup the CaptchaSolver for both systems, but JD does not work with the solver.

Darknet compiled and working correctly with sample image, npm installed, scripts tried.
If I download sth from k2s, the popup always shows up for manual input.

I put the offlineSolver with darknet in it to 'tools' and k2s_linux to the methods folder, but nothing is working. A common issue at linux?

Doesn't work...

I'm aware that this site section of the site is probably considered "serious", but I have no other means of contacting you. Sorry if that's a problem.

The solver doesn't work. JD2 gets stuck in an infinite loop of "starting..." -> "captcha recognition" and that's it. Tested with Fileboom, Tezfiles and Filejoker. Tried test.bat and it didn't show any errors.

I'm using the latest versions of both your solver and JD2 on Win10. I updated to 2.0.5 a few days ago because the old version (don't know which one that was, unfortunately) stopped working a few weeks ago. Even then it only worked with Fileboom and Tezfiles, but not Filejoker.

I'd be grateful if you could help me out. Your work is very much appreciated!

Complete the startup instructions

It is not clear from the current instructions what steps to take to get a minimally working example. I tried to install it on Windows, but at the step restart JD2 and start downloading I don't understand what to do.

  • What is JD2?
  • How can I restart it if I didn't start it?
  • What do I need to download additionally?

Synology : work manually but not inside jdownloader

Hi,
I'm currently running jdowloader with docker on a Synology NAS, and I can't make the solver work. Thanks to some closed issues here, I think I avoided common problems like nodejs or file permissions.

Whenever jdownloader tries to solve a captcha, it fails and in the logs, it's said that ./darknet wasn't found. But if I run the solver with the terminal (and I can confirm viewing input.gif that the captcha was succesfully pulled from jd), there is absolutely no problem.

The execution through ssh is with the same user than the one used for the jd container, and I even tried with root without success. I also tried to give the container a new volume with direct access to darnek64 directory, but it didn't work either (was thinking maybe "cd darknet64" in the code wasn't working as intended).

I don't know what to try now, and I would gladly take any ideas you could have.
Have a nice day.

logs :

Running -> keep2share.cc
keep2share.cc
/bin/sh: ./darknet: not found
node:child_process:935
    throw err;
    ^

Error: Command failed: cd darknet64 && ./darknet detector test data/obj.data yolov4-tiny-custom.cfg yolov4-tiny-custom_last.weights -dont_show temp.jpg
/bin/sh: ./darknet: not found

    at checkExecSyncError (node:child_process:861:11)
    at execSync (node:child_process:932:15)
    at Timeout._onTimeout (/config/tools/offlineCaptchaSolver/ocr.js:72:30)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7) {
  status: 127,
  signal: null,
  output: [
    null,
    Buffer(0) [Uint8Array] [],
    Buffer(30) [Uint8Array] [
       47,  98, 105, 110,  47, 115, 104,
       58,  32,  46,  47, 100,  97, 114,
      107, 110, 101, 116,  58,  32, 110,
      111, 116,  32, 102, 111, 117, 110,
      100,  10
    ]
  ],
  pid: 833,
  stdout: Buffer(0) [Uint8Array] [],
  stderr: Buffer(30) [Uint8Array] [
     47,  98, 105, 110,  47, 115, 104,
     58,  32,  46,  47, 100,  97, 114,
    107, 110, 101, 116,  58,  32, 110,
    111, 116,  32, 102, 111, 117, 110,
    100,  10
  ]
}

Add "dfiles.eu" and "fboom.me" to jacinfo.xml

Hello,

the keep2share method is also valid for "dfiles.eu" and "fboom.me".

Could you please add these two services ("dfiles.eu" and "fboom.me") to the jacinfo.xml files located in the JDownloader 2.0/jd/captcha/methods/keep2share_* folders?

Thank you!

I'm having a hell of a time trying to install this on Mac

Not sure what I'm doing wrong. I believe I'm following every instruction. Granted I am a total newbie at this but I'm finding it very frustrating lol

My node.js is 14.15.5 according to node -v
when i follow that up with echo $PATH I get
Screen Shot 2021-02-11 at 1 33 14 AM

I compiled darknet according to this tutorial https://pjreddie.com/darknet/install/
substituting AlexeyAB's fork instead of pjreddie's from the tutorial.

I used "make" with OpenCV since my Mac doesn't have CUDA and I succeeded in getting a bunch of windows with eagles to show up when I tested it (as per that tutorial), proving I'd compiled darknet correctly.

Then I plugged it into jDownloader 2.0 as specified in the instructions
Screen Shot 2021-02-11 at 1 45 17 AM

Along with the content from the CaptchaSolver git repository
Screen Shot 2021-02-11 at 1 40 18 AM
When I clone this repository, I find keep2share_linux and keep2share_win for placing in captcha -> methods, is there a missing keep2share_mac perhaps? Or keep2share_osx?

Anyway, even after multiple restarts, jDownloader 2.0 still makes me solve Captchas manually. Arg.

I will say I tried this on a Windows machine with your standalone zip "win" install method and it worked flawlessly, which is amazing, but I really need it to work on my Mac lol please help!

I am searching for the code

I need help for creating the OCR i asked for help in Stack Overflow but it got closed I don't know how :( Saw your answer in someone else's question surprised by the answer so came your to ask for help by you please try to help me

my email :- [email protected]

Not working on MacOS

MacOS: For Intel Macs (Latest)
NodeJS: Installed via Homebrew (Latest)
Tried both Precompiled then tried Compile darknet on your own method both didn't work.

Just to mention, I'm kinda nube in this territory.
But for Compile darknet on your own method it seemed complied fine for me. Here's an screenshot:
Screenshot 2023-05-28 at 1 01 18 PM
(Based on this: https://pjreddie.com/darknet/install/ it is complied correctly I guess)

Here's a video inside the JD2 app like what it's doing:
https://github.com/cracker0dks/CaptchaSolver/assets/52377889/7d54e207-ebbc-49fe-a203-1fddf3e7ad92

Captcha Solver not working with me in windows

Hi

I downloaded and installed your Captcha solver as your instructions (my OS is Windows 11) but after that it is not working ,
So is there an another configuration should be set ? in Captches window still i select "Dialog (windows) in jdownloader" service and i don't show service as "Offline Captcha solver" , how i activate Offline Captcha solver in jdownloader?

Thanks

just asking

what is j downloader 2? btw

a downowd manager?

How to resolve one digit captcha

Hi, can you create a guide about "How to resolve one digit captcha" with tesseract.js and jimp?
I'll show you some example images of real cases:
0
1
5

I'm trying to extract the number from the image, but very bad results.
I thought the problem was the double background that conflicts with the digit, for this reason I created an additional function to try to unify the background color.
`
app.post(
"/api/watch_videos",
async (req, res) => {
try {
const browser = await puppeteer.launch({
headless: false,
executablePath: 'C:\Program Files\Google\Chrome\Application\chrome.exe', // Specify the path to Google Chrome
args: ['--disable-web-security', '--mute-audio'], // Disable web security
});
const videoLinks = req.body.videoLinks;
const cookies = splitCookies();

     for (const link of videoLinks) {
        const page = await browser.newPage();

        await page.setCookie(...cookies);

        // Go to the website
        await page.goto(
           `https://placeholder.etc/${link}`
        );

        if (!isCaptchaRequired(page)) {
        // do my stuff
           
        } else {
           console.log("Captcha found, enter here");
           // Here, you need to solve the images with tesseract.js
           await page.waitForSelector('img[src^="data:image/jpeg;base64"]');
           const images = await page.$$eval('img[src^="data:image/jpeg;base64"]', imgs => imgs.map(img => img.getAttribute('src')));
           const imagesText = await page.$eval('.container-fluid h3.text-center', (element) => element.innerHTML);

           if (images && images.length > 0) {
              // Use the map() method to remove the initial part from each URL
              const modifiedImages = images.map((imageUrl) => {
                 // Use the substring() method to remove "data:image/jpeg;base64,"
                 const modifiedUrl = imageUrl.substring("data:image/jpeg;base64,".length);
                 console.log(modifiedUrl.substring(0, 20));
                 return modifiedUrl;
              });
              let srcSx = []
              let srcDx = []
              switch (images.length) {
                 case 2:
                    srcSx.push(modifiedImages[0]);
                    srcDx.push(modifiedImages[1]);
                    break;

                 case 3:
                    srcSx.push(modifiedImages[0]);
                    const parts = imagesText.split("> + <");
                    const lastPart = parts[parts.length - 1];
                    const match = lastPart.match(/src="data:/g)
                    console.log(match);
                    if (match && match.length > 1) {
                       srcDx.push(modifiedImages[1]);
                    } else {
                       srcSx.push(modifiedImages[1]);
                    }
                    srcDx.push(modifiedImages[2]);
                    break;

                 case 4:
                    srcSx.push(modifiedImages[0]);
                    srcSx.push(modifiedImages[1]);
                    srcDx.push(modifiedImages[2]);
                    srcDx.push(modifiedImages[3]);
                    break;

                 default:
                    break;
              }
              if (srcSx.length > 0 && srcDx.length > 0) {
                 console.log("srcSx.length ", srcSx.length);
                 console.log("srcDx.length ", srcDx.length);

                 const worker = await createWorker('eng');

                 (async () => {
                    await worker.setParameters({
                       tessedit_char_whitelist: '0123456789',
                       user_defined_dpi: '300', // Set the desired resolution (300 DPI)
                    });
                    for (const base64 of srcSx) {
                       const imageBuffer = Buffer.from(base64, 'base64');
                       const imageBufferModified = await modifyBackground(imageBuffer);
                       const {
                          data: {
                             text
                          }
                       } = await worker.recognize(imageBufferModified, "eng");
                       console.log(`Text from srcSx: ${text}`);
                    }

                    for (const base64 of srcDx) {
                       const imageBuffer = Buffer.from(base64, 'base64');
                       const imageBufferModified = await modifyBackground(imageBuffer)
                       const {
                          data: {
                             text
                          }
                       } = await worker.recognize(imageBufferModified, "eng");
                       console.log(`Text from srcDx: ${text}`);
                    }
                    await worker.terminate();
                 })();
              }
           }
        }
     }

     // Close the browser at the end
     await browser.close();

     res.status(200).send(
        "Videos watched successfully."
     );
  } catch (error) {
     console.error(error);
     res.status(500).send(
        "Error while watching the videos."
     );
  }

}
);

async function modifyBackground(imageBuffer) {
return new Promise((resolve, reject) => {
sharp(imageBuffer)
.raw()
.toBuffer(async (err, buffer, info) => {
if (err) {
reject(err);
return;
}

        const width = info.width;
        const height = info.height;
        const channels = info.channels;

        // Define a threshold to determine if a color is "close" to white or black
        const threshold = 10; // Adjust this value as needed

        // Read the color of the first pixel in the upper left
        const firstPixelIndex = 0;
        const firstPixelRed = buffer.readUInt8(firstPixelIndex);
        const firstPixelGreen = buffer.readUInt8(firstPixelIndex + 1);
        const firstPixelBlue = buffer.readUInt8(firstPixelIndex + 2);

        // Calculate the opposite color
        const newBackgroundColor = {
           red: 255 - firstPixelRed,
           green: 255 - firstPixelGreen,
           blue: 255 - firstPixelBlue,
        };

        // Iterate through the pixels of the image
        for (let y = 0; y < height; y++) {
           for (let x = 0; x < width; x++) {
              const pixelIndex = (y * width + x) * channels;

              // Read the color channels of the pixel
              const red = buffer.readUInt8(pixelIndex);
              const green = buffer.readUInt8(pixelIndex + 1);
              const blue = buffer.readUInt8(pixelIndex + 2);

              // Check if the pixel color is close to white or black
              if (
                 Math.abs(red - firstPixelRed) <= threshold &&
                 Math.abs(green - firstPixelGreen) <= threshold &&
                 Math.abs(blue - firstPixelBlue) <= threshold
              ) {
                 // Change the color of the pixel to the new background
                 buffer.writeUInt8(newBackgroundColor.red, pixelIndex); // R
                 buffer.writeUInt8(newBackgroundColor.green, pixelIndex + 1); // G
                 buffer.writeUInt8(newBackgroundColor.blue, pixelIndex + 2); // B
              }
           }
        }

        const modifiedImageBuffer = await sharp(buffer, {
              raw: {
                 width,
                 height,
                 channels,
              },
           })
           .toFormat('png')
           .toBuffer();

        // Now buffer contains the image data with the new background based on the opposite of the first pixel
        resolve(modifiedImageBuffer);
        // Save the resulting image to see the result (TEST)
        sharp(buffer, {
              raw: {
                 width,
                 height,
                 channels
              }
           })
           .toFile('modified_image.png', (err) => {
              if (err) {
                 console.error('Error saving: ", err);
              } else {
                 console.log('Success saving');
              }
           });

     });

});
};
`
This is the difference between per-unifying background color -> post-unifying background color
PRE:
2
POST:
immagine_modificata

After all this, tesseract still fails to extract the number
You might say that I'm just complicating my life, and surely the answer is "yes",
but I'm here to look for a more effective solution.

Thanks

Cant compile for Raspberry Pi Zero w (arm 32)

Hi,
ive tried to compile it for my Raspberry Pi Zero w which is Arm 32, but i could´nt get it to work.
I ve never compiled something on my Raspberry pi, is there another way?
Is it easier to compile the tar.gz file?
Could you compile it for me?
Thanks

Is not working on Linux

Hi there, i tried to run this but is not working on Linux, i tested installing NODEJS from debian 11 repo and for NodeJS official repos, but when jdownloader try to download from K2s its tun on a loop of getting captcha.

Any ideas? Thanks!

JD 32bit

How to run this on Windows 32bit ?

I don't understand how to use it.

Hello! I am kind of lost of the commands I need to run to solve an image. Please be kind to provide me with some help on the subject. Example scenario: I have an image called captcha.png. What should I run to solve it and get the letters in the captcha?

Broken on k2s

Hi, this doesn't seem to be working on k2s anymore.

Letter I - lower & upper cases causing inappropriate recognition results

Hey cracker0dks,

first of all I want to express my highest appreciation for your 6-lettercase OCR of captchas working extremely well. After having tested your script since 6 months I just discovered one challenge. Whenever the captchas did contain a lowercase letter "i" or uppercase letter "I" this would lead to double recognitions of this same letter as in your discovered font the lower & upper case letter "I" are exactly the same. Any chance you could further improve your recognition script to encounter this little challenge?

Thanks & BR,
Edgar

how to recruit this for a different host?

Hi, sorry to bother you. This looks cool. I wanted to use this for Tezfiles.com instead of keep2share and the captcha looks the same. Is there a simple thing I can do to make it use this engine for that instead of for keep2share?

Cannot find module 'jimp'

Hi, I'm trying to use the captchasolver with a jdownloader2 installed on a raspberry pi 4, but it's not working and I'm getting this on the log.txt file on the offlinecaptchasolver folder:

node:internal/modules/cjs/loader:958
throw err;
^

Error: Cannot find module 'jimp'
Require stack:

  • /home/pi/JDownloader/tools/offlineCaptchaSolver/ocr.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:955:15)
    at Module._load (node:internal/modules/cjs/loader:803:27)
    at Module.require (node:internal/modules/cjs/loader:1021:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object. (/home/pi/JDownloader/tools/offlineCaptchaSolver/ocr.js:1:12)
    at Module._compile (node:internal/modules/cjs/loader:1119:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1173:10)
    at Module.load (node:internal/modules/cjs/loader:997:32)
    at Module._load (node:internal/modules/cjs/loader:838:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/home/pi/JDownloader/tools/offlineCaptchaSolver/ocr.js' ]
    }

Node.js v18.8.0

How to resolve 3 letter captcha?

Hello,

I would like to solve a captcha with containing 3 letters as such:
antibot-514918490
antibot-215859639
antibot-443447640

How can train your CaptchaSolver to solve this?

Any help would be much appriciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.