Niansuh commited on
Commit
06a06e5
·
verified ·
1 Parent(s): 86d7bd2

Update api/validate.py

Browse files
Files changed (1) hide show
  1. api/validate.py +2 -2
api/validate.py CHANGED
@@ -46,7 +46,7 @@ def getHid(force_refresh=False):
46
  if h_match:
47
  h_value = h_match.group(1)
48
  logger.info(f"Found h-value: {h_value}")
49
- # Update cache
50
  cached_hid = h_value
51
  cache_time = current_time
52
  return h_value
@@ -57,5 +57,5 @@ def getHid(force_refresh=False):
57
  logger.error("Specified JS file path not found in HTML content")
58
  return None
59
  except requests.exceptions.RequestException as e:
60
- logger.error(f"An error occurred: {e}")
61
  return None
 
46
  if h_match:
47
  h_value = h_match.group(1)
48
  logger.info(f"Found h-value: {h_value}")
49
+ # Update cache even when force_refresh is True
50
  cached_hid = h_value
51
  cache_time = current_time
52
  return h_value
 
57
  logger.error("Specified JS file path not found in HTML content")
58
  return None
59
  except requests.exceptions.RequestException as e:
60
+ logger.error(f"An error occurred while fetching h-value: {e}")
61
  return None