def get_download_link(cookie, tokens, path):
metas = get_metas(cookie, tokens, path)<EOL>if (not metas or metas.get('<STR_LIT>', -<NUM_LIT:1>) != <NUM_LIT:0> or<EOL>'<STR_LIT:info>' not in metas or len(metas['<STR_LIT:info>']) != <NUM_LIT:1>):<EOL><INDENT>logger.error('<STR_LIT>' % metas)<EOL>return None<EOL><DEDENT>dlink = metas['<STR_LIT:info>'][<NUM_LIT:0>]['<STR_LIT>']<EOL>url = '<STR_LIT>'.format(dlink, cookie.get('<STR_LIT>').value)<EOL>req = net.urlopen_without_redirect(url, headers={<EOL>'<STR_LIT>': cookie.sub_output('<STR_LIT>', '<STR_LIT>', '<STR_LIT>'),<EOL>'<STR_LIT>': const.ACCEPT_HTML,<EOL>})<EOL>if not req:<EOL><INDENT>return url<EOL><DEDENT>else:<EOL><INDENT>return req.getheader('<STR_LIT>', url)<EOL><DEDENT>
在下载之前, 要先获取最终的下载链接.

    path - 一个文件的绝对路径.

    @return red_url, red_url 是重定向后的URL, 如果获取失败,
            就返回原来的dlink;