Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion hvpy/facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def getJP2Header(
--------
>>> from hvpy import getJP2Header
>>> getJP2Header(id=7654321,callback="xml_header")
'xml_header(\\\'<?xml version="1.0" encoding="utf-8"?><meta><fits><SIMPLE>1</SIMPLE><BITPIX>16</BITPIX>...')'
'xml_header(\\\'<?xml version="1.0" encoding="utf-8"?><meta><fits>...')'
"""
params = getJP2HeaderInputParameters(id=id, callback=callback)
return execute_api_call(input_parameters=params)
Expand Down
6 changes: 4 additions & 2 deletions hvpy/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def createMovie(
Default is `False`.
filename
The path to save the file to.
Optional, will default to ``f"{res['id']}_{startTime.date()}_{endTime.date()}.{format}"``.
Optional, will default to ``f"{res['title']}.{format}"``.
hq
Download a higher-quality movie file (valid for "mp4" movies only, ignored otherwise).
Default is `False`, optional.
Expand Down Expand Up @@ -97,6 +97,7 @@ def createMovie(
if res.get("error"):
raise RuntimeError(res["error"])
timeout_counter = time.time() + 60 * timeout # Default 5 minutes
title = ""
while True:
status = getMovieStatus(
id=res["id"],
Expand All @@ -106,6 +107,7 @@ def createMovie(
if status["status"] in [0, 1]:
time.sleep(3)
if status["status"] == 2:
title = status["title"]
break
if time.time() > timeout_counter:
raise RuntimeError(f"Exceeded timeout of {timeout} minutes.")
Expand All @@ -117,7 +119,7 @@ def createMovie(
hq=hq,
)
if filename is None:
filename = f"{res['id']}_{startTime.date()}_{endTime.date()}.{format}"
filename = f"{title}.{format}"
else:
filename = f"{filename}.{format}"
save_file(
Expand Down