UltimaScraper icon indicating copy to clipboard operation
UltimaScraper copied to clipboard

urllib.error.URLError: <urlopen error [WinError 10060]

Open Septan opened this issue 7 years ago • 3 comments

Only having this issue when I try scrap profile with 1561 photos. I not using a vpn or proxy, have any ideas what else I can to fix this?

``Traceback (most recent call last): File "C:\Python37\lib\urllib\request.py", line 1317, in do_open encode_chunked=req.has_header('Transfer-encoding')) File "C:\Python37\lib\http\client.py", line 1244, in request self._send_request(method, url, body, headers, encode_chunked) File "C:\Python37\lib\http\client.py", line 1290, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "C:\Python37\lib\http\client.py", line 1239, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "C:\Python37\lib\http\client.py", line 1026, in _send_output self.send(msg) File "C:\Python37\lib\http\client.py", line 966, in send self.connect() File "C:\Python37\lib\http\client.py", line 1406, in connect super().connect() File "C:\Python37\lib\http\client.py", line 938, in connect (self.host,self.port), self.timeout, self.source_address) File "C:\Python37\lib\socket.py", line 727, in create_connection raise err File "C:\Python37\lib\socket.py", line 716, in create_connection sock.connect(sa) TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "OnlyFans.py", line 170, in scrape_choice() File "OnlyFans.py", line 86, in scrape_choice media_scraper(image_api, location, j_directory, only_links) File "OnlyFans.py", line 145, in media_scraper pool.starmap(download_media, product(media_set.items(), [directory])) File "C:\Python37\lib\multiprocessing\pool.py", line 276, in starmap return self._map_async(func, iterable, starmapstar, chunksize).get() File "C:\Python37\lib\multiprocessing\pool.py", line 657, in get raise self._value File "C:\Python37\lib\multiprocessing\pool.py", line 121, in worker result = (True, func(*args, **kwds)) File "C:\Python37\lib\multiprocessing\pool.py", line 47, in starmapstar return list(itertools.starmap(args[0], args[1])) File "OnlyFans.py", line 154, in download_media urlretrieve(link, directory) File "C:\Python37\lib\urllib\request.py", line 247, in urlretrieve with contextlib.closing(urlopen(url, data)) as fp: File "C:\Python37\lib\urllib\request.py", line 222, in urlopen return opener.open(url, data, timeout) File "C:\Python37\lib\urllib\request.py", line 525, in open response = self._open(req, data) File "C:\Python37\lib\urllib\request.py", line 543, in _open '_open', req) File "C:\Python37\lib\urllib\request.py", line 503, in _call_chain result = func(*args) File "C:\Python37\lib\urllib\request.py", line 1360, in https_open context=self._context, check_hostname=self._check_hostname) File "C:\Python37\lib\urllib\request.py", line 1319, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond>``

Septan avatar Sep 03 '19 01:09 Septan

Are you on Python 3.7?

UltimaHoarder avatar Sep 03 '19 01:09 UltimaHoarder

Yes, 3.7.4

Septan avatar Sep 03 '19 01:09 Septan

Ahh okay, I will put a while True loop around the download, so that it will always retry on an error like that. I just gotta sort out an issue before this

UltimaHoarder avatar Sep 03 '19 01:09 UltimaHoarder