parameters: (capture_record)
docstring: Check if a URL exists without downloading the whole file.
      We only check the URL header.
docstring_summary: Check if a URL exists without downloading the whole file.
      We only check the URL header.
docstring_tokens: Check if a URL exists without downloading the whole file . We only check the URL header .
function: def check_url(capture_record):
      """
      Check if a URL exists without downloading the whole file.
      We only check the URL header.
      """
      # Ensure that the response code is not an error
      # (No 4xx or 5xx errors)
      the_code = get_server_status_code(capture_record.url)
      capture_record.url_response_code = the_code
      
      # If the status code is an error, update the capture_status accordingly
      if the_code is None:
          capture_record.capture_status = 0
          return False
      if the_code < 400 or app.config['CAPTURE_ERRORS'] == True:
          capture_record.capture_status = the_code
          return True
      else:
          capture_record.capture_status = the_code
          return False
function_tokens: def check_url ( capture_record ) : # Ensure that the response code is not an error # (No 4xx or 5xx errors) the_code = get_server_status_code ( capture_record . url ) capture_record . url_response_code = the_code # If the status code is an error, update the capture_status accordingly if the_code is None : capture_record . capture_status = 0 return False if the_code < 400 or app . config [ 'CAPTURE_ERRORS' ] == True : capture_record . capture_status = the_code return True else : capture_record . capture_status = the_code return False