Skip to content

Commit

Permalink
Avoid retrieving truncated book chapters/pages/sections
Browse files Browse the repository at this point in the history
When modifying the 'sessionid' after each call to oreilly api,
there are calls that are considered not-authenticated and we retrieved
truncated chapters/pages.
By avoiding adding/modifying it, all the calls are correctly authenticated
and we manage to retrieve full chapters/pages.
  • Loading branch information
Gregory LEOCADIE committed Aug 27, 2019
1 parent d71df50 commit 2a9f147
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions safaribooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,10 @@ def return_headers(self, url):

def update_cookies(self, jar):
for cookie in jar:
self.cookies.update({
cookie.name: cookie.value
})
if cookie.name != 'sessionid':
self.cookies.update({
cookie.name: cookie.value
})

def requests_provider(
self, url, post=False, data=None, perfom_redirect=True, update_cookies=True, update_referer=True, **kwargs
Expand Down

0 comments on commit 2a9f147

Please sign in to comment.