Last active
April 8, 2020 02:28
-
-
Save KuanYuChang/072d6863d9369ca71b0f3c3018814210 to your computer and use it in GitHub Desktop.
Save LINE sticker packages by ID; prerequisite: unzip, imagemagick
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ID=$1 | |
| ZIP="https://stickershop.line-scdn.net/stickershop/v1/product/${ID}/android/stickers.zip" | |
| ICON="https://stickershop.line-scdn.net/stickershop/v1/product/${ID}/LINEStorePC/main.png" | |
| DIR="${HOME}/line/${ID}" | |
| echo LINE store: https://store.line.me/stickershop/product/${ID} | |
| if [ -d "${DIR}" ]; then | |
| echo Already downloaded. | |
| exit 1 | |
| fi | |
| mkdir -p "${DIR}"; cd "${DIR}" | |
| curl -sSL "${ZIP}" -o "IP_${ID}.zip" | |
| unzip "IP_${ID}.zip" > /dev/null | |
| rm *key* tab* productInfo.meta | |
| rm "IP_${ID}.zip" | |
| for p in $(ls -A); do | |
| convert "${p}" -resize 512x512 "${p}" > /dev/null | |
| if [ $? -ne 0 ]; then | |
| curl -sSL "https://stickershop.line-scdn.net/stickershop/v1/sticker/${p%.*}/android/sticker.png" -o "${p}" | |
| convert "${p}" -resize 512x512 "${p}" | |
| fi | |
| convert "${p}" -sharpen 0x2 "${p}" | |
| done | |
| curl -sSL "${ICON}" -o cover.png | |
| convert cover.png -resize 100x100! icon.png | |
| echo Done. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment