From 7787c45730cea2baaee51122d210129ca99b974c Mon Sep 17 00:00:00 2001 From: Lauren Liberda Date: Thu, 3 Jun 2021 14:33:14 +0200 Subject: [PATCH] [playwright] simplify code --- haruhi_dl/playwright.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/haruhi_dl/playwright.py b/haruhi_dl/playwright.py index 0c0b2b8e0..36a095c92 100644 --- a/haruhi_dl/playwright.py +++ b/haruhi_dl/playwright.py @@ -1,7 +1,5 @@ # coding: utf-8 -from __future__ import unicode_literals - -from .compat import compat_cookiejar_Cookie +from http.cookiejar import Cookie from .utils import ( ExtractorError, is_outdated_version, @@ -87,11 +85,11 @@ class PlaywrightHelper(): def _set_cookies_from_browser(self, cookies): for cookie in cookies: self._extractor._downloader.cookiejar.set_cookie( - compat_cookiejar_Cookie(0, cookie['name'], cookie['value'], cookie.get('port'), False, - cookie['domain'], False, cookie['domain'].startswith('.'), - cookie['path'], cookie['path'] != '/', - cookie['secure'], cookie['expires'], - False, None, None, None)) + Cookie(0, cookie['name'], cookie['value'], cookie.get('port'), False, + cookie['domain'], False, cookie['domain'].startswith('.'), + cookie['path'], cookie['path'] != '/', + cookie['secure'], cookie['expires'], + False, None, None, None)) def open_page(self, url, display_id, browser_used='firefox', note='Opening page in %(browser)s', html=None): pw = self.pw()