bin/, lib/, include/).cd ~/Projects/steam-img-downloader
The venv is bootstrapped in the repo root. Activate it so python3 resolves to the isolated environment with all dependencies.
python3 -m venv . # only needed on first run or after a clean checkout
source bin/activate
python3 -m venv . line and just source the activation script.Fetches skin metadata from the ByMykel CSGO API and downloads any missing images into all_cs2_skin_images/. Already-downloaded files are skipped (skip-if-exists). Failed downloads are logged to a timestamped failed_skins_YYYYMMDD_HHMMSS.log.
python3 index.py
all_cs2_skin_images/ first.cd ~/Projects/steam-img-cropper
The cropper reads from tradeit-skins/csgo/ — not directly from the downloader's output. This rsync copies new/changed files only (-a = archive mode, preserves timestamps and permissions).
rsync -a ~/Projects/steam-img-downloader/all_cs2_skin_images/ tradeit-skins/csgo
Processes all images in tradeit-skins/csgo/ through 35 dimension variants and outputs WebP files to tradeit-cropped-skins/csgo/. Existing outputs are skipped unless you force a rebuild.
npm run start
# Force rebuild all (e.g. after dimension config changes):
npm run crop-force
skip-log-{timestamp}.txt.Uploads the cropped WebP images to the tradeit-prepared-skins S3 bucket under the csgo/ prefix. CloudFront serves directly from this bucket. Only changed/new files are transferred.
aws s3 sync tradeit-cropped-skins/csgo s3://tradeit-prepared-skins/csgo
aws cloudfront create-invalidation --distribution-id <DIST_ID> --paths "/csgo/*"python index.py without activating the venv first — system Python may lack requests / schedule and silently fail.| Symptom | Likely cause & fix |
|---|---|
| High failure count in log | Steam CDN rate-limiting. Increase DELAY env var (default 0.2s) and re-run — skip-if-exists means only failed files are retried. |
ModuleNotFoundError: requests |
Venv not activated. Run source bin/activate from the downloader root, then pip install -r requirements.txt if the module is still missing. |
| rsync copies nothing / wrong path | Trailing slash on source matters: all_cs2_skin_images/ (with slash) copies contents into destination. Without slash it creates a nested directory. |
| Cropper produces no output | Check tradeit-skins/csgo/ is non-empty after rsync. If INPUT_DIR is overridden in .env, verify it points to the correct path. |
S3 sync: NoCredentialsError |
AWS credentials not configured. Run aws configure or export AWS_PROFILE / AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY. |
| Old images still showing on site | CloudFront cache. Create an invalidation for /csgo/* (or specific paths) via the AWS console or CLI as shown above. |
# 1. Download new skins
cd ~/Projects/steam-img-downloader
source bin/activate
python3 index.py
# 2. Crop & resize
cd ~/Projects/steam-img-cropper
rsync -a ~/Projects/steam-img-downloader/all_cs2_skin_images/ tradeit-skins/csgo
npm run start
# 3. Push to CDN
aws s3 sync tradeit-cropped-skins/csgo s3://tradeit-prepared-skins/csgo