Line Sticker Downloader

Download stickers from LINE store pages using GM_download

  1. // ==UserScript==
  2. // @name Line Sticker Downloader
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Download stickers from LINE store pages using GM_download
  6. // @author cheerchen
  7. // @match https://store.line.me/stickershop/product/*
  8. // @grant GM_download
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. function extractAndDownload() {
  16. const stickerList = document.querySelectorAll('.FnStickerList li');
  17. stickerList.forEach((li) => {
  18. const dataPreview = li.getAttribute('data-preview');
  19. if (dataPreview) {
  20. const preview = JSON.parse(dataPreview);
  21. const url = preview.animationUrl ? preview.animationUrl : preview.staticUrl;
  22. const filename = preview.id + (preview.animationUrl ? '.png' : '.png');
  23.  
  24. // Using GM_download to initiate the download
  25. GM_download({
  26. url: url,
  27. name: filename,
  28. saveAs: false, // Change to true if you want to prompt for save location
  29. onerror: function(error) {
  30. console.error('Download failed:', error);
  31. },
  32. onload: function() {
  33. console.log('Download completed:', filename);
  34. }
  35. });
  36. }
  37. });
  38. }
  39.  
  40. // Add a button to trigger download
  41. const downloadBtn = document.createElement('button');
  42. downloadBtn.textContent = 'Download Stickers';
  43. downloadBtn.style.position = 'fixed';
  44. downloadBtn.style.top = '10px';
  45. downloadBtn.style.right = '10px';
  46. downloadBtn.style.zIndex = '1000';
  47. downloadBtn.style.padding = '10px 20px';
  48. downloadBtn.style.background = '#4CAF50';
  49. downloadBtn.style.color = 'white';
  50. downloadBtn.style.border = 'none';
  51. downloadBtn.style.borderRadius = '5px';
  52. downloadBtn.style.cursor = 'pointer';
  53. downloadBtn.addEventListener('click', extractAndDownload);
  54.  
  55. document.body.appendChild(downloadBtn);
  56. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址