diff options
Diffstat (limited to 'savewebfonts_lib.py')
-rwxr-xr-x | savewebfonts_lib.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/savewebfonts_lib.py b/savewebfonts_lib.py index ab8d7c1..cb29ec7 100755 --- a/savewebfonts_lib.py +++ b/savewebfonts_lib.py @@ -290,7 +290,11 @@ def whitelist_harfile(harfile, fontdir, config = config_default): all_fonts = get_all_fonts_from_csslist(all_css, config) # Prepare destination dir - destdir = os.path.join(fontdir,"harfiles") + with open(harfile,'r') as o: + har_contents = o.read() + a = json.loads(har_contents) + domain = urlparse(a['log']['entries'][0]['request']['url']).netloc # get first entry's domain name + destdir = os.path.join(fontdir,"harfile-"+domain) # Save all fonts to that dir return save_all_fonts(all_fonts, destdir, config) |