mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 21:45:02 +03:00
load cookie only domain match
This commit is contained in:
parent
4119a1493e
commit
5b11d77f9f
@ -467,6 +467,7 @@ def get_content(url, headers={}, decoded=True):
|
|||||||
# Here we add cookies to the request headers manually
|
# Here we add cookies to the request headers manually
|
||||||
cookie_strings = []
|
cookie_strings = []
|
||||||
for cookie in list(cookies):
|
for cookie in list(cookies):
|
||||||
|
if cookie.domain in url and cookie.path in url:
|
||||||
cookie_strings.append(cookie.name + '=' + cookie.value)
|
cookie_strings.append(cookie.name + '=' + cookie.value)
|
||||||
cookie_headers = {'Cookie': '; '.join(cookie_strings)}
|
cookie_headers = {'Cookie': '; '.join(cookie_strings)}
|
||||||
req.headers.update(cookie_headers)
|
req.headers.update(cookie_headers)
|
||||||
|
Loading…
Reference in New Issue
Block a user