使用网上的python代码批量下载哨兵2号数据,代码出现下面情况是什么原因,怎么解决。
from xml.dom.minidom import parse
from data_downloader import downloader
####################################################################################################
#########################
folder_out = r'D:\哨兵2号数据'
url_file = r'C:\Users\Chengyan Fan\Desktop\products.meta4'
####################################################################################################
data = parse(url_file).documentElement
urls = [i.childNodes[0].nodeValue for i in data.getElementsByTagName('url')]
downloader.download_datas(urls,folder_out)
D:\python-3.10.1\python.exe "D:\PyCharm Community Edition 2022.2.4\sbdata.py"
>>> Warning: scihub.copernicus.eu existed, nothing will be done. If you want to overwrite the existed record, set overwrite=True
Traceback (most recent call last):
File "D:\python-3.10.1\lib\site-packages\httpcore\_exceptions.py", line 8, in map_exceptions
yield
File "D:\python-3.10.1\lib\site-packages\httpcore\backends\sync.py", line 57, in start_tls
raise exc
File "D:\python-3.10.1\lib\site-packages\httpcore\backends\sync.py", line 52, in start_tls
sock = ssl_context.wrap_socket(
File "D:\python-3.10.1\lib\ssl.py", line 512, in wrap_socket
return self.sslsocket_class._create(
File "D:\python-3.10.1\lib\ssl.py", line 1070, in _create
self.do_handshake()
File "D:\python-3.10.1\lib\ssl.py", line 1341, in do_handshake
self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:997)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\python-3.10.1\lib\site-packages\httpx\_transports\default.py", line 60, in map_httpcore_exceptions
yield
File "D:\python-3.10.1\lib\site-packages\httpx\_transports\default.py", line 218, in handle_request
resp = self._pool.handle_request(req)
File "D:\python-3.10.1\lib\site-packages\httpcore\_sync\connection_pool.py", line 253, in handle_request
raise exc
File "D:\python-3.10.1\lib\site-packages\httpcore\_sync\connection_pool.py", line 237, in handle_request
response = connection.handle_request(request)
File "D:\python-3.10.1\lib\site-packages\httpcore\_sync\http_proxy.py", line 258, in handle_request
connect_response = self._connection.handle_request(
File "D:\python-3.10.1\lib\site-packages\httpcore\_sync\connection.py", line 86, in handle_request
raise exc
File "D:\python-3.10.1\lib\site-packages\httpcore\_sync\connection.py", line 63, in handle_request
stream = self._connect(request)
File "D:\python-3.10.1\lib\site-packages\httpcore\_sync\connection.py", line 150, in _connect
stream = stream.start_tls(**kwargs)
File "D:\python-3.10.1\lib\site-packages\httpcore\backends\sync.py", line 49, in start_tls
with map_exceptions(exc_map):
File "D:\python-3.10.1\lib\contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "D:\python-3.10.1\lib\site-packages\httpcore\_exceptions.py", line 12, in map_exceptions
raise to_exc(exc)
httpcore.ConnectError: EOF occurred in violation of protocol (_ssl.c:997)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\PyCharm Community Edition 2022.2.4\sbdata.py", line 28, in
downloader.download_datas(urls, folder_out)
File "D:\python-3.10.1\lib\site-packages\data_downloader\downloader.py", line 362, in download_datas
download_data(url, folder, client=client,
File "D:\python-3.10.1\lib\site-packages\data_downloader\downloader.py", line 251, in download_data
r = client.get(url, headers=headers, timeout=120,
File "D:\python-3.10.1\lib\site-packages\httpx\_client.py", line 1039, in get
return self.request(
File "D:\python-3.10.1\lib\site-packages\httpx\_client.py", line 815, in request
return self.send(request, auth=auth, follow_redirects=follow_redirects)
File "D:\python-3.10.1\lib\site-packages\httpx\_client.py", line 902, in send
response = self._send_handling_auth(
File "D:\python-3.10.1\lib\site-packages\httpx\_client.py", line 930, in _send_handling_auth
response = self._send_handling_redirects(
File "D:\python-3.10.1\lib\site-packages\httpx\_client.py", line 967, in _send_handling_redirects
response = self._send_single_request(request)
File "D:\python-3.10.1\lib\site-packages\httpx\_client.py", line 1003, in _send_single_request
response = transport.handle_request(request)
File "D:\python-3.10.1\lib\site-packages\httpx\_transports\default.py", line 217, in handle_request
with map_httpcore_exceptions():
File "D:\python-3.10.1\lib\contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "D:\python-3.10.1\lib\site-packages\httpx\_transports\default.py", line 77, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: EOF occurred in violation of protocol (_ssl.c:997)
Process finished with exit code 1
###### 我的解答思路和尝试过的方法
###### 我想要达到的结果