DIR : /home/kozerus/public_html/go/eidogo/tourney/dl.py

/home/kozerus/public_html/go/eidogo/tourney

import requests

def is_downloadable(url):
    """
    Does the url contain a downloadable resource
    """
    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

id="print1"
url="http://eidogo/backend/download.php?id={}".format(id)
print( "url={} status={}".format(url, is_downloadable(url)))
# >> False
url="http://ko2.us/ko.php?todo=mp3s"
print( "url={} status={}".format(url, is_downloadable(url)))
# >> True

//


koh5_pano



Your browser does not support the HTML5 canvas element.


Drag mouse to navigate.

Navigation





17.Aug.2010, Martin Wengenmayer