|
@@ -34,7 +34,7 @@ assets_path = public_path + '/assets' |
|
|
feeds_path = public_path + '/feeds' |
|
|
feeds_path = public_path + '/feeds' |
|
|
|
|
|
|
|
|
# e.g. https://example.com/some-string |
|
|
# e.g. https://example.com/some-string |
|
|
asset_url = config['asset_url'] |
|
|
|
|
|
|
|
|
assets_url = config['assets_url'] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -155,13 +155,13 @@ def process_feed(feed_url, output_filename): |
|
|
old_url = img['data-src'] |
|
|
old_url = img['data-src'] |
|
|
if not old_url.startswith('data:'): |
|
|
if not old_url.startswith('data:'): |
|
|
new_filename = filename_from_url(old_url) |
|
|
new_filename = filename_from_url(old_url) |
|
|
img['data-src'] = asset_url + '/' + entry_dir + '/' + new_filename |
|
|
|
|
|
|
|
|
img['data-src'] = assets_url + '/' + entry_dir + '/' + new_filename |
|
|
download_image(old_url, entry_dir, new_filename) |
|
|
download_image(old_url, entry_dir, new_filename) |
|
|
if img.get('src'): |
|
|
if img.get('src'): |
|
|
old_url = img['src'] |
|
|
old_url = img['src'] |
|
|
if not old_url.startswith('data:'): |
|
|
if not old_url.startswith('data:'): |
|
|
new_filename = filename_from_url(old_url) |
|
|
new_filename = filename_from_url(old_url) |
|
|
img['src'] = asset_url + '/' + entry_dir + '/' + new_filename |
|
|
|
|
|
|
|
|
img['src'] = assets_url + '/' + entry_dir + '/' + new_filename |
|
|
download_image(old_url, entry_dir, new_filename) |
|
|
download_image(old_url, entry_dir, new_filename) |
|
|
if img.get('data-srcset'): |
|
|
if img.get('data-srcset'): |
|
|
srcset = img['data-srcset'].split(', ') |
|
|
srcset = img['data-srcset'].split(', ') |
|
@@ -171,7 +171,7 @@ def process_feed(feed_url, output_filename): |
|
|
src_res = src.split(' ')[1] |
|
|
src_res = src.split(' ')[1] |
|
|
new_filename = filename_from_url(old_url) |
|
|
new_filename = filename_from_url(old_url) |
|
|
download_image(old_url, entry_dir, new_filename) |
|
|
download_image(old_url, entry_dir, new_filename) |
|
|
new_url = asset_url + '/' + entry_dir + '/' + new_filename |
|
|
|
|
|
|
|
|
new_url = assets_url + '/' + entry_dir + '/' + new_filename |
|
|
src = ' '.join([new_url, src_res]) |
|
|
src = ' '.join([new_url, src_res]) |
|
|
new_srcset.append(src) |
|
|
new_srcset.append(src) |
|
|
img['data-srcset'] = ', '.join(new_srcset) |
|
|
img['data-srcset'] = ', '.join(new_srcset) |
|
|