mathrithms / bunnycdn-python-lib Goto Github PK
View Code? Open in Web Editor NEWPython SDK for Interacting with BunnyCDN Services!
Home Page: https://pypi.org/project/bunnycdnpython/
License: MIT License
Python SDK for Interacting with BunnyCDN Services!
Home Page: https://pypi.org/project/bunnycdnpython/
License: MIT License
When i try to upload a file i get few errors i cant find solution doing google search.
My Code
from BunnyCDN.Storage import Storage
from BunnyCDN.CDN import CDN
obj_storage = Storage('MY_STORAGE_API_KEY',
storage_zone='my-space', storage_zone_region='DE')
obj_storage.PutFile(file_name='new_thum.jpg',
storage_path='new-post/thumnail.jpg', local_upload_file_path='D:/Documents/python/images/')
here is the complete error output when run my python file.
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\urllib3\connection.py", line 174, in _new_conn
conn = connection.create_connection(
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "C:\Python310\lib\socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\urllib3\connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\urllib3\connectionpool.py", line 1010, in _validate_conn
conn.connect()
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\urllib3\connection.py", line 358, in connect
conn = self._new_conn()
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\urllib3\connection.py", line 186, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x0000028EC82B4040>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\urllib3\util\retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='de.storage.bunnycdn.com', port=443): Max retries exceeded with url: /my-space/new-post/my-thum.jpg (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000028EC82B4040>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "d:\Documents\python\ui-library-automation\bunny\upload.py", line 10, in <module>
obj_storage.PutFile(file_name='new_thum.jpg',
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\BunnyCDN\Storage.py", line 148, in PutFile
response = requests.put(url, data=file_data, headers=self.headers)
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\requests\api.py", line 132, in put
return request('put', url, data=data, **kwargs)
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\requests\adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='de.storage.bunnycdn.com', port=443): Max retries exceeded with url: /my-space/new-post/my-thum.jpg (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000028EC82B4040>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
BunnyCDN-Python-Lib/BunnyCDN/CDN.py
Line 440 in 41bb384
BunnyCDN-Python-Lib/BunnyCDN/CDN.py
Line 767 in 60f38ec
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.