Skip to content

Commit

Permalink
Merge pull request #26 from nchiasson-dgi/feature/foxml-extension-bypass
Browse files Browse the repository at this point in the history
DDST-553: Updating with latest from main
  • Loading branch information
nchiasson-dgi authored Sep 24, 2024
2 parents 6106fde + a8842d2 commit e9f4ac8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/datastream_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def fetch_data(dsid, base_url, user, password, output_dir, pid):
dsid_dir = os.path.join(output_dir, dsid)
os.makedirs(dsid_dir, exist_ok=True)
content_type = response.headers.get("Content-Type", "")
extension = mimetypes.guess_extension(content_type) if content_type else ""
extension = ".xml" if dsid == "MODS" else mimetypes.guess_extension(content_type) or ""
filename = f"{pid}-{dsid}{extension}"
with open(os.path.join(dsid_dir, filename), "wb") as f:
f.write(response.content)
Expand Down

0 comments on commit e9f4ac8

Please sign in to comment.