mdesilva / AmazonFlexUnlimited

Automate the process of grabbing job blocks from Amazon Flex
147 stars 98 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.

jaimbox commented 9 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?

This is the response.

cookies:  {'session-id': '135-7048695-4721108', 'session-id-time': '2082787201l', 'JSESSIONID': '6297E01A12FA66248D7BCA10F7464035', 'ubid-main': '130-0261579-7385327', 'session-token': '"I4TyrSUnSQ6vz4/N4KdEyze+Uho4FA5lrYaKqEqgb1HUqr0z1mCQ7HHPBy9kL1G1FJamgfSEbeuAdUUB1H+1WtoJTBUSFT/sFgXdP0nrJtH4JzNCnicmqw+NkA8qh3mETzOi99WYsb0tcHvIa44g7+BjB5u37rutf3tlt0bctsHfuGyPp+fS4voTeXKapvu35A1LFIunfu640HGNsfxvAJb+wDiWvQilrlzo7miIAnw="', 'i18n-prefs': 'USD', 'sp-cdn': '"L5Z9:PK"', 'skin': 'noskin', 'csm-hit': 'tb:s-JBGN8XZBCXQZT3HZD527|1691819222988&t:1691819223932&adb:adblk_no'}
localStorage:  {'csm-hit': 'tb:s-JBGN8XZBCXQZT3HZD527|1691819222988&t:1691819223932&adb:adblk_no', 'csm:adb': 'adblk_no', 'csm-bf': '["JBGN8XZBCXQZT3HZD527"]', 'csa-ctoken-JBGN8XZBCXQZT3HZD527': '1691822823752', 'csa-tabbed-browsing': '{"lastActive":{"visible":true,"pid":"npkbrg-vyr8cg-fzovcv-u4c4zv","tid":"npkbrg-vyr8cg-fzovcv-u4c4zv"},"lastInteraction":{},"time":1691819223754}', 'a-font-class': 'a-ember'}
fingerprint:  {'self.navigator.userAgent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36', 'self.screen.width': 1366, 'self.screen.height': 1366, 'self.screen.availWidth': 1366, 'self.screen.availHeight': 738, 'self.screen.availLeft': '', 'self.screen.availTop': '', 'self.navigator.vendorSub': '', 'self.navigator.productSub': '20030107', 'self.navigator.vendor': 'Google Inc.', 'self.navigator.maxTouchPoints': 5, 'self.navigator.hardwareConcurrency': 8, 'self.navigator.cookieEnabled': True, 'self.navigator.appCodeName': 'Mozilla', 'self.navigator.appName': 'Netscape', 'self.navigator.appVersion': '5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36', 'self.navigator.platform': 'Linux armv81', 'self.navigator.product': 'Gecko', 'self.navigator.language': 'en-US', 'self.navigator.onLine': True, 'self.navigator.doNotTrack': '', 'self.navigator.deviceMemory': 4}
url: https://www.amazon.com/?clientId=flex-offers&sessionToken=%7B%22uniqueValidationId%22%3A%224516ddac-2c46-4eb3-af52-ea98b7b485ba%22%7D
domain: www.amazon.com
lpcs007 commented 9 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?

This is the response.

cookies:  {'session-id': '135-7048695-4721108', 'session-id-time': '2082787201l', 'JSESSIONID': '6297E01A12FA66248D7BCA10F7464035', 'ubid-main': '130-0261579-7385327', 'session-token': '"I4TyrSUnSQ6vz4/N4KdEyze+Uho4FA5lrYaKqEqgb1HUqr0z1mCQ7HHPBy9kL1G1FJamgfSEbeuAdUUB1H+1WtoJTBUSFT/sFgXdP0nrJtH4JzNCnicmqw+NkA8qh3mETzOi99WYsb0tcHvIa44g7+BjB5u37rutf3tlt0bctsHfuGyPp+fS4voTeXKapvu35A1LFIunfu640HGNsfxvAJb+wDiWvQilrlzo7miIAnw="', 'i18n-prefs': 'USD', 'sp-cdn': '"L5Z9:PK"', 'skin': 'noskin', 'csm-hit': 'tb:s-JBGN8XZBCXQZT3HZD527|1691819222988&t:1691819223932&adb:adblk_no'}
localStorage:  {'csm-hit': 'tb:s-JBGN8XZBCXQZT3HZD527|1691819222988&t:1691819223932&adb:adblk_no', 'csm:adb': 'adblk_no', 'csm-bf': '["JBGN8XZBCXQZT3HZD527"]', 'csa-ctoken-JBGN8XZBCXQZT3HZD527': '1691822823752', 'csa-tabbed-browsing': '{"lastActive":{"visible":true,"pid":"npkbrg-vyr8cg-fzovcv-u4c4zv","tid":"npkbrg-vyr8cg-fzovcv-u4c4zv"},"lastInteraction":{},"time":1691819223754}', 'a-font-class': 'a-ember'}
fingerprint:  {'self.navigator.userAgent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36', 'self.screen.width': 1366, 'self.screen.height': 1366, 'self.screen.availWidth': 1366, 'self.screen.availHeight': 738, 'self.screen.availLeft': '', 'self.screen.availTop': '', 'self.navigator.vendorSub': '', 'self.navigator.productSub': '20030107', 'self.navigator.vendor': 'Google Inc.', 'self.navigator.maxTouchPoints': 5, 'self.navigator.hardwareConcurrency': 8, 'self.navigator.cookieEnabled': True, 'self.navigator.appCodeName': 'Mozilla', 'self.navigator.appName': 'Netscape', 'self.navigator.appVersion': '5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36', 'self.navigator.platform': 'Linux armv81', 'self.navigator.product': 'Gecko', 'self.navigator.language': 'en-US', 'self.navigator.onLine': True, 'self.navigator.doNotTrack': '', 'self.navigator.deviceMemory': 4}
url: https://www.amazon.com/?clientId=flex-offers&sessionToken=%7B%22uniqueValidationId%22%3A%224516ddac-2c46-4eb3-af52-ea98b7b485ba%22%7D
domain: www.amazon.com

Was that url parameter at the end informed by you or is it from the API? If it's from the API, I believe it has already sent the return to Amazon. Just test if the captcha passed.

jaimbox commented 9 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?

This is the response.

cookies:  {'session-id': '135-7048695-4721108', 'session-id-time': '2082787201l', 'JSESSIONID': '6297E01A12FA66248D7BCA10F7464035', 'ubid-main': '130-0261579-7385327', 'session-token': '"I4TyrSUnSQ6vz4/N4KdEyze+Uho4FA5lrYaKqEqgb1HUqr0z1mCQ7HHPBy9kL1G1FJamgfSEbeuAdUUB1H+1WtoJTBUSFT/sFgXdP0nrJtH4JzNCnicmqw+NkA8qh3mETzOi99WYsb0tcHvIa44g7+BjB5u37rutf3tlt0bctsHfuGyPp+fS4voTeXKapvu35A1LFIunfu640HGNsfxvAJb+wDiWvQilrlzo7miIAnw="', 'i18n-prefs': 'USD', 'sp-cdn': '"L5Z9:PK"', 'skin': 'noskin', 'csm-hit': 'tb:s-JBGN8XZBCXQZT3HZD527|1691819222988&t:1691819223932&adb:adblk_no'}
localStorage:  {'csm-hit': 'tb:s-JBGN8XZBCXQZT3HZD527|1691819222988&t:1691819223932&adb:adblk_no', 'csm:adb': 'adblk_no', 'csm-bf': '["JBGN8XZBCXQZT3HZD527"]', 'csa-ctoken-JBGN8XZBCXQZT3HZD527': '1691822823752', 'csa-tabbed-browsing': '{"lastActive":{"visible":true,"pid":"npkbrg-vyr8cg-fzovcv-u4c4zv","tid":"npkbrg-vyr8cg-fzovcv-u4c4zv"},"lastInteraction":{},"time":1691819223754}', 'a-font-class': 'a-ember'}
fingerprint:  {'self.navigator.userAgent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36', 'self.screen.width': 1366, 'self.screen.height': 1366, 'self.screen.availWidth': 1366, 'self.screen.availHeight': 738, 'self.screen.availLeft': '', 'self.screen.availTop': '', 'self.navigator.vendorSub': '', 'self.navigator.productSub': '20030107', 'self.navigator.vendor': 'Google Inc.', 'self.navigator.maxTouchPoints': 5, 'self.navigator.hardwareConcurrency': 8, 'self.navigator.cookieEnabled': True, 'self.navigator.appCodeName': 'Mozilla', 'self.navigator.appName': 'Netscape', 'self.navigator.appVersion': '5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36', 'self.navigator.platform': 'Linux armv81', 'self.navigator.product': 'Gecko', 'self.navigator.language': 'en-US', 'self.navigator.onLine': True, 'self.navigator.doNotTrack': '', 'self.navigator.deviceMemory': 4}
url: https://www.amazon.com/?clientId=flex-offers&sessionToken=%7B%22uniqueValidationId%22%3A%224516ddac-2c46-4eb3-af52-ea98b7b485ba%22%7D
domain: www.amazon.com

Was that url parameter at the end informed by you or is it from the API? If it's from the API, I believe it has already sent the return to Amazon. Just test if the captcha passed.

Everything was returned by anticaptchaofficial.

lpcs007 commented 9 months ago

So I believe it has already sent the token to Amazon. Now test if you can grab the block.

jaimbox commented 9 months ago

So I believe it has already sent the token to Amazon. Now test if you can grab the block.

I keep getting the Captcha when trying to grab a block.

I think that to finish the process, the request must be made with everything that the anticaptchaofficial returns (cookies, localStorage, fingerprint).

kayosctpk commented 9 months ago

So I believe it has already sent the token to Amazon. Now test if you can grab the block.

I keep getting the Captcha when trying to grab a block.

I think that to finish the process, the request must be made with everything that the anticaptchaofficial returns (cookies, localStorage, fingerprint).

mine is getting erro with 5 different works too,

i'm not expert with it, so can you post the full code here if you get it work?

kayosctpk commented 9 months ago

So I believe it has already sent the token to Amazon. Now test if you can grab the block.

I keep getting the Captcha when trying to grab a block. I think that to finish the process, the request must be made with everything that the anticaptchaofficial returns (cookies, localStorage, fingerprint).

mine is getting erro with 5 different works too,

i'm not expert with it, so can you post the full code here if you get it work?

ignore this, its working now, but Im stuck on same process yours, keep getting captcha after its solved. :(

jack13021 commented 9 months ago

Good morning. Have you had any progress on the solution?

kayosctpk commented 9 months ago

@lpcs007 any progress?

lpcs007 commented 9 months ago

I still haven't found a solution. Maybe @jaimbox

kayosctpk commented 9 months ago

@lpcs007 Are you brazilian? cuz I saw some brazilian project that you working here at git.

kayosctpk commented 9 months ago

I still haven't found a solution. Maybe @jaimbox

@jaimbox help us :)

lpcs007 commented 9 months ago

@lpcs007 Are you brazilian? cuz I saw some brazilian project that you working here at git.

Yes, I'm.

jaimbox commented 9 months ago

Hi guys, I'm doing tests with my personal account, I kept receiving the Captcha but I didn't want to overload it and I let it rest for 2 days.

So far I'm not getting the Captcha, but I'm not sure it worked.

I have a theory how it works according to the requests that are made from the mobile when solving the captcha manually.

jaimbox commented 9 months ago

A request must be made with the data returned from anticaptchaofficial.

requests.get(url, headers=headers, cookies=cookies)

Then another Request is sent.

url = "https://flex-capacity-na.amazon.com/ValidateChallenge"
payload = json.dumps({
    "challengeToken": "{\"uniqueValidationId\":\"" + uniqueValidationId + "\"}"
})
headers = {
    'x-amz-access-token': xAmzAccessToken,
}
response = requests.request("POST", url, headers=headers, data=payload)

Then we cross our fingers that it works. 🥵

kayosctpk commented 9 months ago

A request must be made with the data returned from anticaptchaofficial.

requests.get(url, headers=headers, cookies=cookies)

Then another Request is sent.

url = "https://flex-capacity-na.amazon.com/ValidateChallenge"
payload = json.dumps({
    "challengeToken": "{\"uniqueValidationId\":\"" + uniqueValidationId + "\"}"
})
headers = {
    'x-amz-access-token': xAmzAccessToken,
}
response = requests.request("POST", url, headers=headers, data=payload)

Then we cross our fingers that it works. 🥵

can you post the full code? because I couldn't make it work here

gmcsnetwork commented 9 months ago

Hi guys, I'm doing tests with my personal account, I kept receiving the Captcha but I didn't want to overload it and I let it rest for 2 days.

So far I'm not getting the Captcha, but I'm not sure it worked.

I have a theory how it works according to the requests that are made from the mobile when solving the captcha manually.

I have experienced a similar behavior without any modifications to the script. After continuously getting the Captcha, I stop using the script for a couple of days, it works for a day or so before I start getting the Captcha again.

jack13021 commented 9 months ago

A request must be made with the data returned from anticaptchaofficial.

requests.get(url, headers=headers, cookies=cookies)

Then another Request is sent.

url = "https://flex-capacity-na.amazon.com/ValidateChallenge"
payload = json.dumps({
    "challengeToken": "{\"uniqueValidationId\":\"" + uniqueValidationId + "\"}"
})
headers = {
    'x-amz-access-token': xAmzAccessToken,
}
response = requests.request("POST", url, headers=headers, data=payload)

Then we cross our fingers that it works. 🥵

can you post the full code? Please

jack13021 commented 9 months ago

A request must be made with the data returned from anticaptchaofficial.

requests.get(url, headers=headers, cookies=cookies)

Then another Request is sent.

url = "https://flex-capacity-na.amazon.com/ValidateChallenge"
payload = json.dumps({
    "challengeToken": "{\"uniqueValidationId\":\"" + uniqueValidationId + "\"}"
})
headers = {
    'x-amz-access-token': xAmzAccessToken,
}
response = requests.request("POST", url, headers=headers, data=payload)

Then we cross our fingers that it works. 🥵

any progress? can you post the full code? Please

jaimbox commented 9 months ago

Until now no Anti-Captcha provider guarantees the solution of the Captchas, they work manually, they pay pennies to other people to solve the Captcha and the response time can be extended a lot, in some cases they return an error.

I think that the Captcha must be solved manually. Make an API that receives the detected Captcha notice while the script waits for the "uniqueValidationId" to solve the Captcha and send the response.

zmkaihan commented 8 months ago

How to dynamically receive new headers "Authorization and cookies" for each request please give me an idea I need to implement this on my code. @lpcs007 @jaimbox

lpcs007 commented 8 months ago

as @jaimbox said, so far there is no solution to pass the captcha automatically. the anti-captcha was an attempt to pass the captcha, but it is very unstable because it takes a long time and is not always able to pass. I'm currently using the fork https://github.com/simonpacis/AmazonFlexUnlimitedSUPERCHARGED because it has ntfy notification and other improvements. it notifies me when I need to pass some captcha and then I do it manually through the flex app. The only change I made was putting the script to sleep instead of exiting the script. I explained here how: https://github.com/simonpacis/AmazonFlexUnlimitedSUPERCHARGED/issues/4#issuecomment-1676472468.

Vasa211 commented 8 months ago

@jaimbox your code working now? Because I all time receiving ERROR_CAPTCHA_UNSOLVABLE

lpcs007 commented 8 months ago

Does anyone know what proxy program I can use to get the URL and parameters sent by the app to the server?I tried using Proxyman and Charles Proxy, but it doesn't show the full path nor the parameters sent due to secure connection. I tried installing the SSL provided by the program, but for it to work I need to be the app developer. How can you get this data?

jaimbox commented 8 months ago

Does anyone know what proxy program I can use to get the URL and parameters sent by the app to the server?I tried using Proxyman and Charles Proxy, but it doesn't show the full path nor the parameters sent due to secure connection. I tried installing the SSL provided by the program, but for it to work I need to be the app developer. How can you get this data?

You can to use https://mitmproxy.org

lpcs007 commented 8 months ago

@jaimbox

I passed the captcha successfully! I finally did it!! thanks for your help.

      print("Trying bypass captcha.")

      solver = antigateTask()
      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_2&returnTo=https://www.amazon.com&headerFooter=false")
      solver.set_template_name("Amazon uniqueValidationId")
      solver.set_variables({})

      result  = solver.solve_and_return_solution()
      if result != 0:
          requests.get(result["url"], cookies=result["cookies"])

          parsed_url = urlparse(result["url"])
          query_params = parse_qs(parsed_url.query)
          session_token = query_params.get('sessionToken', [None])[0]
          decoded_session_token = unquote(session_token)

          payload = json.dumps({
              'challengeToken': decoded_session_token
          })
          requests.request("POST", "https://flex-capacity-na.amazon.com/ValidateChallenge", headers=self.__requestHeaders, data=payload)

          print("Captcha passed!")
      else:
          print("Task finished with error" + solver.error_code)
          time.sleep( 30 )
zmkaihan commented 8 months ago

@lpcs007 how long will it take to pass the captcha and if the first time result == 0: then do we have to re-call this code to solve the captcha?

Vasa211 commented 8 months ago

@lpcs007 how long will it take to pass the captcha and if the first time result == 0: then do we have to re-call this code to solve the captcha?

from 15sec to 1 min. If you need, after result=0, you can check error answer and sent it again

Vasa211 commented 8 months ago

@jaimbox

I passed the captcha successfully! I finally did it!! thanks for your help.

      print("Trying bypass captcha.")

      solver = antigateTask()
      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_2&returnTo=https://www.amazon.com&headerFooter=false")
      solver.set_template_name("Amazon uniqueValidationId")
      solver.set_variables({})

      result  = solver.solve_and_return_solution()
      if result != 0:
          requests.get(result["url"], cookies=result["cookies"])

          parsed_url = urlparse(result["url"])
          query_params = parse_qs(parsed_url.query)
          session_token = query_params.get('sessionToken', [None])[0]
          decoded_session_token = unquote(session_token)

          payload = json.dumps({
              'challengeToken': decoded_session_token
          })
          requests.request("POST", "https://flex-capacity-na.amazon.com/ValidateChallenge", headers=self.__requestHeaders, data=payload)

          print("Captcha passed!")
      else:
          print("Task finished with error" + solver.error_code)
          time.sleep( 30 )

How do you know it works? Did you really check it and the captcha is gone? In your request "requests.get(result["url"], cookies=result["cookies"])" the server response 503 error! I don't even know if the next request makes sense

Vasa211 commented 8 months ago

@jaimbox I passed the captcha successfully! I finally did it!! thanks for your help.

      print("Trying bypass captcha.")

      solver = antigateTask()
      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_2&returnTo=https://www.amazon.com&headerFooter=false")
      solver.set_template_name("Amazon uniqueValidationId")
      solver.set_variables({})

      result  = solver.solve_and_return_solution()
      if result != 0:
          requests.get(result["url"], cookies=result["cookies"])

          parsed_url = urlparse(result["url"])
          query_params = parse_qs(parsed_url.query)
          session_token = query_params.get('sessionToken', [None])[0]
          decoded_session_token = unquote(session_token)

          payload = json.dumps({
              'challengeToken': decoded_session_token
          })
          requests.request("POST", "https://flex-capacity-na.amazon.com/ValidateChallenge", headers=self.__requestHeaders, data=payload)

          print("Captcha passed!")
      else:
          print("Task finished with error" + solver.error_code)
          time.sleep( 30 )

How do you know it works? Did you really check it and the captcha is gone?

In your request "requests.get(result["url"], cookies=result["cookies"])" the server response 503 error!

I don't even know if the next request makes sense

lpcs007 commented 8 months ago

@jaimbox I passed the captcha successfully! I finally did it!! thanks for your help.

      print("Trying bypass captcha.")

      solver = antigateTask()
      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_2&returnTo=https://www.amazon.com&headerFooter=false")
      solver.set_template_name("Amazon uniqueValidationId")
      solver.set_variables({})

      result  = solver.solve_and_return_solution()
      if result != 0:
          requests.get(result["url"], cookies=result["cookies"])

          parsed_url = urlparse(result["url"])
          query_params = parse_qs(parsed_url.query)
          session_token = query_params.get('sessionToken', [None])[0]
          decoded_session_token = unquote(session_token)

          payload = json.dumps({
              'challengeToken': decoded_session_token
          })
          requests.request("POST", "https://flex-capacity-na.amazon.com/ValidateChallenge", headers=self.__requestHeaders, data=payload)

          print("Captcha passed!")
      else:
          print("Task finished with error" + solver.error_code)
          time.sleep( 30 )

How do you know it works? Did you really check it and the captcha is gone?

In your request "requests.get(result["url"], cookies=result["cookies"])" the server response 503 error!

I don't even know if the next request makes sense

Try showing the captcha return output with print(result)

vtdeleond commented 8 months ago

Try to no abuse of this. I'm using my own approach in Java to grab blocks and I implemented this way to solve Captcha, I got an email from Amazon for bot usage. Never happened before with my own script.

I deactivated this. Anyway it takes more than 20 seconds to solve.

zmkaihan commented 8 months ago

@lpcs007 can you help me with how to use proxy servers or rotating IP addresses to avoid IP-based restrictions or rate limiting when making requests to get offers? Any idea will be really appreciated

liulinglll commented 8 months ago

@jaimbox

I passed the captcha successfully! I finally did it!! thanks for your help.

      print("Trying bypass captcha.")

      solver = antigateTask()
      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_2&returnTo=https://www.amazon.com&headerFooter=false")
      solver.set_template_name("Amazon uniqueValidationId")
      solver.set_variables({})

      result  = solver.solve_and_return_solution()
      if result != 0:
          requests.get(result["url"], cookies=result["cookies"])

          parsed_url = urlparse(result["url"])
          query_params = parse_qs(parsed_url.query)
          session_token = query_params.get('sessionToken', [None])[0]
          decoded_session_token = unquote(session_token)

          payload = json.dumps({
              'challengeToken': decoded_session_token
          })
          requests.request("POST", "https://flex-capacity-na.amazon.com/ValidateChallenge", headers=self.__requestHeaders, data=payload)

          print("Captcha passed!")
      else:
          print("Task finished with error" + solver.error_code)
          time.sleep( 30 )

this doesn't work. check status_code of ur requests. also none of those captcha service works as amazon logs IPs. when you send challengeToken back basically you are telling amazon you are using bots.

Vasa211 commented 8 months ago

Try showing the captcha return output with print(result)

What you mean? I do this, and this is dont work, because you send only uniqueValidationId, but amazon app send many another data

Vasa211 commented 8 months ago

@lpcs007 can you help me with how to use proxy servers or rotating IP addresses to avoid IP-based restrictions or rate limiting when making requests to get offers? Any idea will be really appreciated

My opinion is that this is a bad idea. Just use a nice clean ip and you won't get an ip ban.

Vasa211 commented 8 months ago

@jaimbox I passed the captcha successfully! I finally did it!! thanks for your help.

      print("Trying bypass captcha.")

      solver = antigateTask()
      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_2&returnTo=https://www.amazon.com&headerFooter=false")
      solver.set_template_name("Amazon uniqueValidationId")
      solver.set_variables({})

      result  = solver.solve_and_return_solution()
      if result != 0:
          requests.get(result["url"], cookies=result["cookies"])

          parsed_url = urlparse(result["url"])
          query_params = parse_qs(parsed_url.query)
          session_token = query_params.get('sessionToken', [None])[0]
          decoded_session_token = unquote(session_token)

          payload = json.dumps({
              'challengeToken': decoded_session_token
          })
          requests.request("POST", "https://flex-capacity-na.amazon.com/ValidateChallenge", headers=self.__requestHeaders, data=payload)

          print("Captcha passed!")
      else:
          print("Task finished with error" + solver.error_code)
          time.sleep( 30 )

this doesn't work. check status_code of ur requests. also none of those captcha service works as amazon logs IPs. when you send challengeToken back basically you are telling amazon you are using bots.

You can used proxy, but I think this code dont work

liulinglll commented 8 months ago

Try showing the captcha return output with print(result)

What you mean? I do this, and this is dont work, because you send only uniqueValidationId, but amazon app send many another data

other data don't matter but he sends challengeToken in wrong format...

anyway you must solve captcha on the same machine which runs bots to match request IPs. otherwise deactivation is coming.

zmkaihan commented 8 months ago

@Vasa211 I am running my scripts for multiple users and requesting Amazon from one IP is not a good idea so I want to have individual IPs for each users that's why I want to use proxy server to rotate my IPs for each user

Vasa211 commented 8 months ago

must solve captcha on the same machine which runs bots

you can send same proxy for anti-captcha

@Vasa211 I am running my scripts for multiple users and requesting Amazon from one IP is not a good idea so I want to have individual IPs for each users that's why I want to use proxy server to rotate my IPs for each user

Create own proxys

Vasa211 commented 8 months ago

you must solve captcha on the same machine

What about proxies?

liulinglll commented 8 months ago

you must solve captcha on the same machine

What about proxies?

c'mon you think those human processor gonna use ur proxy to open captcha link......that's what matters

Vasa211 commented 8 months ago

you must solve captcha on the same machine

What about proxies?

c'mon you think those human processor gonna use ur proxy to open captcha link......that's what matters

you can add proxies to python library, and the system will install them by itself, the person who solves it doesn't even know about it.

lpcs007 commented 8 months ago

I don't know what you guys are doing wrong, but mine worked like a charm. If you don't want to believe it, continue as you were using it and that's fine.

Only today my bot grabbed 3 blocks for next week. The captcha has been resolved automatically several times.

lpcs007 commented 8 months ago

Enjoy https://github.com/lpcs007/AmazonFlexUnlimitedSUPERCHARGED

jczapatap commented 8 months ago

I just get this error

Traceback (most recent call last): File "/root/Captcha/app.py", line 2, in from lib.FlexUnlimited import FlexUnlimited File "/root/Captcha/lib/FlexUnlimited.py", line 13, in from anticaptchaofficial.antigatetask import * ModuleNotFoundError: No module named 'anticaptchaofficial'

On Sun, Sep 10, 2023 at 1:10 AM lpcs007 @.***> wrote:

Enjoy https://github.com/lpcs007/AmazonFlexUnlimitedSUPERCHARGED

— Reply to this email directly, view it on GitHub https://github.com/mdesilva/AmazonFlexUnlimited/issues/144#issuecomment-1712714351, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6V47K2VMCU3643CVT56S43XZVDTZANCNFSM6AAAAAA3ERUU7M . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jczapatap commented 8 months ago

Where is the Library??

On Sun, Sep 10, 2023 at 1:10 AM lpcs007 @.***> wrote:

Enjoy https://github.com/lpcs007/AmazonFlexUnlimitedSUPERCHARGED

— Reply to this email directly, view it on GitHub https://github.com/mdesilva/AmazonFlexUnlimited/issues/144#issuecomment-1712714351, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6V47K2VMCU3643CVT56S43XZVDTZANCNFSM6AAAAAA3ERUU7M . You are receiving this because you are subscribed to this thread.Message ID: @.***>

lpcs007 commented 8 months ago

You need install the library anticaptchaofficial

jczapatap commented 8 months ago

thank you I realized I just did the pip install requirement, thank you for share bro...!!

On Sun, Sep 10, 2023 at 12:50 PM lpcs007 @.***> wrote:

You need install the library anticaptchaofficial

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

lovespot commented 8 months ago

I don't know what you guys are doing wrong, but mine worked like a charm. If you don't want to believe it, continue as you were using it and that's fine.

Only today my bot grabbed 3 blocks for next week. The captcha has been resolved automatically several times.

your solving is successful but submitting id to amazon failed. add codes below you'll see amazon rejects your submissions. also as other guys mentioned you are not using proxy to match IPs so guaranteed to get deactivated.

x = requests.get(result["url"], cookies=result["cookies"]) print(x.status_code) print(x.text)

y = requests.request("POST", "https://flex-capacity-na.amazon.com/ValidateChallenge", headers=self.__requestHeaders, data=payload) print(y.status_code) print(y.text)