def is_downloadable(url):
 h = requests.head(url, allow_redirects=True)
 header = h.headers
 content_type = header.get('content-type')
 if ('text' in content_type.lower()):
  return False
 if ('html' in content_type.lower()):
  return False
 return True

def is_downloadable ( url ) : h = requests . head ( url , allow_redirects = True ) header = h . headers content_type = header . get ( 'content-type' ) if ( 'text' in content_type . lower ( ) ) : return False if ( 'html' in content_type . lower ( ) ) : return False return True
does the url contain a downloadable resource .