hivecorp commited on
Commit
f182c1a
·
verified ·
1 Parent(s): 3a4c1c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -16,7 +16,8 @@ jobs = {} # job_id: {"status": "processing/completed/failed", "output_file": ..
16
  def download_file(url, filename):
17
  try:
18
  logging.info(f"Downloading file from: {url}")
19
- r = requests.get(url, stream=True)
 
20
  r.raise_for_status()
21
  with open(filename, 'wb') as f:
22
  for chunk in r.iter_content(chunk_size=8192):
@@ -27,6 +28,7 @@ def download_file(url, filename):
27
  raise
28
 
29
 
 
30
  def run_ffmpeg(base_file, overlay_file, output_file):
31
  cmd = [
32
  "ffmpeg", "-y", "-i", base_file, "-i", overlay_file,
 
16
  def download_file(url, filename):
17
  try:
18
  logging.info(f"Downloading file from: {url}")
19
+ headers = {"User-Agent": "Mozilla/5.0"} # Pretend to be a browser
20
+ r = requests.get(url, headers=headers, stream=True)
21
  r.raise_for_status()
22
  with open(filename, 'wb') as f:
23
  for chunk in r.iter_content(chunk_size=8192):
 
28
  raise
29
 
30
 
31
+
32
  def run_ffmpeg(base_file, overlay_file, output_file):
33
  cmd = [
34
  "ffmpeg", "-y", "-i", base_file, "-i", overlay_file,