How to download required media files for a category or product on demand?

Suppose you got some Magento tasks like: – Re/designing a theme – Modifying a category or product page

In this case, Do you download all the media files?

Even if you decided to download all the media files? – Do you have sufficient storage? – Do you have enough patience to wait for the entire download?

Of course, not. That’s why I have created a utility bash script, which helps developer to quickly download the required images for category or product on demand via tool called “Magento 2 Media Downloader”:
* https://github.com/MagePsycho/magento2-media-downloader-bash-script

INSTALLATION

You can simply download the script file and give the executable permission. curl -0 https://raw.githubusercontent.com/MagePsycho/magento2-media-downloader-bash-script/master/src/m2-media-downloader.sh -o m2-media-downloader.sh chmod +x m2-media-downloader.sh To make it system-wide command (recommended) “` mv m2-media-downloader.sh ~/bin/m2-media-downloader

OR

mv m2-media-downloader.sh /usr/local/bin/m2-media-downloader

“`

USAGE

To display help cd /path/to/magento2 m2-media-downloader --help ![M2 Media Downloader Help](https://github.com/MagePsycho/magento2-media-downloader-bash-script/raw/main/docs/magento2-media-downloader-bash-script-help.png)

Note: You have to run the command from Magento 2 root directory

To download the category images m2-media-downloader --type=category --id=<categoryId>

To download the product images m2-media-downloader --type=product --id=<productId>

To update the script m2-media-downloader --update

submitted by /u/MagePsycho
[link] [comments]