bluenevus commited on
Commit
72673b1
·
verified ·
1 Parent(s): e0b9bcc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -6,13 +6,13 @@ import os
6
  import tempfile
7
 
8
  def compress_pdf(input_file, url, quality):
9
- if input_file is None and url is None:
10
  return None, "Please provide either a file or a URL."
11
 
12
- if input_file is not None and url is not None:
13
  return None, "Please provide either a file or a URL, not both."
14
 
15
- if url:
16
  try:
17
  response = requests.get(url)
18
  response.raise_for_status()
 
6
  import tempfile
7
 
8
  def compress_pdf(input_file, url, quality):
9
+ if input_file is None and (url is None or url.strip() == ""):
10
  return None, "Please provide either a file or a URL."
11
 
12
+ if input_file is not None and url and url.strip() != "":
13
  return None, "Please provide either a file or a URL, not both."
14
 
15
+ if url and url.strip() != "":
16
  try:
17
  response = requests.get(url)
18
  response.raise_for_status()