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

Parse ESRI URL Query Params #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions openaddr/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from os import mkdir
from hashlib import md5
from os.path import join, basename, exists, abspath, splitext
from urllib.parse import urlparse
from urllib.parse import urlparse, parse_qs
from subprocess import check_output
from tempfile import mkstemp
from hashlib import sha1
Expand Down Expand Up @@ -367,7 +367,18 @@ def download(self, source_urls, workdir, source_config):
_L.debug("File exists %s", file_path)
continue

downloader = EsriDumper(source_url, parent_logger=_L, timeout=300)
url = urlparse(source_url)
query = parse_qs(url.query)

for k, v in query.items():
query[k] = v[0]

downloader = EsriDumper(
source_url,
extra_query_args=url.query,
parent_logger=_L,
timeout=300
)

metadata = downloader.get_metadata()

Expand Down