Many bug fixes

This commit is contained in:
Remy Moll
2022-04-20 16:49:55 +02:00
parent 0d76bcbb98
commit 8f3ea25662
16 changed files with 223 additions and 118 deletions

View File

@@ -9,6 +9,9 @@ shrink_sizes = []
def shrink_pdf(article):
initial_size = os.path.getsize(article.save_path + article.file_name)
if article.file_name[-4:] != ".pdf":
return article # it probably was a youtube video
c = subprocess.run(
["gs", "-sDEVICE=pdfwrite", "-dPDFSETTINGS=/screen", "-dNOPAUSE", "-dBATCH", f"-sOutputFile={config['default_download_path']}/compressed.pdf", f'"{article.save_path + article.file_name}"'],
stdout=subprocess.PIPE,