l4rm4nd / LinkedInDumper

Python 3 script to dump/scrape/extract company employees from LinkedIn API
https://hub.docker.com/r/l4rm4nd/linkedindumper
387 stars 42 forks source link

Private Profiles Requires an Authenticated Session Cookie #3

Closed g33k247 closed 1 year ago

g33k247 commented 1 year ago

When running the Docker container with the --include-private-profiles option, I receive the following error:

[!] Authenticated session cookie required..........] 1/20
    > Set variable permanently in script or use the '--session-cookie' CLI flag!
[debug] ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

The program exits.

Removing the --include-private-profiles option, I receive the following error:

[!] Authenticated session cookie required..........] 14/20
    > Set variable permanently in script or use the '--session-cookie' CLI flag!
[debug] ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
l4rm4nd commented 1 year ago

Check your network setup and may restart your docker service.

Also ensure that the provided authentication cookie is correct.

Docker container works fine for me and others. May share your company url to validate.

And yes, the tool requires a session cookie for all queries and cli params. There is no option to dump employees without having an authenticated LinkedIn user session.

g33k247 commented 1 year ago

But is it --cookie or is it --session-cookie as the error below implies:

> Set variable permanently in script or use the '--session-cookie' CLI flag!
[debug] ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
l4rm4nd commented 1 year ago

But is it --cookie or is it --session-cookie as the error below implies:

> Set variable permanently in script or use the '--session-cookie' CLI flag!
[debug] ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

Please read the readme or inspect the python script's help via -h.

The error message is a bit outdated but still holds true that you have to supply a session cookie. Use the cli param --cookie

g33k247 commented 1 year ago

Yes, the code needs to be updated to reduce confusion on the actual parameter to be passed on the CLI.

g33k247 commented 1 year ago

However, when I hardcode the session cookie into the script, I get a different result:

`` [!] Authenticated session cookie required.

Set variable permanently in script or use the '--session-cookie' CLI flag! [debug] Exceeded 30 redirects.

l4rm4nd commented 1 year ago

Yes, the code needs to be updated to reduce confusion on the actual parameter to be passed on the CLI.

I've fixed the print message when an error occurs. However, the GitHub's readme and the python script's help section is pretty straight forward.

You just have to pass your session cookie. Either via CLI or define it permanently in the python script. For the dockerized container I recommend the cli param, as you do not have access to the python script iself.

l4rm4nd commented 1 year ago

However, when I hardcode the session cookie into the script, I get a different result:

`` [!] Authenticated session cookie required.

Set variable permanently in script or use the '--session-cookie' CLI flag! [debug] Exceeded 30 redirects.

Guess you got rate limited due to too many failed tries. LinkedIn is redirecting all your requests, likely to the login page.

Check your cookie whether it is still authenticated. Relogin and grep a new cookie value or wait a bit for cooldown.