{"_id":"9kw-captcha-node","_rev":"5-88bc6de6636c08454c1acba0f32ab19e","time":{"1.0.1":"2020-09-28T03:28:03.268Z","created":"2020-09-29T05:29:34.086Z","1.0.3":"2020-09-29T05:29:34.196Z","modified":"2022-04-04T10:25:23.992Z"},"name":"9kw-captcha-node","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.3":{"name":"9kw-captcha-node","version":"1.0.3","description":"9kw API Wrapper to solve captchas","main":"src/index.js","scripts":{"flow":"npm run lint && npm run docs","docs":"npm run build:docs && npm run move:docs","build:docs":"jsdoc -c jsdoc.json || true","move:docs":"cp -r ./docs/9kw-captcha-node/1.0.3/* ./docs/ && rm -r ./docs/9kw-captcha-node","serve:docs":"serve docs","lint":"eslint src/. test/. --config .eslintrc.json --fix","test":"mocha test/ -t 0 --check-leaks --inline-diffs --recursive"},"keywords":["9kw","recaptcha","reCaptchaV3","reCaptchaV2","captchaImage","captchaBase64","captchaURL","captchaSiteKey","captcha"],"author":{"name":"gpedro34"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/gpedro34/9kw-captcha-node.git"},"bugs":{"url":"https://github.com/gpedro34/9kw-captcha-node/issues"},"dependencies":{"dotenv":"^8.2.0","superagent":"^2.3.0"},"devDependencies":{"better-docs":"^2.3.2","chai":"^4.2.0","eslint":"^7.8.1","eslint-config-airbnb-base":"^14.2.0","eslint-plugin-import":"^2.22.0","jsdoc":"^3.6.5","jsdoc-mermaid":"^2","mocha":"^8.1.3","nock":"^13.0.4","prettier":"^2.1.1","serve":"^11.3.2"},"gitHead":"777d0b1b81c3cd990c2cccd12c7d86a6d4d09478","homepage":"https://github.com/gpedro34/9kw-captcha-node#readme","_id":"9kw-captcha-node@1.0.3","_nodeVersion":"14.5.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-FY7y5K6zCNFD9dilwqot1CNjbDbWwaxsw7ydRzeLDdw1kCzvuLdmWIAD+xyRDFVSO5Jh7Qb4UrYQomkpihSwQw==","shasum":"270b32b3b711b309e7e001c56ad666b65f2e5ad5","tarball":"https://registry.npmjs.org/9kw-captcha-node/-/9kw-captcha-node-1.0.3.tgz","fileCount":9,"unpackedSize":27502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcsY+CRA9TVsSAnZWagAApygP/25WAvv0fdIQnnQfmNcl\ne0NXRw2+n2xrowFls5u+2OACmnVvHF06tUYAC90XYzXCWZXgYR1zIfhoTkq3\n+/r3SFLQ6h1PpWk8YO8i58MEPOm2U2bIC/htW3WWTp7Gt1mvGF431z+Niy2r\nTx5MKygul9iGmcM9hH+KB7lQX0Vlz2Io2LU5GEplx5zYIayRxezMy38Q27n6\nJyiiN0QZH6AQOURiJz7fGhtl9rtrKdIhRtjPrV5myKGaBZiiKXqVGuA7NHJX\n3XVxYI7CmxmLnAx+vmlJRqpV8AqZvTkCx3HV6xsAld8ZMHRTpfmyojzv7n4P\nFdiHGeY0SqZ+q7JhVva1r0zVvpEAeyhskArprywoLQgp4PowF3kgCx9gKZFj\nfdvL2Cl5pbOpIdfNGsDpTuVu2ohygIwjg67lfmDDoxeKS/txSrw1264rqoHM\n4KX87FBTSD18Fpptk1Iyj2uip39Yd8P3QxHu+wbQF1nfJ69dvo7hEO8FsVVv\nq6nsHYZUNL9p2yiNF2b+4NhftbfyTll+WqmpKZMfjAZ3pulmqUkrDYaJAVwa\ndEa5Ki8kqCyhhh9VUCw24f9sygIfk1jRXr9jYMuaK/thumF7HVtBhMC0iD20\nyz1J99r35Etqg10QM8l9N0Y2j2YReByDkog1J9D6ukOhc1GiqgjwBfNe4Rnt\neToy\r\n=v+F2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBpWgYTLwh6Q5wU0tiwMoAI5+ChXxIZtMpMHRRIP7jmVAiEAwIoEQ9RCp190ntN+3mTRjcXB41wfj0rV0leZGTq0yDg="}]},"maintainers":[{"name":"gpedro34","email":"gpedro34@gmail.com"}],"_npmUser":{"name":"gpedro34","email":"gpedro34@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/9kw-captcha-node_1.0.3_1601357374086_0.253408034157522"},"_hasShrinkwrap":false}},"maintainers":[{"name":"gpedro34","email":"gpedro34@gmail.com"}],"description":"9kw API Wrapper to solve captchas","homepage":"https://github.com/gpedro34/9kw-captcha-node#readme","keywords":["9kw","recaptcha","reCaptchaV3","reCaptchaV2","captchaImage","captchaBase64","captchaURL","captchaSiteKey","captcha"],"repository":{"type":"git","url":"git+https://github.com/gpedro34/9kw-captcha-node.git"},"author":{"name":"gpedro34"},"bugs":{"url":"https://github.com/gpedro34/9kw-captcha-node/issues"},"license":"MIT","readme":"# 1. 9kw\n\nThis is an api wrapper for the 9kw captcha solver service. An Api Key is needed, generate using the 9kw website.\n\n- [9kw.eu](https://www.9kw.eu/?r=139389)\n- [Library Documentation](https://gpedro34.github.io/9kw-captcha-node/module.exports.html)\n\n## 1.1. Installation\n\nnode:\n\n```sh\nnpm install 9kw-captcha-node\n\n```\n\nThis library supports environment variables to pass parameters like API Key:\n\n| ENV variable           | Type   | Description                                                |\n| ---------------------- | ------ | ---------------------------------------------------------- |\n| CAPTCHA_API_KEY_9KW    | String | API Key                                                    |\n| CAPTCHA_SOURCE_9KW     | String | 9kw Source (app indicator)                                 |\n| CAPTCHA_OLD_SOURCE_9KW | String | 9kw Old Source (indicator for captcha type)                |\n| CAPTCHA_PRIO_9KW       | Number | 9kw default priority                                       |\n| CAPTCHA_DEBUG_9KW      | Number | Don't spend credits and get fake solutions. For testing... |\n\nIn alternative you can pass it as parameters when instantiating the API constructor\n\n## 1.2. Promises - Async/Await\n\n```js\nconst Api9kw = require(\"9kw-captcha-node\");\nconst api = new Api9kw(/* You can pass parameters here or just use the ENV vars */);\n\n(async () => {\n  try {\n    // Get the balance of credits from 9kw\n    const balance = await api.asyncGetBalance();\n    console.log(`BALANCE: ${balance} credits`);\n\n    // Submit a local image file with the captcha\n    // const captchaId = await api.asyncSubmitFile(config.pathToFile);\n\n    // Submit using a Image Base 64 of the captha\n    // const captchaId = await api.asyncSubmitBase64(config.image_base64);\n\n    // Submit using a Image URL of the captha\n    // const captchaId = await api.asyncSubmit(config.image_url);\n\n    // Submit CaptchaV2 (using a siteKey + siteUrl)\n    // CaptchaV2 will need to be solved by someone in real time\n    //   so using the priority becomes important if you want faster captchas\n    //   300 seconds (with 0 prio) is a reasonable number so you don't miss solved captchas\n    //   If you want them faster, up the prio and you will pay one extra credit per captcha\n    const captchaId = await api.asyncSubmit(\n      SITEKEY,\n      SITEURL,\n      OVERWRITE_PRIO_IF_YOU_WANT\n    );\n    console.log(`CAPTCHA ID: ${captchaId}`);\n\n    // Get the solution of the captcha with a timeout of 40 seconds (optional)\n    // this means that the callback will be called when the captcha is solved\n    // For image Solving 9kw seems to store the solutions in their own DB\n    //   and some are instantaneous others may take some more but usually under 30 sec\n    // For CaptchaV2 (sitekey + siteUrl) will need to be solved by someone in real time\n    //   so using the priority becomes important if you want faster captchas\n    //   300 seconds (with 0 prio) is a reasonable number so you don't miss solved captchas\n    //   If you want them faster, up the prio and you will pay one extra credit per captcha\n    // usually is solved under 30s (default timeout is 30 seconds)\n    const solution = await api.asyncGetSolutionLoop(captchaId, 300);\n    console.log(\"SOLUTION: \", solution);\n\n    // Give feedback\n    successSolve\n      ? await api9kw.asyncIsCorrect(captchaId, true)\n      : await api9kw.asyncIsCorrect(captchaId);\n  } catch (err) {\n    console.error(err); // Timeout or NO_USER\n  }\n})();\n```\n\n## 1.3. Callbacks\n\n```js\nconst Api9kw = require(\"9kw\");\nconst api = new Api9kw(/* You can pass parameters here or just use the ENV vars */);\n\n// Get your account balance (credits)\napi.getBalance((err, balance) => {\n  console.log(balance);\n});\n\n// Submit a local image file with the captcha\n// api.submitFile(\"./captcha.png\", (err, newID) => {\n//   if (err) {\n//     console.log(err);\n//     return;\n//   }\n//   console.log(\"Captcha uploaded!: \" + captchaId);\n//   // Next step is to get the solution of the uploaded captcha using the new captchaID\n// });\n\n// Submit using a Image Base 64 of the captha\n// api.submitBase64(base64, (err, newID) => {\n//   if (err) {\n//     console.log(err);\n//     return;\n//   }\n//   console.log(\"Captcha uploaded!: \" + captchaId);\n//   // Next step is to get the solution of the uploaded captcha using the new captchaID\n// });\n\n// Submit using a Image URL of the captha\napi.submit(URL, (err, newID) => {\n  if (err) {\n    console.log(err);\n    return;\n  }\n  console.log(\"Captcha uploaded!: \" + captchaId);\n  // Next step is to get the solution of the uploaded captcha using the new captchaID\n});\n\n// Submit CaptchaV2 (using a siteKey + siteUrl)\n// CaptchaV2 will need to be solved by someone in real time\n//   so using the priority becomes important if you want faster captchas\n//   300 seconds (with 0 prio) is a reasonable number so you don't miss solved captchas\n//   If you want them faster, up the prio and you will pay one extra credit per captcha\napi.submit(\n  SITE_KEY,\n  (err, newID) => {\n    if (err) {\n      console.log(err);\n      return;\n    }\n    console.log(\"Captcha uploaded!: \" + captchaId);\n    // Next step is to get the solution of the uploaded captcha using the new captchaID\n  },\n  SITE_URL,\n  OVERWRITE_PRIO_IF_YOU_WANT\n);\n\n// Get the solution of the captcha with a timeout of 40 seconds (optional)\n// this means that the callback will be called when the captcha is solved\n// usually is solved under 30s (default timeout is 30 seconds)\napi.getSolutionLoop(captchaId, 40, (err, solution) => {\n  if (err) {\n    console.log(err);\n    return;\n  }\n  console.log(\"Solution: \" + solution);\n});\n\n// Tell 9kw the solution was correct or not\napi.isCorrect(captchaId, true);\n\n// Get the 9kw server check info\napi.serverCheck((err, serverInfo) => {\n  console.log(serverInfo);\n});\n```\n\n## 1.4. Development\n\n### 1.4.1. Linting and Generating Docs\n\n```sh\nnpm run flow\n```\n\n### 1.4.2. Tests\n\nIn order to run the tests, create a .env file as .env.default and put your account details in the correct ENV variables, then run:\n\n```sh\nnpm run test\n```\n\nTests are not working on Node > 10\n\n- [StackOverflow](https://stackoverflow.com/questions/56697360/how-to-fix-node12388-dep0066-deprecationwarning-outgoingmessage-prototype)\n\n## 1.5. Credits\n\nThis project was initially a fork of [iamfreee/9kw_node](https://github.com/iamfreee/9kw_node.git)\n","readmeFilename":"README.md"}