Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blocklune/mdimgdownloader
Download images in Markdown files and update links
https://github.com/blocklune/mdimgdownloader
downloader image img markdown md
Last synced: about 1 month ago
JSON representation
Download images in Markdown files and update links
- Host: GitHub
- URL: https://github.com/blocklune/mdimgdownloader
- Owner: BlockLune
- License: other
- Created: 2024-04-28T07:15:54.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-08-13T15:22:42.000Z (3 months ago)
- Last Synced: 2024-10-12T16:41:28.231Z (about 1 month ago)
- Topics: downloader, image, img, markdown, md
- Language: Python
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Md Img Downloader
Download images in Markdown files and update links.
This project references [mufidu/download_imgs.py](https://gist.github.com/mufidu/f7b795f844f1ee4dc78e55123d5a398b) but is written independently.
## Usage
```text
usage: MdImgDownloader [-h] [--only-basename-link] [-o OUTPUT_DIR] dir [dir ...]Download images in Markdown files and update links
positional arguments:
dir directory of markdown filesoptions:
-h, --help show this help message and exit
--only-basename-link by default, link will be updated to `OUTPUT_DIR/IMG_NAME`. If this flag is set, link will be updated to
`IMG_NAME` only
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
directory to save images
```If you don't specify the `OUTPUT_DIR`, the script will create a dir based on the name of the md file.
If you want to use this script to update all the image links in your Hexo posts, run:
```bash
python MdImgDownloader /path-to-your-hexo-project/source/_posts --only-basename-link
```