-
Notifications
You must be signed in to change notification settings - Fork 94
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
Login fails #127
Comments
Same here, it says |
/site-packages/fpl/fpl.py) in login(self, email, password) |
Same, seems like its an auth issue. API requires a Cookie now. |
@spiros26 @ivarbratberg,
Use the code snippet in custom_cookie = {
'pl_profile': "",
'datadome': ""
}
headers = {
"User-Agent": "Dalvik/2.1.0 (Linux; U; Android 5.1; PRO 5 Build/LMY47D)"
}
async with self.session.post(login_url, data=payload,
ssl=ssl_context,
cookies=custom_cookie,
headers=headers) as response:
if 'state' not in response.url.query:
raise ValueError(f"Unsuccessful login: {response.status_code}")
state = response.url.query["state"]
if state == "fail":
reason = response.url.query["reason"]
raise ValueError(f"Login not successful, reason: {reason}") |
I released a new version a few days ago that included #126
So maybe you can try that out? |
I'm having a very hard time figuring out how to put a cookie into an environment variable. Do I format it as json? |
I tried to set the variables like this in fply.py, but I got a 403.
I ensured code change was active and latest package.
cookie = '{ "pl_profile": "eyJzIjogIld6SXNOa....=", "datadome": "1UF....."}'
if not cookie:
raise Exception('No coolies provided')
cookie = os.getenv('FPL_COOKIE')
headers = {
"User-Agent": "Dalvik/2.1.0 (Linux; U; Android 5.1; PRO 5
Build/LMY47D)",
…On Fri, Aug 18, 2023 at 9:58 AM kernalkue ***@***.***> wrote:
I'm having a very hard time figuring out how to put a cookie into an
environment variable. Do I format it as json?
—
Reply to this email directly, view it on GitHub
<#127 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADY74A2U4275J4D364KJQVDXV4OC3ANCNFSM6AAAAAA25PDQPY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Any hope for a solution here? |
The only solution is to use a selenium bot to login, but it's not effective because the fpl webapp uses datadome for bot detection. |
@ThatPalAl
|
@Tonio101 |
You need to add the values of the cookies after the equals character. So would be: cookie = """datadome=STRING_VALUE_OF_DATADTOME;pl_profile=STRING_VALUE_OF_PL_PROFILE""" |
I can't get the login function to work. Maybe fpl has changed something and the headers don't work?
The text was updated successfully, but these errors were encountered: