HackMD and other editors may leave linked media in a markdown document. While this is convenient, links break and media is generally not available when offline.
The download_md_media.py script below
accepts a list of files file1.md file2.md (should also work per drag&drop)
creates a data/ subdirectory
finds and attempts to download linked media
subsequently replaces links to successfully downloaded media with relative paths
download_md_media.py