mdesilva / AmazonFlexUnlimited

Automate the process of grabbing job blocks from Amazon Flex
147 stars 96 forks source link

Keep getting captcha #144

Open tech818 opened 9 months ago

tech818 commented 9 months ago

Is there a reason why I keep getting hit with captcha? I tried logging in via flex app and accepting a random block and finishing the captcha but when I turn the bot on again I get the captcha sent.

gmcsnetwork commented 9 months ago

Started noticing the same, there was a recent Amazon Flex app update, wondeting if the version needs to be updated in the script again to blending with the app :)

kayosctpk commented 9 months ago

I have two instances running at the same time on my pc, one of a friend and the other of mine, mine started not getting any offers because of the captcha since my friend's is normal. I think it's time for supercharger 2.0 :)

gmcsnetwork commented 9 months ago

I help a few people with this script and about 50% are getting the error code 307 consistently, even after manually accepting a block and completing the recapcha successfully.

kayosctpk commented 9 months ago

I was doing some research about amazoncapcha library, but im not expert with it πŸ˜‘

lpcs007 commented 8 months ago

Is there still no way to pass the captcha? I know that some sites that sell this type of service have the functionality to pass the captcha and the selfie too. I'm not familiar with Python, but I believe there is someone knowledgeable who could help with this.

kayosctpk commented 8 months ago

i'm using a paid bot to grabber offers, and its has captcha by pass.

lpcs007 commented 8 months ago

i'm using a paid bot to grabber offers, and its has captcha by pass.

Exactly what I'm talking about. If they do, then the solution exists!

Which one are you using?

kayosctpk commented 8 months ago

i'm using a paid bot to grabber offers, and its has captcha by pass.

Exactly what I'm talking about. If they do, then the solution exists!

Which one are you using?

compinche

cesarmayo commented 8 months ago

I help a few people with this script and about 50% are getting the error code 307 consistently, even after manually accepting a block and completing the recapcha successfully.

Can you please help me with that... I have been the same problem

cesarmayo commented 8 months ago

Is there still no way to pass the captcha?

I know that some sites that sell this type of service have the functionality to pass the captcha and the selfie too.

I'm not familiar with Python, but I believe there is someone knowledgeable who could help with this.

Did you find any solution to pass the captcha???

lpcs007 commented 8 months ago

Is there still no way to pass the captcha? I know that some sites that sell this type of service have the functionality to pass the captcha and the selfie too. I'm not familiar with Python, but I believe there is someone knowledgeable who could help with this.

Did you find any solution to pass the captcha???

Yes and I will try to implement it in the script. The solution is paid, but the price is not bad.

I found that the captcha used is Arkose Labs FunCaptcha

And the solution is: https://github.com/capsolver/capsolver-python

zmkaihan commented 8 months ago

did the solution https://github.com/capsolver/capsolver-python worked for you if yes please instruct me on how to implement it in my script.

cesarmayo commented 8 months ago

hello….. I don't have the slightest idea how to do that. if you manage to implement it in the script please let me know. Thank you

jaimbox commented 8 months ago

Hello everyone, I have tried this solution and it works for me. It is a paid solution but it solves the problem.

  1. You must create an account here.
  2. Install the library pip3 install anticaptchaofficial
  3. Import the library from anticaptchaofficial.funcaptchaproxyless import *
  4. When you get the 307 error paste this:
    
    solver = funcaptchaProxyless()
    solver.set_verbose(1)
    solver.set_key("YOUR_KEY")
    solver.set_website_url("https://www.amazon.com/aaut/verify/flex-offers/challenge?challengeType=ARKOSE_LEVEL_1&returnTo=https://www.amazon.com&headerFooter=false")
    solver.set_website_key("2F1CD804-FE45-F12B-9723-240962EBA6F8")

token = solver.solve_and_return_solution() if token != 0: print("result token: " + token) else: print("task finished with error " + solver.error_code)

lpcs007 commented 8 months ago

Hello everyone, I have tried this solution and it works for me. It is a paid solution but it solves the problem.

1. You must create an account [here](http://getcaptchasolution.com/hsrx4hiswv).

2. Install the library `pip install python3-anticaptcha`

3. Import the library `from anticaptchaofficial.funcaptchaproxyless import *`

4. When you get the 307 error paste this:
solver = funcaptchaProxyless()
solver.set_verbose(1)
solver.set_key("YOUR_KEY")
solver.set_website_url("https://www.amazon.com/aaut/verify/flex-offers/challenge?challengeType=ARKOSE_LEVEL_1&returnTo=https://www.amazon.com&headerFooter=false")
solver.set_website_key("2F1CD804-FE45-F12B-9723-240962EBA6F8")

token = solver.solve_and_return_solution()
if token != 0:
   print("result token: " + token)
else:
   print("task finished with error " + solver.error_code)

I saw that website, but I thought their solution time was too high. So I opted for other sites, but none worked well. I used your code and it seems to have worked to send the task, but it just keeps processing...

task is still processing
making request to getTaskResult
API error ERROR_CAPTCHA_UNSOLVABLE: Captcha could not be solved by 5 different workers
task finished with error ERROR_CAPTCHA_UNSOLVABLE
None
jaimbox commented 8 months ago

Hello everyone, I have tried this solution and it works for me. It is a paid solution but it solves the problem.

1. You must create an account [here](http://getcaptchasolution.com/hsrx4hiswv).

2. Install the library `pip install python3-anticaptcha`

3. Import the library `from anticaptchaofficial.funcaptchaproxyless import *`

4. When you get the 307 error paste this:
solver = funcaptchaProxyless()
solver.set_verbose(1)
solver.set_key("YOUR_KEY")
solver.set_website_url("https://www.amazon.com/aaut/verify/flex-offers/challenge?challengeType=ARKOSE_LEVEL_1&returnTo=https://www.amazon.com&headerFooter=false")
solver.set_website_key("2F1CD804-FE45-F12B-9723-240962EBA6F8")

token = solver.solve_and_return_solution()
if token != 0:
   print("result token: " + token)
else:
   print("task finished with error " + solver.error_code)

I saw that website, but I thought their solution time was too high. So I opted for other sites, but none worked well. I used your code and it seems to have worked to send the task, but it just keeps processing...

task is still processing
making request to getTaskResult
API error ERROR_CAPTCHA_UNSOLVABLE: Captcha could not be solved by 5 different workers
task finished with error ERROR_CAPTCHA_UNSOLVABLE
None

I recommend you to create a separate .py file to do the testing and then deploy it where you want, it usually takes a while, but it depends on the workers that exist at the moment.

image

lpcs007 commented 8 months ago

Hello everyone, I have tried this solution and it works for me. It is a paid solution but it solves the problem.

1. You must create an account [here](http://getcaptchasolution.com/hsrx4hiswv).

2. Install the library `pip install python3-anticaptcha`

3. Import the library `from anticaptchaofficial.funcaptchaproxyless import *`

4. When you get the 307 error paste this:
solver = funcaptchaProxyless()
solver.set_verbose(1)
solver.set_key("YOUR_KEY")
solver.set_website_url("https://www.amazon.com/aaut/verify/flex-offers/challenge?challengeType=ARKOSE_LEVEL_1&returnTo=https://www.amazon.com&headerFooter=false")
solver.set_website_key("2F1CD804-FE45-F12B-9723-240962EBA6F8")

token = solver.solve_and_return_solution()
if token != 0:
   print("result token: " + token)
else:
   print("task finished with error " + solver.error_code)

I saw that website, but I thought their solution time was too high. So I opted for other sites, but none worked well. I used your code and it seems to have worked to send the task, but it just keeps processing...

task is still processing
making request to getTaskResult
API error ERROR_CAPTCHA_UNSOLVABLE: Captcha could not be solved by 5 different workers
task finished with error ERROR_CAPTCHA_UNSOLVABLE
None

I recommend you to create a separate .py file to do the testing and then deploy it where you want, it usually takes a while, but it depends on the workers that exist at the moment.

image

on the second try it worked. Thank you for your help.

cesarmayo commented 8 months ago

Caen you please send me the file with the new code

On Fri, Aug 11, 2023 at 2:06β€―PM Jasiel Izaguirre @.***> wrote:

Hello everyone, I have tried this solution and it works for me. It is a paid solution but it solves the problem.

  1. You must create an account here http://getcaptchasolution.com/hsrx4hiswv.
  2. Install the library pip install python3-anticaptcha
  3. Import the library from anticaptchaofficial.funcaptchaproxyless import *
  4. When you get the 307 error paste this:

solver = funcaptchaProxyless() solver.set_verbose(1) solver.set_key("27a7a00ab8d79b714bad116bb6977f9a") solver.set_website_url("https://www.amazon.com/aaut/verify/flex-offers/challenge?challengeType=ARKOSE_LEVEL_1&returnTo=https://www.amazon.com&headerFooter=false") solver.set_website_key("2F1CD804-FE45-F12B-9723-240962EBA6F8")

token = solver.solve_and_return_solution() if token != 0: print("result token: " + token) else: print("task finished with error " + solver.error_code)

β€” Reply to this email directly, view it on GitHub https://github.com/mdesilva/AmazonFlexUnlimited/issues/144#issuecomment-1675240026, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEUE5I77X7E57ITY4MDH2K3XUZ7CZANCNFSM6AAAAAA3ERUU7M . You are receiving this because you commented.Message ID: @.***>

jaimbox commented 8 months ago

Doing some research, the captcha is solved and I can get the response token from Arkose but I BELIEVE this token should be sent to amazon for verification.

image

lpcs007 commented 8 months ago

Doing some research, the captcha is solved and I can get the response token from Arkose but I BELIEVE this token should be sent to amazon for verification.

image

it seems so. The URL like to be: https://www.amazon.com/?clientId=flex-offers&sessionToken={"uniqueValidationId":"TOKEN_HERE"}

jaimbox commented 8 months ago

Doing some research, the captcha is solved and I can get the response token from Arkose but I BELIEVE this token should be sent to amazon for verification. image

it seems so. The URL like to be: https://www.amazon.com/?clientId=flex-offers&sessionToken={"uniqueValidationId":"TOKEN_HERE"}

How are you sure of that URL, I don't see it when I validate the Captcha manually from my phone.

lpcs007 commented 8 months ago

Doing some research, the captcha is solved and I can get the response token from Arkose but I BELIEVE this token should be sent to amazon for verification. image

it seems so. The URL like to be: https://www.amazon.com/?clientId=flex-offers&sessionToken={"uniqueValidationId":"TOKEN_HERE"}

How are you sure of that URL, I don't see it when I validate the Captcha manually from my phone.

Open the captcha URL https://www.amazon.com/aaut/verify/flex-offers/challenge?challengeType=ARKOSE_LEVEL_1&returnTo=https://www.amazon.com&headerFooter=false and when you pass look the URL

jaimbox commented 8 months ago

Doing some research, the captcha is solved and I can get the response token from Arkose but I BELIEVE this token should be sent to amazon for verification. image

it seems so. The URL like to be: https://www.amazon.com/?clientId=flex-offers&sessionToken={"uniqueValidationId":"TOKEN_HERE"}

How are you sure of that URL, I don't see it when I validate the Captcha manually from my phone.

Open the captcha URL https://www.amazon.com/aaut/verify/flex-offers/challenge?challengeType=ARKOSE_LEVEL_1&returnTo=https://www.amazon.com&headerFooter=false and when you pass look the URL

What do you think about this?. This is the CURL that is sent after solving the Captcha manually on the mobile phone.

curl -H 'content-type: application/json' -H 'accept: */*' -H 'sec-fetch-site: same-origin' --compressed -H 'accept-language: en-US,en;q=0.9' -H 'sec-fetch-mode: cors' -H 'user-agent: Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' -H 'referer: https://www.amazon.com/aaut/verify/flex-offers/challenge?challengeType=ARKOSE_LEVEL_1&returnTo=https://www.amazon.com&headerFooter=false' -H 'anti-csrftoken-a2z: hFKjxrP41LVLPqWndwCXnBqJjaPsFYmfAuhZPRrSJwG7AAAAAGTWkuUAAAAB' -H 'cookie: JSESSIONID=B47B37EC057DE8DFFCFE761D92EB684A' -H 'cookie: at-main="Atza|IwEBILnZyORY5y2D0IGKzVLk1HqYjVtWsQkBmZsI34GI5E9Rd-oDI9mpB_2W-S1lIjf8CkArerJ4B8nWNy0t_4P5uVOySkqFw0NeGVNdRogFJfsnpmx-RJbNGMJGB3Ok725zNkkpsCQri-9GelTl9QASbXh9m6pMh-4zB1XXl-ilTVH8YPhh29bUIvrLbfHXG3Q1pnfLy59NjI7tvA8NvBC_jC8T9j9j7uY-JUSGLtnlcPKEX4GxOrpJzFYgoobD0lpBmIqTHs0B-LHIdYn6VPRqXXuxDZBUpj-rgVxGOgrascbFLqArsyvJS1sWdUVuc5HrcSX67hT8uOfe1vHCVk-vtioZ"' -H 'cookie: sess-at-main="g/LWhRxR6wb86OZQVO/ZJW9r9NaAM0viOaNWC1EDc28="' -H 'cookie: session-id=145-5000126-7866539' -H 'cookie: session-id-time=4 Aug 2043 12:55:42 GMT' -H 'cookie: ubid-main=132-7605598-3569439' -H 'cookie: x-main="5LKAGfenUENz0Qm0yZ4NaqyAOf1@GfcuFCvpd3teqnVVU6sFOhzkYF16I1oa17a2"' -H 'cookie: session-token=ti4Iq6MTFn0Wke5E5+7SKXTLgjxqRFkSZN6ou77JVX35tFgdxGAXo16xPQ8B2vtzk3j282BNysskPX/WuszaQQ6NihFEpb7jRFSh46OehDNHECJIPlNM6l5eHyH/RFRzq5LdcjUGzOulg3BNdtRdsl3SfLhqrbXjLrvE7xF/Ra7Ocu89g4lvlpax5EphbELMVMTcmAQ2rQ7M2GcjqiIS206abvZD7jX6HyZQ0KYITnZ/ubNe6GLl5sQKkDmww+sPQQZTzEE4HO0' -H 'sec-fetch-dest: empty' 'https://www.amazon.com/aaut/verify/flex-offers/%7B%22uniqueValidationId%22:%22aa9a1b8e-b8db-4d14-b0e8-e470904be160%22%7D?context=ZCFJqXWWBTDDhfWgBPLdtA%253D%253D.pXR5wDJUZoDBPXUPwhugC8%252BRHI4opE6kcmDEiwkcW2bPMrVcuKjOS04B%252F8lDPQabYkoGKxjiYOwX%252FKOfymgi9on4eB9pkNClxuJ4BCHYO6GxZMGbfFcfF%252F64bRPK9gcutwlSrz7tlb3TFs14%252BD4xS38u58rkWOpOvuPTyZ3gEaYmFu9TdeJkyw5Teqow%252FtuymVQmg4outzCAMymKiktjXnMMXnqyfhJV7qmT40%252FXPbO%252B3U4WQeQUuVCJwqJJ5tptnzXsaer%252BCCdCvAZbUrvjTFxYtYno3CZaGp5yFx6TywiXec3o%252BWAVCCEtysf2CDBduLJeSbuhASm%252BB%252BRBxByZeJGbgfOLdQlV1L%252FVVOMvqV0lxWp82lXPWovbz5UsSHTNtC7ZjeewdrsdHEsibMgO&options=%7B%22clientData%22%3Anull%2C%22challengeType%22%3A%22ARKOSE_LEVEL_1%22%2C%22locale%22%3A%22en-US%22%2C%22enableHeaderFooter%22%3Afalse%2C%22enableBypassMechanism%22%3Afalse%2C%22enableModalView%22%3Afalse%2C%22eventTrigger%22%3Anull%2C%22forceJsFlush%22%3Afalse%7D&response=%7B%22challengeType%22%3A%22ARKOSE_LEVEL_1%22%2C%22data%22%3A%22%7B%5C%22sessionToken%5C%22%3A%5C%22684177a6c81331191.3094304101%7Cr%3Dus-east-1%7Cmeta%3D9%7Cmeta_width%3D302%7Cmeta_height%3D288%7Cmetabgclr%3D%2523ffffff%7Cmetaiconclr%3D%25230073cf%7Cmainbgclr%3D%2523ffffff%7Cmaintxtclr%3D%25231B1B1B%7Cguitextcolor%3D%2523747474%7Clang%3Den%7Cpk%3D2F1CD804-FE45-F12B-9723-240962EBA6F8%7Cdc%3D1%7Cat%3D40%7Cag%3D101%7Ccdn_url%3Dhttps%253A%252F%252Fclient-api.arkoselabs.com%252Fcdn%252Ffc%7Clurl%3Dhttps%253A%252F%252Faudio-us-east-1.arkoselabs.com%7Csurl%3Dhttps%253A%252F%252Fclient-api.arkoselabs.com%7Csmurl%3Dhttps%253A%252F%252Fclient-api.arkoselabs.com%252Fcdn%252Ffc%252Fassets%252Fstyle-manager%5C%22%7D%22%7D'

lpcs007 commented 8 months ago

ok, following your idea, I managed to get some data.

the request is sent to: https://www.amazon.com/aaut/verify/flex-offers/{"uniqueValidationId":"TOKEN_HERE"} with params (GET):

context: %2FzIz61%2BOiBo%2F7u2TMFCO7Q%3D%3D.JVsaa%2F06J23IQyLcZ684TOqdORM%2BZMl0%2FsH6ENqYrX9WylNgmauaZ3wxYI%2B%2Ftv7QnyTITV5jf4eVDOpJKyvlCV4B1O%2F2AxplJdABrmMyU4vkw6ZwJKpJh1raA7RmCfTw0QVHsxTsBOcbWgTflfNimTSe2%2F0BpQx%2B91tF8%2FVNDh4L83FjssGSvI1U0Ab59tka%2FyAE86ttmcSW%2FgnLdnBKZEHf987PMx84VEoKrBFfkTdmAVQ4xMiSf%2BgZdhONoSWUIsb8O%2BqugXL1Wpc%2FLnUxtgMVKnc3rKs89sLzZJ9zndGd2Eau%2Fq6VAxgwwxHoFv4CYq4hd6w0GeTDAtiVQF3WdFWPgIXrH7nNskqifzhO%2BFYiujVykVVYUdEKwYM0EfMXIEo6xjSilwGj3CppWzMs

options: {"clientData":null,"challengeType":"ARKOSE_LEVEL_1","locale":"pt-BR","enableHeaderFooter":false,"enableBypassMechanism":false,"enableModalView":false,"eventTrigger":null,"forceJsFlush":false}

response: {"challengeType":"ARKOSE_LEVEL_1","data":"{\"sessionToken\":\"828177a70f77d5d64.2060195501|r=us-east-1|meta=9|meta_width=302|meta_height=288|metabgclr=%23ffffff|metaiconclr=%230073cf|mainbgclr=%23ffffff|maintxtclr=%231B1B1B|guitextcolor=%23747474|lang=pt-br|pk=2F1CD804-FE45-F12B-9723-240962EBA6F8|dc=1|at=40|ag=101|cdn_url=https%3A%2F%2Fclient-api.arkoselabs.com%2Fcdn%2Ffc|lurl=https%3A%2F%2Faudio-us-east-1.arkoselabs.com|surl=https%3A%2F%2Fclient-api.arkoselabs.com|smurl=https%3A%2F%2Fclient-api.arkoselabs.com%2Fcdn%2Ffc%2Fassets%2Fstyle-manager\"}"}

But I don't know which token is that in the destination URL I don't know what that context would be In response has the bypass token

Screenshot_1

jack13021 commented 8 months ago

https://www.amazon.com/aaut/verify/flex-offers/challenge?challengeType=ARKOSE_LEVEL_1&returnTo=https//www.amazon.com&headerFooter=false

jaimbox commented 8 months ago

https://www.amazon.com/aaut/verify/flex-offers/challenge?challengeType=ARKOSE_LEVEL_1&returnTo=https//www.amazon.com&headerFooter=false

What do you mean by this?

lpcs007 commented 8 months ago

Amazon challenge link.

jaimbox commented 8 months ago

Amazon challenge link.

Yes, we know that.

jack13021 commented 8 months ago

Amazon challenge link.

Yes, we know that.

Sorry, I'm just seeing this captcha topic today. Any progress I will share, thanks

jaimbox commented 8 months ago

There are 3 requests when solving Captcha manually. @lpcs007

REQUEST 1

πŸ‘€ This opens the page to solve the captcha πŸ‘€

import requests

url = "https://www.amazon.com/aaut/verify/flex-offers/challenge?challengeType=ARKOSE_LEVEL_1&returnTo=https://www.amazon.com&headerFooter=false"

payload = {}
headers = {
  'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  'sec-fetch-site': 'none',
  'cookie': 'at-main="Atza|######################################################"',
  'sec-fetch-mode': 'navigate',
  'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
  'accept-language': 'en-US,en;q=0.9',
  'sec-fetch-dest': 'document'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

REQUEST 2

πŸ‘€ This request returns in the header the Key: "amz-aamation-resp" containing "uniqueValidationId" and "clientSideContext". πŸ‘€

import requests
import json

url = "https://www.amazon.com/aaut/verify/flex-offers?options=%7B%22clientData%22%3Anull%2C%22challengeType%22%3A%22ARKOSE_LEVEL_1%22%2C%22locale%22%3A%22en-US%22%2C%22enableHeaderFooter%22%3Afalse%2C%22enableBypassMechanism%22%3Afalse%2C%22enableModalView%22%3Afalse%2C%22eventTrigger%22%3Anull%2C%22forceJsFlush%22%3Afalse%7D"

payload = {}
headers = {
  'content-type': 'application/json',
  'accept': '*/*',
  'sec-fetch-site': 'same-origin',
  'accept-language': 'en-US,en;q=0.9',
  'sec-fetch-mode': 'cors',
  'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
  'referer': 'https://www.amazon.com/aaut/verify/flex-offers/challenge?challengeType=ARKOSE_LEVEL_1&returnTo=https://www.amazon.com&headerFooter=false',
  'cookie': 'JSESSIONID=9B#############################',
  'sec-fetch-dest': 'empty'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

image

REQUEST 3

πŸ‘€ Here we pass the "uniqueValidationId" the "context" which is "clientSideContext" and the response obtained from Arkose. πŸ‘€

import requests
import json

url = "https://www.amazon.com/aaut/verify/flex-offers/%7B%22uniqueValidationId%22:%2262e59196-1111-1111-1111-78f05003d5c0%22%7D?context=####################################################################################################################################l&options=%7B%22clientData%22%3Anull%2C%22challengeType%22%3A%22ARKOSE_LEVEL_1%22%2C%22locale%22%3A%22en-US%22%2C%22enableHeaderFooter%22%3Afalse%2C%22enableBypassMechanism%22%3Afalse%2C%22enableModalView%22%3Afalse%2C%22eventTrigger%22%3Anull%2C%22forceJsFlush%22%3Afalse%7D&response=%7B%22challengeType%22%3A%22ARKOSE_LEVEL_1%22%2C%22data%22%3A%22%7B%5C%22sessionToken%5C%22%3A%5C%22######417######59.3#######01%7Cr%3Dus-east-1%7Cmeta%3D9%7Cmeta_width%3D302%7Cmeta_height%3D288%7Cmetabgclr%3D%2523ffffff%7Cmetaiconclr%3D%25230073cf%7Cmainbgclr%3D%2523ffffff%7Cmaintxtclr%3D%25231B1B1B%7Cguitextcolor%3D%2523747474%7Clang%3Den%7Cpk%3D2F1CD804-FE45-F12B-9723-240962EBA6F8%7Cdc%3D1%7Cat%3D40%7Cag%3D101%7Ccdn_url%3Dhttps%253A%252F%252Fclient-api.arkoselabs.com%252Fcdn%252Ffc%7Clurl%3Dhttps%253A%252F%252Faudio-us-east-1.arkoselabs.com%7Csurl%3Dhttps%253A%252F%252Fclient-api.arkoselabs.com%7Csmurl%3Dhttps%253A%252F%252Fclient-api.arkoselabs.com%252Fcdn%252Ffc%252Fassets%252Fstyle-manager%5C%22%7D%22%7D"

payload = {}
headers = {
  'content-type': 'application/json',
  'accept': '*/*',
  'sec-fetch-site': 'same-origin',
  'accept-language': 'en-US,en;q=0.9',
  'sec-fetch-mode': 'cors',
  'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
  'referer': 'https://www.amazon.com/aaut/verify/flex-offers/challenge?challengeType=ARKOSE_LEVEL_1&returnTo=https://www.amazon.com&headerFooter=false',
  'anti-csrftoken-a2z': 'hF######################################################',
  'cookie': 'JSESSIONID=9BF#######################',
  'sec-fetch-dest': 'empty'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
lpcs007 commented 8 months ago

@jaimbox

ok, but how am i going to get the "uniqueValidationId" and "clientSideContext" if the captcha is being solved by a third party?

jaimbox commented 8 months ago

@jaimbox

ok, but how am i going to get the "uniqueValidationId" and "clientSideContext" if the captcha is being solved by a third party?

You do Request #2 on this side (in Python), the objective of that Request is to return those parameters. NOTE: All this is an investigation based on how the App does it,

jaimbox commented 8 months ago

@jaimbox

ok, but how am i going to get the "uniqueValidationId" and "clientSideContext" if the captcha is being solved by a third party?

def resolveCaptchaR2():
    url = "https://www.amazon.com/aaut/verify/flex-offers?options=%7B%22clientData%22%3Anull%2C%22challengeType%22%3A%22ARKOSE_LEVEL_1%22%2C%22locale%22%3A%22en-US%22%2C%22enableHeaderFooter%22%3Afalse%2C%22enableBypassMechanism%22%3Afalse%2C%22enableModalView%22%3Afalse%2C%22eventTrigger%22%3Anull%2C%22forceJsFlush%22%3Afalse%7D"

    payload = {}
    headers = {
        'content-type': 'application/json',
        'accept': '*/*',
        'sec-fetch-site': 'same-origin',
        'accept-language': 'en-US,en;q=0.9',
        'sec-fetch-mode': 'cors',
        'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
        'referer': 'https://www.amazon.com/aaut/verify/flex-offers/challenge?challengeType=ARKOSE_LEVEL_1&returnTo=https://www.amazon.com&headerFooter=false',
        'sec-fetch-dest': 'empty'
    }

    response = requests.request("GET", url, headers=headers, data=payload)
    headersResponse = response.headers
    sessionToken = json.loads(json.loads(headersResponse['amz-aamation-resp'])["sessionToken"])
    uniqueValidationId = sessionToken["uniqueValidationId"]
    clientSideContext = json.loads(headersResponse['amz-aamation-resp'])["clientSideContext"]

    print(uniqueValidationId)
    print(clientSideContext)
lpcs007 commented 8 months ago

ok, but those data are generated whenever the captcha is opened. So new data will be created when the captcha is generated by third parties, no?

jaimbox commented 8 months ago

ok, but those data are generated whenever the captcha is opened. So new data will be created when the captcha is generated by third parties, no?

That's right, that's every time the Captcha is requested.

lpcs007 commented 8 months ago

So that way you did to get the parameters doesn't help. Those parameters should be sent in the anti-captcha API response. I opened a ticket with them, but I don't believe they will change their source code just to help us.

lpcs007 commented 8 months ago

Another way would be using a proxy API. In this case the proxy would be able to obtain these parameters.

https://anti-captcha.com/apidoc/task-types/FunCaptchaTask

But I don't have much knowledge with proxy

kayosctpk commented 8 months ago

Im getting ERROR:

ModuleNotFoundError: No module named 'anticaptchaofficial'

What I did wrong?

jaimbox commented 8 months ago

2. Install the library pip install python3-anticaptcha

Install the library pip3 install anticaptchaofficial

jaimbox commented 8 months ago

Im getting ERROR:

ModuleNotFoundError: No module named 'anticaptchaofficial'

What I did wrong?

Install the library pip3 install anticaptchaofficial

jack13021 commented 8 months ago

No module named 'anticaptchaofficial'

pip install anticaptchaofficial

jaimbox commented 8 months ago

No module named 'anticaptchaofficial'

pip install anticaptchaofficial

I am sorry for this. I have already corrected this.

lpcs007 commented 8 months ago

@jaimbox Support responded to my ticket with an interesting solution. https://anti-captcha.com/apidoc/task-types/AntiGateTask Type Amazon in the Template field and see the magic. πŸ₯Ή

jaimbox commented 8 months ago

@jaimbox Support responded to my ticket with an interesting solution. https://anti-captcha.com/apidoc/task-types/AntiGateTask Type Amazon in the Template field and see the magic. πŸ₯Ή

It really is magical. But I wonder, how do we get the Amazon uniqueValidationId? πŸ˜•

jaimbox commented 8 months ago

@jaimbox Support responded to my ticket with an interesting solution. https://anti-captcha.com/apidoc/task-types/AntiGateTask Type Amazon in the Template field and see the magic. πŸ₯Ή

When I pass it a "uniqueValidationId" it throws me this.


making request to createTask
could not create task
API error ERROR_TEMPLATE_NOT_FOUND: AntiGate template error. Template '2f42f853-d935-4e15-b2a8-266432d43fa6' not found
task finished with error ERROR_TEMPLATE_NOT_FOUND
lpcs007 commented 8 months ago

@jaimbox Support responded to my ticket with an interesting solution. https://anti-captcha.com/apidoc/task-types/AntiGateTask Type Amazon in the Template field and see the magic. πŸ₯Ή

When I pass it a "uniqueValidationId" it throws me this.


making request to createTask
could not create task
API error ERROR_TEMPLATE_NOT_FOUND: AntiGate template error. Template '2f42f853-d935-4e15-b2a8-266432d43fa6' not found
task finished with error ERROR_TEMPLATE_NOT_FOUND
from anticaptchaofficial.antigatetask import *

solver = antigateTask()
solver.set_verbose(1)
solver.set_key("YOUR_KEY")
solver.set_website_url("https://website.com/some/path")
solver.set_template_name("Amazon uniqueValidationId")
solver.set_variables({

})

result  = solver.solve_and_return_solution()
if result != 0:
    cookies, localStorage, fingerprint, url, domain = result["cookies"], result["localStorage"], result["fingerprint"], result["url"], result["domain"]
    print("cookies: ", cookies)
    print("localStorage: ", localStorage)
    print("fingerprint: ", fingerprint)
    print("url: "+url)
    print("domain: "+domain)
else:
    print("task finished with error "+solver.error_code)
jaimbox commented 8 months ago

@jaimbox Support responded to my ticket with an interesting solution. https://anti-captcha.com/apidoc/task-types/AntiGateTask Type Amazon in the Template field and see the magic. πŸ₯Ή

When I pass it a "uniqueValidationId" it throws me this.


making request to createTask
could not create task
API error ERROR_TEMPLATE_NOT_FOUND: AntiGate template error. Template '2f42f853-d935-4e15-b2a8-266432d43fa6' not found
task finished with error ERROR_TEMPLATE_NOT_FOUND
from anticaptchaofficial.antigatetask import *

solver = antigateTask()
solver.set_verbose(1)
solver.set_key("YOUR_KEY")
solver.set_website_url("https://website.com/some/path")
solver.set_template_name("Amazon uniqueValidationId")
solver.set_variables({

})

result  = solver.solve_and_return_solution()
if result != 0:
    cookies, localStorage, fingerprint, url, domain = result["cookies"], result["localStorage"], result["fingerprint"], result["url"], result["domain"]
    print("cookies: ", cookies)
    print("localStorage: ", localStorage)
    print("fingerprint: ", fingerprint)
    print("url: "+url)
    print("domain: "+domain)
else:
    print("task finished with error "+solver.error_code)

That's what I did and I got that error. πŸ‘€

lpcs007 commented 8 months ago

I'm not on computer right now. When I try I'll let you know.

jaimbox commented 8 months ago

I'm not on computer right now. When I try I'll let you know.

He had mixed things up. "Amazon uniqueValidationId" should stay the same, it has nothing to do with the uniqueValidationId value of the Header.

It works now.

lpcs007 commented 8 months ago

And tell me more, how is it working, does it return the necessary parameters or does it already send the parameters to validate the captcha automatically?