-
Notifications
You must be signed in to change notification settings - Fork 695
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
Cookies.json format #2
Comments
Sure! {"sessionid": "28cb00fc5fefca1c33677383b7c2499f", "salesforce_id": "c22b5131a048c89949719ddfc77a9401", "csrfsafari": "NAowChgKB1Nwb3RpZnkSABoGmAEByAEB", "original_referer": "\"https://www.safaribooksonline.com/home/\"", "BrowserCookie": "c6691600-bbf6-4c96-b721-af081ff879d8", "corp_sessionid": "f2be05e433a0e5883920f34bcf3ce83a", "logged_in": "y"} 👍 |
Thank you ! |
(and it works ! ) (after setting "locale" to UTF8) |
Perfect!! Thanks for the issue. |
One fast way to get the cookie: |
Bookmarlet version of @anhhh11 script javascript:(function(){var output = {};document.cookie.split(/\s*;\s*/).forEach(function(pair) {pair = pair.split(/\s*=\s*/);output[pair[0]]=pair.splice(1).join('=');});console.log(JSON.stringify(output));})(); |
Bookmarlet generate cookies.json javascript:(function(){var output={};document.cookie.split(/\s*;\s*/).forEach(function(pair){pair=pair.split(/\s*=\s*/);output[pair[0]]=pair.splice(1).join('=')});var a=window.document.createElement('a');a.href=window.URL.createObjectURL(new Blob([JSON.stringify(output)],{type:'text/json'}));a.download='cookies.json';document.body.appendChild(a);a.click();document.body.removeChild(a)})() |
SSO is working. |
i tried, but nothing works |
Hi how can I specify the cookies file in the command line? |
@tdnghia98: Just copy cookies.json to the same folder as safaribooks.py an run this file. |
@neogta How or where do you set the locale? |
Either this is saving the JSON file with correct UTF-8 encoding or system locale - https://www.tecmint.com/set-system-locales-in-linux/ Do you get any errors? |
I am getting this error even after using cookies.json
|
Make sure that the content of the cookie file looks properly. In the browser console run: |
does this still work? I get: @dkuzma2 what did you edit in the cookies.json? Update: I fixed it by changing the script to connect to a different url of oreilly. |
Hi @antrianis Would you mind to tell us what url have you changed in the script? Regards! |
diff --git a/safaribooks.py b/safaribooks.py
index 95c13a3..1ec707e 100644
--- a/safaribooks.py
+++ b/safaribooks.py
@@ -29,6 +29,7 @@ ORLY_BASE_URL = "https://www." + ORLY_BASE_HOST
SAFARI_BASE_URL = "https://" + SAFARI_BASE_HOST
API_ORIGIN_URL = "https://" + API_ORIGIN_HOST
PROFILE_URL = SAFARI_BASE_URL + "/profile/"
+PROFILE_URL = "https://www.oreilly.com/member/"
I guess there are a few entry points for oreilly, and this is the one used
for me
…On Fri, Dec 20, 2019 at 8:24 AM Luis Ruiz Pavon ***@***.***> wrote:
Hi @antrianis <https://github.com/antrianis>
Would you mind to tell us what url have you changed in the script?
Regards!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2?email_source=notifications&email_token=AAI6OCS7OTSTWJHWOCDMCY3QZRXJNA5CNFSM4ER33OGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHMEJ4A#issuecomment-567821552>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAI6OCTHCNE2C5BK4FTCCL3QZRXJNANCNFSM4ER33OGA>
.
|
In my case, I've changed this: PROFILE_URL = SAFARI_BASE_URL + "/home/?next=%2Fprofile%2F" and it's working fine! Regards! |
remove unused imported module Selector
This is what worked in Firefox.
|
After these steps I am getting the following error:
|
{ I was able to get it to work when I used the above cookies.json file |
Works in Microsoft Edge as well Version 80.0.361.69 (Official build) (64-bit). |
This no longer works. Just use one of the api calls from browser network activity to take cookie and convert into json and place it in cookies.json file. That should work. |
for me also is not working anymore. Now I need to copy the cookie mannually via browser |
Hello, my safaribooksonline account is SSO handled by my company, thus I have NO password.
Could you post an example of the cookies.json format ? (with dummy values of course)
The text was updated successfully, but these errors were encountered: