You are right. My proposal made no sense.
Other adjustments are needed.
Code:
# write out modified file
destdir = ""
filename = ""
if bk.launcher_version() >= 20190927:
filename = bk.id_to_bookpath(mid)
fpath = os.path.join(temp_dir, filename)
else:
if "/" in href:
destdir, filename = unquote(filename).split("/")
fpath = os.path.join(temp_dir, "OEBPS", destdir, filename)