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

sso_cookies.py not working when "=" equals symbol is present #220

Closed
danielctrl opened this issue Jun 17, 2020 · 5 comments
Closed

sso_cookies.py not working when "=" equals symbol is present #220

danielctrl opened this issue Jun 17, 2020 · 5 comments

Comments

@danielctrl
Copy link

After trying to use the sso_cookies.py to crate the cookies.json file, it couldn't authenticate due to an issue in the JSON creation.

When the following pattern is present (I have omitted the rest of the cookies and formated the JSON for obvious reason):
{ "_dd_s":"rum=1&expire=111", "_fbp":"fb.1.111.111" }

It is converting to:
{ "_dd_s:rum": "1&expire=111,_fbp:fb.1.111.111" }

Some additional info:

  • The original JSON was extracted from Firefox's network tab, as indicated in the Elrob's commentary
  • I called the command in PowerShell, using the following sintax: python3 sso_cookies.py '"_dd_s":"rum=1&expire=111.......'
@gusleyva
Copy link

gusleyva commented Jun 25, 2020

Hi!
I did it today and it worked, just to double-check,
From your web browser:

  • Open devs tools
  • Navigate to Network tab
  • Find the cookie, this can be found from the header tab, scroll down until you find where it says "cookie" or to the cookies tab, copy all of the
    I.e. "cookie: BrowserCookie=123123123123-123123-123123-123123; _vwo_uuid_v2=12312313123; ......."

From your command line, navigate where you have the safaribooks project

  • cd safaribboks
    Use the following command and the parameter should be the cookie adding " to the beginning and to the end.
  • python3 sso_cookies.py "cookie: BrowserCookie=123123123123-123123-123123-123123; _vwo_uuid_v2=12312313123; ......."
    If everything is ok you will see:
    $ Done! Cookie Jar saved into cookies.json. Now you can run safaribooks.py without the --cred argument...

Now execute the initial command from the basic instructions
I.e. python3 safaribooks.py [bookId]
$ python3 safaribooks.py 123123123123

That worked for me.

@edimoral
Copy link

edimoral commented Jul 16, 2020

Hi!
I did today and it worked, just to double-check,
From your web browser:

  • Open devs tools
  • Navigate to Network tab
  • Find the cookie, this can be found from the header tab, scroll down until you find where it says "cookie" or to the cookies tab, copy all of the
    I.e. "cookie: BrowserCookie=123123123123-123123-123123-123123; _vwo_uuid_v2=12312313123; ......."

From your command line, navigate where you have the safaribooks project

  • cd safaribboks
    Use the following command and the parameter should be the cookie adding " to the beginning and to the end.
  • python3 sso_cookies.py "cookie: BrowserCookie=123123123123-123123-123123-123123; _vwo_uuid_v2=12312313123; ......."
    If everything is ok you will see:
    $ Done! Cookie Jar saved into cookies.json. Now you can run safaribooks.py without the --cred argument...

Now execute the initial command from the basic instructions
I.e. python3 safaribooks.py [bookId]
$ python3 safaribooks.py 123123123123

That worked for me.

I followed your instructions and I can confirm it worked. I was using Firefox. I copy all the values of cookie tab, change the format from "key":"value","key":"value",... to key=value;key=value;... and pasted all the string in oss_cookies.py to generate the cookies.json file.

Thanks a lot.

@MuhammedElGanzory
Copy link

How to solve that error !!
Traceback (most recent call last):
File "sso_cookies.py", line 13, in
import safaribooks
File "C:\Users*****\Desktop\safaribooks\safaribooks.py", line 12, in
import requests
ModuleNotFoundError: No module named 'requests'

@gusleyva
Copy link

How to solve that error !!
Traceback (most recent call last):
File "sso_cookies.py", line 13, in
import safaribooks
File "C:\Users*****\Desktop\safaribooks\safaribooks.py", line 12, in
import requests
ModuleNotFoundError: No module named 'requests'

That is a python dependency/library, "download" requests:
$ sudo pip install requests (or pip3 install requests for python3) if you have pip installed.

If pip is installed but not in your path you can use
python -m pip install requests (or python3 -m pip install requests for python3)

@lorenzodifuccia
Copy link
Owner

Please read the README.md.
This is a Python3 program!

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

No branches or pull requests

5 participants