download the required subtitle

def download_file(fName, time, dire=pDir()):
    """
    download the required subtitle
    """
    # hash
    gen_hash = get_hash(fName, 64, dire)
    if gen_hash == -1:
        return -1

    # making request
    user_agent = {'User-agent': 'SubDB/1.0 (sub/0.1; http://github.com/leosartaj/sub)'}
    param = {'action': 'download', 'hash': gen_hash, 'language': 'en'} # Specification for the request
    try:
        r = requests.get("http://api.thesubdb.com/", headers = user_agent, params = param, timeout=time) # Get Request
    except (requests.exceptions.Timeout, socket.error):
        return 'Timeout Error'
    if r.status_code != 200:
        return r.status_code

    # save file
    fName, fExt = os.path.splitext(fName)
    fName += '.srt' # replace extension with srt
    fName = os.path.join(dire, fName) # name coupled with path
    with open(fName, 'wb') as f:
        f.write(r.text.encode('ascii', 'ignore'))

    return r.status_code