diff options
| author | Petr Svenda | 2020-02-24 13:44:57 +0100 |
|---|---|---|
| committer | Petr Svenda | 2020-02-24 13:44:57 +0100 |
| commit | 7a96ca693d106eae80c613a82f325742dfce2b94 (patch) | |
| tree | 0a3fd0dcebd6d1caddc561e106467cfa8cd6e1aa /src | |
| parent | 5d709716d2b4c3fa43309ee77e66ff7248d5506f (diff) | |
| download | sec-certs-7a96ca693d106eae80c613a82f325742dfce2b94.tar.gz sec-certs-7a96ca693d106eae80c613a82f325742dfce2b94.tar.zst sec-certs-7a96ca693d106eae80c613a82f325742dfce2b94.zip | |
added proper escape of space in URL to prevent expansion inside script during run
Diffstat (limited to 'src')
| -rw-r--r-- | src/extract_certificates.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/extract_certificates.py b/src/extract_certificates.py index 34fae502..c1a8f776 100644 --- a/src/extract_certificates.py +++ b/src/extract_certificates.py @@ -1476,7 +1476,9 @@ def generate_download_script(file_name, certs_dir, targets_dir, download_files_c write_file.write('mkdir \"{}\"\n'.format(certs_dir)) write_file.write('cd \"{}\"\n\n'.format(certs_dir)) for cert in download_files_certs: - write_file.write('curl \"{}\" -o \"{}\"\n'.format(cert[0], cert[1])) + # double %% is necessary to prevent replacement of %2 within script (second argument of script) + file_name_short_web = cert[0].replace(' ', '%%20') + write_file.write('curl \"{}\" -o \"{}\"\n'.format(file_name_short_web, cert[1])) write_file.write('pdftotext \"{}\"\n\n'.format(cert[1])) if len(cert) > 2: @@ -1486,7 +1488,9 @@ def generate_download_script(file_name, certs_dir, targets_dir, download_files_c write_file.write('mkdir \"{}\"\n'.format(targets_dir)) write_file.write('cd \"{}\"\n\n'.format(targets_dir)) for cert in download_files_certs: - write_file.write('curl \"{}\" -o \"{}\"\n'.format(cert[2], cert[3])) + # double %% is necessary to prevent replacement of %2 within script (second argument of script) + file_name_short_web = cert[2].replace(' ', '%%20') + write_file.write('curl \"{}\" -o \"{}\"\n'.format(file_name_short_web, cert[3])) write_file.write('pdftotext \"{}\"\n\n'.format(cert[3])) |
