Recursively collect all linked files / assets


I am wondering if there is a method or addon to copy all linked textures / libraries to a seperate folder. Like packing / saving / unpacking but automatically, and not only packing the linked libraries but in turn also packing everything the libraries have referenced, the complete project structure.

so something like:
[TABLE=“class: grid, width: 500”]

main blend
<-- more libraries
<-- textures for libs




What happens if you run Object>Make Local…>All or (bpy.ops.object.make_local(type=‘ALL’) in code)? Doesn’t that work?