Skip to content

Commit

Permalink
forced only on req
Browse files Browse the repository at this point in the history
  • Loading branch information
datawhores committed May 31, 2024
1 parent b45fdf2 commit b8784e5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions ofscraper/classes/sessionmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,14 @@ def _create_headers(
url,
sign,
forced,
refresh
):
headers = headers or {}
headers.update(auth_requests.make_headers())
headers = self._create_sign(headers, url, forced=forced,refresh=refresh) if sign is None else headers
headers = self._create_sign(headers, url, forced=forced) if sign is None else headers
return headers

def _create_sign(self, headers, url, refresh=None,forced=None):
auth_requests.create_sign(url, headers, refresh=refresh,forced=forced)
def _create_sign(self, headers, url,forced=None):
auth_requests.create_sign(url, headers,forced=forced)
return headers

def _create_cookies(self):
Expand Down Expand Up @@ -330,7 +329,7 @@ def requests(
sleeper.do_sleep()
# remake each time
headers = (
self._create_headers(headers, url, sign, False,forced)
self._create_headers(headers, url, sign,forced)
if (headers is None) or forced or sign
else None
)
Expand Down Expand Up @@ -426,7 +425,7 @@ async def requests_async(
try:
await sleeper.async_do_sleep()
headers = (
self._create_headers(headers, url, sign, forced,False)
self._create_headers(headers, url, sign, forced)
if (headers is None) or forced or sign
else headers
)
Expand Down

0 comments on commit b8784e5

Please sign in to comment.