diff options
Diffstat (limited to 'savewebfonts_lib.py')
-rwxr-xr-x | savewebfonts_lib.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/savewebfonts_lib.py b/savewebfonts_lib.py index cb29ec7..857dfc7 100755 --- a/savewebfonts_lib.py +++ b/savewebfonts_lib.py @@ -23,6 +23,11 @@ from bs4 import BeautifulSoup as bs # python3-beautifulsoup4 from urllib.parse import urljoin, urlparse import tinycss2 # python3-tinycss2 +def get_session(): + session = requests.Session() + session.headers["User-Agent"] = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36" + return session + # defaults for library class swf_config: def __init__( @@ -68,11 +73,6 @@ def ttfify_filename(filename): #response = response.removesuffix(end) return response + ".ttf" -def get_session(): - session = requests.Session() - session.headers["User-Agent"] = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36" - return session - def list_all_css_for_page(url, config): """ Return all css links from a given page |