Skip to content

Instantly share code, notes, and snippets.

@curegit
Created June 12, 2025 10:15
Show Gist options
  • Save curegit/e306fcb0b9635dd1dfa3f9e3fdb8f602 to your computer and use it in GitHub Desktop.
Save curegit/e306fcb0b9635dd1dfa3f9e3fdb8f602 to your computer and use it in GitHub Desktop.
LINE Sticon をダウンロードするやつ
javascript: (async function () {
function validateSticonIdFormat(id) {
return /^[a-f0-9]{8,}$/.test(id);
}
function buildSticonZipUri(id, animation = false, platform = "iphone") {
const suffix = animation ? "_animation" : "";
/* No content difference between iPhone and Android for now */
return `https://stickershop.line-scdn.net/sticonshop/v1/${id}/sticon/${platform}/package${suffix}.zip`;
}
function downloadSticonZip(id, animation = false, blank = false) {
const uri = buildSticonZipUri(id, animation);
const link = document.createElement("a");
link.href = uri;
if (blank) {
link.target = "_blank";
}
link.download = `Sticon-${id}.zip`;
link.dispatchEvent(new MouseEvent("click"));
}
function getSticonIdFromUrl() {
const url = window.location.href;
const match = url.match(/\/emojishop\/product\/([a-f0-9]{8,})\//);
return match ? match[1] : null;
}
const id = getSticonIdFromUrl();
if (!id || !validateSticonIdFormat(id)) {
alert("Invalid or missing package ID in URL");
return;
}
downloadSticonZip(id, false);
await new Promise((r) => setTimeout(r, 1000));
/* Try animated version (fails if it's static only) */
downloadSticonZip(id, true, true);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment