Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

downloadfirebase.py doesn't work #1

Open
tatsuro-ueda opened this issue Jan 24, 2022 · 3 comments
Open

downloadfirebase.py doesn't work #1

tatsuro-ueda opened this issue Jan 24, 2022 · 3 comments

Comments

@tatsuro-ueda
Copy link

r = requests.get(firebaseUrl)

Hello @nicolevanderhoeven, thanks for your scripts. However, downloadfirebase.py doesn't work on my MacBook Air with macOS Monterey 12.1.

Since I haven't module Requests, I installed pip at first, then installed Requests, and finally run your script. It says:

% python3 ./downloadfirebase.py 
Traceback (most recent call last):
  File "/Users/tatsuro-ueda/Library/Python/3.8/lib/python/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
  File "/Users/tatsuro-ueda/Library/Python/3.8/lib/python/site-packages/urllib3/util/connection.py", line 72, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/socket.py", line 918, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/tatsuro-ueda/Library/Python/3.8/lib/python/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/Users/tatsuro-ueda/Library/Python/3.8/lib/python/site-packages/urllib3/connectionpool.py", line 386, in _make_request
    self._validate_conn(conn)
  File "/Users/tatsuro-ueda/Library/Python/3.8/lib/python/site-packages/urllib3/connectionpool.py", line 1040, in _validate_conn
    conn.connect()
  File "/Users/tatsuro-ueda/Library/Python/3.8/lib/python/site-packages/urllib3/connection.py", line 358, in connect
    conn = self._new_conn()
  File "/Users/tatsuro-ueda/Library/Python/3.8/lib/python/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x105a40f10>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/tatsuro-ueda/Library/Python/3.8/lib/python/site-packages/requests/adapters.py", line 440, in send
    resp = conn.urlopen(
  File "/Users/tatsuro-ueda/Library/Python/3.8/lib/python/site-packages/urllib3/connectionpool.py", line 785, in urlopen
    retries = retries.increment(
  File "/Users/tatsuro-ueda/Library/Python/3.8/lib/python/site-packages/urllib3/util/retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='firebasestorage(.*)', port=443): Max retries exceeded with url: /%5C?alt(.*)%5C%7D',%20line (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x105a40f10>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./downloadfirebase.py", line 39, in <module>
    r = requests.get(firebaseUrl)
  File "/Users/tatsuro-ueda/Library/Python/3.8/lib/python/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/Users/tatsuro-ueda/Library/Python/3.8/lib/python/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/tatsuro-ueda/Library/Python/3.8/lib/python/site-packages/requests/sessions.py", line 529, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/tatsuro-ueda/Library/Python/3.8/lib/python/site-packages/requests/sessions.py", line 645, in send
    r = adapter.send(request, **kwargs)
  File "/Users/tatsuro-ueda/Library/Python/3.8/lib/python/site-packages/requests/adapters.py", line 519, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='firebasestorage(.*)', port=443): Max retries exceeded with url: /%5C?alt(.*)%5C%7D',%20line (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x105a40f10>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))

Though it might be because of my environment, I'm not familiar with Python so I couldn't solve this problem. Could you tell me how to fix? Thank you very much.

@nicolevanderhoeven
Copy link
Owner

Hi, it seems like the script is complaining that the URL is incorrectly formed. Specifically, something with this line: /%5C?alt(.*)%5C%7D',%20line, which is part of the script. Is the script within your Obsidian vault? If so, the script may be attempting to parse itself. Could you remove it from the vault and run it again?

@tatsuro-ueda tatsuro-ueda changed the title downloadfirebase.py doesn't work on my MacBook Air with macOS Monterey 12.1 downloadfirebase.py doesn't work Jan 24, 2022
@tatsuro-ueda
Copy link
Author

Thank you for quick response!
Yes I put the file in my vault. I just moved your script to out of my vault and run it, but there was still an error:

Traceback (most recent call last):
  File "./downloadfirebase.py", line 26, in <module>
    fhand = open(fileFullPath, errors='ignore')
TypeError: 'errors' is an invalid keyword argument for this function

@BlackCat4git
Copy link

I have the same error regarding the invalid keyord :

traceback (most recent call last):
  File "downloadfirebase.py", line 27, in <module>
    fhand = open(fileFullPath, errors='ignore')
TypeError: 'errors' is an invalid keyword argument for this function

on a Ubuntu machine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants