BraydenMoore commited on
Commit
d651008
·
1 Parent(s): bdde6cf

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -8
main.py CHANGED
@@ -69,14 +69,9 @@ def proxy(url):
69
  print('Cleaned URL:', clean_url)
70
 
71
  try:
72
- if '.jpg' in clean_url and 'stream' not in clean_url:
73
- req = requests.get(clean_url, headers=headers, timeout=10)
74
- logging.info(f"Status Code: {req.status_code}, Response Headers: {req.headers}")
75
- return Response(req.content, content_type=req.headers['content-type'])
76
- else:
77
- req = requests.get(clean_url, headers=headers, stream=True, timeout=15)
78
- logging.info(f"Status Code: {req.status_code}, Response Headers: {req.headers}")
79
- return Response(req.iter_content(chunk_size=2048), content_type=req.headers['content-type'])
80
  except:
81
  session['exception_urls'].append(url)
82
  save_exception_urls(session['exception_urls'])
 
69
  print('Cleaned URL:', clean_url)
70
 
71
  try:
72
+ req = requests.get(clean_url, headers=headers, stream=True, timeout=15)
73
+ logging.info(f"Status Code: {req.status_code}, Response Headers: {req.headers}")
74
+ return Response(req.iter_content(chunk_size=2048), content_type=req.headers['content-type'])
 
 
 
 
 
75
  except:
76
  session['exception_urls'].append(url)
77
  save_exception_urls(session['exception_urls'])