This commit is contained in:
Kovid Goyal 2023-04-22 18:35:17 +05:30
parent 124854254e
commit f48c2ca8f2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -4,12 +4,14 @@
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import sys
import os
import re
import time
from collections import namedtuple
from contextlib import contextmanager
from threading import Lock
from functools import partial
try:
from urllib.parse import parse_qs, quote_plus, unquote, urlencode, quote, urlparse
@ -19,7 +21,7 @@ except ImportError:
from lxml import etree
from calibre import browser as _browser, prints, random_user_agent
from calibre import browser as _browser, prints as safe_print, random_user_agent
from calibre.constants import cache_dir
from calibre.ebooks.chardet import xml_to_unicode
from calibre.utils.lock import ExclusiveFile
@ -29,6 +31,7 @@ current_version = (1, 2, 2)
minimum_calibre_version = (2, 80, 0)
webcache = {}
webcache_lock = Lock()
prints = partial(safe_print, file=sys.stderr)
Result = namedtuple('Result', 'url title cached_url')