def find_title(url, verify=True):
 response = requests.get(url, stream=True, verify=verify, headers=default_headers)
 try:
  content = ''
  for byte in response.iter_content(chunk_size=512):
   content += byte
   if (('</title>' in content) or (len(content) > max_bytes)):
    break
  content = content.decode(u'utf-8', errors=u'ignore')
 finally:
  response.close()
 content = title_tag_data.sub(u'<\\1title>', content)
 content = quoted_title.sub(u'', content)
 start = content.find(u'<title>')
 end = content.find(u'</title>')
 if ((start == (-1)) or (end == (-1))):
  return
 title = web.decode(content[(start + 7):end])
 title = title.strip()[:200]
 title = u' '.join(title.split())
 title = re_dcc.sub(u'', title)
 return (title or None)

def find_title ( url , verify = True ) : response = requests . get ( url , stream = True , verify = verify , headers = default_headers ) try : content = '' for byte in response . iter_content ( chunk_size = 512 ) : content += byte if ( ( '</title>' in content ) or ( len ( content ) > max_bytes ) ) : break content = content . decode ( u'utf-8' , errors = u'ignore' ) finally : response . close ( ) content = title_tag_data . sub ( u'<\\1title>' , content ) content = quoted_title . sub ( u'' , content ) start = content . find ( u'<title>' ) end = content . find ( u'</title>' ) if ( ( start == ( - 1 ) ) or ( end == ( - 1 ) ) ) : return title = web . decode ( content [ ( start + 7 ) : end ] ) title = title . strip ( ) [ : 200 ] title = u' ' . join ( title . split ( ) ) title = re_dcc . sub ( u'' , title ) return ( title or None )
return the title for the given url .