title: 'NoneType' object has no attribute 'group'
body: <p>Can somebody help me with this code? I'm trying to make a python script that will play videos and I found this file that download's Youtube videos. I am not entirely sure what is going on and I can't figure out this error.</p>
  
  <p>Error:</p>
  
  <pre class="lang-python prettyprint-override"><code>AttributeError: 'NoneType' object has no attribute 'group'
  </code></pre>
  
  <p>Traceback:</p>
  
  <pre class="lang-python prettyprint-override"><code>Traceback (most recent call last):
    File "youtube.py", line 67, in &lt;module&gt;
      videoUrl = getVideoUrl(content)
    File "youtube.py", line 11, in getVideoUrl
      grps = fmtre.group(0).split('&amp;amp;')
  </code></pre>
  
  <p>Code snippet:</p>
  
  <p>(lines 66-71)</p>
  
  <pre class="lang-python prettyprint-override"><code>content = resp.read()
  videoUrl = getVideoUrl(content)
  
  if videoUrl is not None:
      print('Video URL cannot be found')
      exit(1)
  </code></pre>
  
  <p>(lines 9-17)</p>
  
  <pre class="lang-python prettyprint-override"><code>def getVideoUrl(content):
      fmtre = re.search('(?&lt;=fmt_url_map=).*', content)
      grps = fmtre.group(0).split('&amp;amp;')
      vurls = urllib2.unquote(grps[0])
      videoUrl = None
      for vurl in vurls.split('|'):
          if vurl.find('itag=5') &gt; 0:
              return vurl
      return None
  </code></pre>