aboutsummaryrefslogtreecommitdiff
path: root/savewebfonts_lib.py
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2021-04-05 11:34:08 -0400
committerB. Stack <bgstack15@gmail.com>2021-04-05 11:34:08 -0400
commit755f7129d5af791297fd2cfcfa8c40b9a240b2a2 (patch)
treef827009b05d9cc790d9a1066acf12ee4a2c59d3b /savewebfonts_lib.py
parentuse harfile entry 0 for domain name (diff)
downloadsave-webfonts-755f7129d5af791297fd2cfcfa8c40b9a240b2a2.tar.gz
save-webfonts-755f7129d5af791297fd2cfcfa8c40b9a240b2a2.tar.bz2
save-webfonts-755f7129d5af791297fd2cfcfa8c40b9a240b2a2.zip
move get_session to top
Diffstat (limited to 'savewebfonts_lib.py')
-rwxr-xr-xsavewebfonts_lib.py10
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
bgstack15