Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anyone know how to send captcha solution? #438

Open
Nijneleven opened this issue Oct 2, 2024 · 8 comments
Open

Anyone know how to send captcha solution? #438

Nijneleven opened this issue Oct 2, 2024 · 8 comments

Comments

@Nijneleven
Copy link

I'm trying to solve the Challenge I'm facing when trying to generate new cookies. However im kind of stuck on how to send the captcha solution within a request.post.

First i just use the _do_authentication_request:
res = requests.post(
f"{Client.LINKEDIN_BASE_URL}/uas/authenticate",
data=payload,
cookies=self.session.cookies,
headers=Client.AUTH_REQUEST_HEADERS,
proxies=self.proxies,
)
data = res.json()

Then when i face a captcha i want to solve it using the challenge_url it gives. But how do i send the result back?
Do i need to make a request.session ? and what do i need to post in order to solve the captcha and retrieve the cookies properly?

I hope someone can tell me how to do this properly

@wladimiravila
Copy link

Hello, I tried to make a new request , something like this with no success:

res2 = requests.get(
data["challenge_url"]
headers=Client.AUTH_REQUEST_HEADERS,
#proxies=self.proxies)

all time return the not found linkedin page, any ideas?

@Nijneleven
Copy link
Author

You forgot to send the cookies and remove the #. it should look something like this:
res2 = requests.get(
data["challenge_url"]
cookies=res.cookies,
headers=Client.AUTH_REQUEST_HEADERS,
proxies=self.proxies,
)

LinkedIn either checks IP or cookies, or both for the checkpoints.

@wladimiravila
Copy link

Hi, I solved using brightdata proxies and initially creating the cookie in a specified location (cookies_dir='cookies/') with refresh_cookies = True

and after with the cookie using refresh_cookies=False (this avoid another attempt to authenticate)

api= Linkedin(email,password ,refresh_cookies=False, cookies_dir='cookies/', proxies=proxies)

@Nijneleven
Copy link
Author

Yes but eventually your cookies are going to expire or get flagged. Then you need to generate new ones and you need to do that on the same ip you logged in on. Then after a little while that ip is going to get flagged aswell

@bricefotzo
Copy link

Hi, I would like to use your solution but I'm not sure where to find this method: _do_authentication_request and AUTH_REQUEST_HEADERS . Can you explain me please?

@bricefotzo
Copy link

bricefotzo commented Oct 6, 2024

brightdata proxies

Are you paying for this one? Or is there a free alternative?

@Nijneleven
Copy link
Author

Add me on discord: nijneleven

@tomquirk
Copy link
Owner

@bricefotzo Brightdata is pretty cheap for moderate usage, give it a go here https://get.brightdata.com/v0qdnffggqeb (disclaimer, affiliate link).

@bricefotzo @Nijneleven come join the Discord if you like! https://discord.com/invite/hdd48NEB37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants