所以基本上我想使用2captcha API密钥并绕过Recaptcha。这纯粹是合法的,我的工作就像一个宏。不过这仅用于实验。如果我的实验成功,我愿意为帮助我的人付费。我只是一个初学者,所以请清楚解释。谢谢,如果有一种不用使用API密钥即可绕过Recaptcha本身的方法,我什至会很高兴 我的代码:
import time
import requests
import random
from threading import Thread
cookies = [line for line in list(set(open("cookies.txt", encoding="UTF-8", errors="ignore").read().splitlines()))]
used = 0
assest_id = 2994288765
added = 0
for x in cookies:
try:
combo,cookie = x.split(":_")
cookie = str("_"+cookie)
except ValueError:
cookie = x
with requests.Session() as (c):
used += 1
c.cookies['.ROBLOSECURITY'] = cookie
c.xsrf_token = ""
headers = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
"X-CSRF-TOKEN":c.xsrf_token}
req = c.post("https://www.roblox.com/api/item.ashx?rqtype=purchase&productID={productId}&expectedCurrency=1&expectedPrice={price}&expectedSellerID={sellerId}",
allow_redirects=False,headers=headers)
try:
c.xsrf_token = req.headers["X-CSRF-TOKEN"]
except KeyError:
print("Error")
headers = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
"X-CSRF-TOKEN":c.xsrf_token}
asd = c.post("https://web.roblox.com/v2/favorite/toggle",data={"itemTargetId":assest_id,"favoriteType":"Asset"},headers=headers)
if asd.status_code is 200:enter code here
added += 1
print(f"Added One Fav|Cookies Used:{used}|Added:{added}")
elif "login" in asd.text:
print("Invalid Cookie!") ```