name attribute should be cl
jthomasser opened this issue · comments
jthomasser commented
thanks for the script helped me recover some memories i would have otherwise lost.
the name attribute does not properly pull the identified name for the media file. using cl will do the trick. changing as follows helped me pull original names out of the xml. i just substituted name for cl in this code block.
for ext in image_ext_types:
xpath_search_expr = xpath_search_str_base + ext + "']"
b64_results_list.append([(b.attrib['data'], b.attrib['cl']) for b in root.findall(xpath_search_expr)])
for result_type in b64_results_list:
for (data, cl) in result_type:
if cl == "" or cl == "null":
cl = "".join(random.sample(string.ascii_letters, 10))
with open(os.path.join(output_dir, cl), 'wb') as f:
f.write(base64.b64decode(data))
orig_files_count += 1
Raleigh Littles commented
Thanks for the feedback. I'll apply this change
Raleigh Littles commented
Applied this change in the latest commit: cda5a18