odoo-shivasakthi/scratch/download_extra_categories.py
Alaguraj0361 5d78301f2b Add scripts for downloading images and finding shapes
- Created `download_categories.py` to download specific category images from a remote server.
- Created `download_extra_categories.py` to download additional category images.
- Added `find_shapes.py` to extract and print unique shape and category image paths from a markdown file.
2026-06-08 20:11:31 +05:30

24 lines
913 B
Python

import urllib.request
import os
base_url = "https://shivasakthi.ca/"
static_dir = "/mnt/extra-addons/dine360_theme_shivasakthi/static/src/img"
assets_to_download = {
"assets/images/home/category/dosa.webp": "assets/images/home/category/dosa.webp",
"assets/images/home/category/idly.webp": "assets/images/home/category/idly.webp",
"assets/images/home/category/uthappam.webp": "assets/images/home/category/uthappam.webp",
"assets/images/home/category/beverages.webp": "assets/images/home/category/beverages.webp"
}
for remote, local in assets_to_download.items():
url = base_url + remote
local_path = os.path.join(static_dir, local)
os.makedirs(os.path.dirname(local_path), exist_ok=True)
print(f"Downloading {url} to {local_path}...")
try:
urllib.request.urlretrieve(url, local_path)
print("Success!")
except Exception as e:
print(f"Failed: {e}")