codelion commited on
Commit
6be089f
·
verified ·
1 Parent(s): 64ef2b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -73,10 +73,10 @@ def check_url():
73
  return jsonify({'broken': True, 'favicon': None})
74
  try:
75
  # Follow redirects and check final status
76
- response = requests.head(url, allow_redirects=True, timeout=5)
77
  if response.status_code == 200:
78
  # Fetch favicon for valid URLs
79
- html_response = requests.get(url, timeout=5)
80
  soup = BeautifulSoup(html_response.text, 'html.parser')
81
  favicon_tag = soup.find("link", rel=["icon", "shortcut icon"])
82
  favicon_url = favicon_tag['href'] if favicon_tag and 'href' in favicon_tag.attrs else None
 
73
  return jsonify({'broken': True, 'favicon': None})
74
  try:
75
  # Follow redirects and check final status
76
+ response = requests.head(url, allow_redirects=True, timeout=10)
77
  if response.status_code == 200:
78
  # Fetch favicon for valid URLs
79
+ html_response = requests.get(url, timeout=10)
80
  soup = BeautifulSoup(html_response.text, 'html.parser')
81
  favicon_tag = soup.find("link", rel=["icon", "shortcut icon"])
82
  favicon_url = favicon_tag['href'] if favicon_tag and 'href' in favicon_tag.attrs else None