Advertisement
Guest User

Untitled

a guest
Mar 11th, 2016
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. from StringIO import StringIO
  4. import gzip
  5. import urllib2
  6.  
  7. url = ["http://tumejorjuego.com/download/index.php?link=descargar-torrent/068992_vikingos-temporada-3-hdtv-720p-ac3-51/"]
  8.  
  9. request = urllib2.Request(url[0])
  10. request.add_header('Accept-encoding', 'gzip')
  11. response = urllib2.urlopen(request)
  12. if response.info().get('Content-Encoding') == 'gzip':
  13.     buf = StringIO( response.read())
  14.     f = gzip.GzipFile(fileobj=buf)
  15.     data = f.read()
  16.     print data
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement