def get_library_html(url, header, proxy):
    for retry in range(10):
        try:
            if proxy:
                rqs = get(url, headers=header, proxies=proxy, timeout=(6, 7), allow_redirects=False)
            else:
                rqs = get(url, headers=header, timeout=(6, 7), allow_redirects=False)
        except:
            print('    >打开网页失败，重新尝试...')
            continue
        rqs.encoding = 'utf-8'
        rqs_content = rqs.text
        if search('JAVLibrary', rqs_content):
            return (rqs_content, header)
        elif search('javli', rqs_content):
            url = (url[:23] + search('(\\?v=javli.+?)"', rqs_content).group(1))
            if (len(url) > 70):
                header = steal_library_header(url[:23], proxy)
                continue
            print('    >获取信息：', url)
            continue
        elif search('Compatible', rqs_content):
            header = steal_library_header(url[:23], proxy)
            continue
        else:
            print('    >打开网页失败，空返回...重新尝试...')
            continue
    print('>>请检查你的网络环境是否可以打开：', url)
    system('pause')
def get_library_html(url, header, proxy):
    for retry in range(10):
        try:
            if proxy:
                rqs = get(url, headers=header, proxies=proxy, timeout=(6, 7), allow_redirects=False)
            else:
                rqs = get(url, headers=header, timeout=(6, 7), allow_redirects=False)
        except:
            print('    >打开网页失败，重新尝试...')
            continue
        rqs.encoding = 'utf-8'
        rqs_content = rqs.text
        if search('JAVLibrary', rqs_content):
            return (rqs_content, header)
        elif search('javli', rqs_content):
            url = (url[:23] + search('(\\?v=javli.+?)"', rqs_content).group(1))
            if (len(url) > 70):
                header = steal_library_header(url[:23], proxy)
                continue
            print('    >获取信息：', url)
            continue
        elif search('Compatible', rqs_content):
            header = steal_library_header(url[:23], proxy)
            continue
        else:
            print('    >打开网页失败，空返回...重新尝试...')
            continue
    print('>>请检查你的网络环境是否可以打开：', url)
    system('pause')