[playwright] simplify code
This commit is contained in:
parent
f34b024e70
commit
7787c45730
|
@ -1,7 +1,5 @@
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from http.cookiejar import Cookie
|
||||||
|
|
||||||
from .compat import compat_cookiejar_Cookie
|
|
||||||
from .utils import (
|
from .utils import (
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
is_outdated_version,
|
is_outdated_version,
|
||||||
|
@ -87,7 +85,7 @@ class PlaywrightHelper():
|
||||||
def _set_cookies_from_browser(self, cookies):
|
def _set_cookies_from_browser(self, cookies):
|
||||||
for cookie in cookies:
|
for cookie in cookies:
|
||||||
self._extractor._downloader.cookiejar.set_cookie(
|
self._extractor._downloader.cookiejar.set_cookie(
|
||||||
compat_cookiejar_Cookie(0, cookie['name'], cookie['value'], cookie.get('port'), False,
|
Cookie(0, cookie['name'], cookie['value'], cookie.get('port'), False,
|
||||||
cookie['domain'], False, cookie['domain'].startswith('.'),
|
cookie['domain'], False, cookie['domain'].startswith('.'),
|
||||||
cookie['path'], cookie['path'] != '/',
|
cookie['path'], cookie['path'] != '/',
|
||||||
cookie['secure'], cookie['expires'],
|
cookie['secure'], cookie['expires'],
|
||||||
|
|
Loading…
Reference in a new issue