fuergaosi233 / gitbook2pdf

Grab the contents of the gitbook document and convert it to pdf
1.04k stars 175 forks source link

Fix [SSL: CERTIFICATE_VERIFY_FAILED] #70

Closed user-1234 closed 3 years ago

user-1234 commented 4 years ago

from aiohttp import ClientSession from aiohttp import TCPConnector

async def request(url, headers, timeout=None): async with aiohttp.ClientSession(connector=TCPConnector(verify_ssl=False)) as session: async with session.get(url, headers=headers, timeout=timeout) as resp: return await resp.text() ..... .....

def collect_urls_and_metadata(self, start_url):
    response = requests.get(start_url, headers=self.headers, verify=False)