LINE 的贴图大部分都很可爱,很萌萌二次元,所以就想保存下来放到 QQ 、Telegram 上用。
一个一个的保存太麻烦,很久之前写了个脚本来下载。可是就在几月前,我那脚本和一百四十多小时的 BOTW 存档就因为 SSD 掉盘被某东的小哥带走了。满满当当的 MLC SSD 就这么变成了空荡荡的 TLC SSD ……
不过这都是很久以前的事情了,今天我又碰到一套好看的贴图想存下来,就 Google 看看有没有更简单的保存方法,然后看到 GitHub 上面有个把 LINE 贴图转到 Telegram 的工具,看一下源码发现了 LINE 的贴图包下载链接,可以直接下载。明明商店页面的图片还要验 Referrer 的说…
http://dl.stickershop.line.naver.jp/products/0/0/1/贴图ID/iphone/stickers@2x.zip
但这样也要手动改 url 再粘贴回车,还是很麻烦。
想到用油猴子应该可以在页面上加个下载按钮,可是我之前没接触过 js ,甚至连 js 的全名都拼不全……
好在搜索引擎是万能的,帮我解决了这些问题。不过还是有一些地方不明白,好多东西真是用到的时候才觉得少啊,可是不用的时候却不知道有什么用。
后来 Greasyfork 上的小伙伴(@seccomun) 说这个链接有问题,给了更好的贴图链接和絵文字的链接。 小伙伴 @Rongronggg9 给了消息贴图、自定义贴图和动态絵文字的链接。
下面是一些链接
静态贴图
https://stickershop.line-scdn.net/stickershop/v1/product/{ID}/iphone/stickers@2x.zip
动态/声音贴图
https://stickershop.line-scdn.net/stickershop/v1/product/{ID}/iphone/stickerpack@2x.zip
消息贴图(无字)
https://stickershop.line-scdn.net/stickershop/v1/product/{ID}/iphone/sticker_custom_plus_base@2x.zip
自定义贴图(无“***”)
https://stickershop.line-scdn.net/stickershop/v1/product/{ID}/iphone/sticker_name_base@2x.zip
表情贴
https://stickershop.line-scdn.net/sticonshop/v1/{ID}/sticon/iphone/package.zip?v=1
动态表情贴
https://stickershop.line-scdn.net/sticonshop/v1/{ID}/sticon/iphone/package_animation.zip
主题包
主题包的链接可以从主题页面的主题封面或预览图片中获取,比如像是这个主题 。
页面链接:https://store.line.me/themeshop/product/d93c073e-fcca-440b-93f6-e7e45a7645fa
封面: https://shop.line-scdn.net/themeshop/v1/products/d9/3c/07/d93c073e-fcca-440b-93f6-e7e45a7645fa/4/WEBSTORE/icon_198x278.png?__=20161019
预览图:https://shop.line-scdn.net/themeshop/v1/products/d9/3c/07/d93c073e-fcca-440b-93f6-e7e45a7645fa/4/ANDROID/ja/preview_001_720x1232.png
然后下载地址就是:
Android: https://shop.line-scdn.net/themeshop/v1/products/d9/3c/07/d93c073e-fcca-440b-93f6-e7e45a7645fa/4/ANDROID/theme.zip
iOS: https://shop.line-scdn.net/themeshop/v1/products/d9/3c/07/d93c073e-fcca-440b-93f6-e7e45a7645fa/4/IOS/theme.zip
下面是脚本内容,点这里 安装。也可以去 Greasyfork 安装。
LINE Sticker Download.user.js ./LINE%20Sticker%20Download.user.js Install (function ( ) { 'use strict' ; var path, id, btn, btn2, btnstr, btnstr2, link2, filename, link, lang; path = window .location .pathname ; id = path.replace (/\/(emoji|sticker)shop\/product\/([a-f\d]+).*/ , '$2' ); lang = document .documentElement .lang ; btnstr = 'Download' ; if (lang.indexOf ('zh' ) > -1 ) btnstr = '下载' ; else if (lang.indexOf ('ja' ) > -1 ) btnstr = 'ダウンロードする' ; if (path.indexOf ('stickershop' ) > -1 ) { if ($('span' ).hasClass ('MdIcoAni_b' ) || $('span' ).hasClass ('MdIcoPlay_b' ) || $('span' ).hasClass ('MdIcoSound_b' ) || $('span' ).hasClass ('MdIcoFlashAni_b' ) || $('span' ).hasClass ('MdIcoFlash_b' )) { link = 'https://stickershop.line-scdn.net/stickershop/v1/product/' + id + '/iphone/stickerpack@2x.zip' ; } else if ($('span' ).hasClass ('MdIcoMessageSticker_b' )) { link = 'https://stickershop.line-scdn.net/stickershop/v1/product/' + id + '/iphone/sticker_custom_plus_base@2x.zip' ; } else if ($('span' ).hasClass ('MdIcoNameSticker_b' )) { link = 'https://stickershop.line-scdn.net/stickershop/v1/product/' + id + '/iphone/sticker_name_base@2x.zip' ; } else { link = 'https://stickershop.line-scdn.net/stickershop/v1/product/' + id + '/iphone/stickers@2x.zip' ; } } else if (path.indexOf ('emojishop' ) > -1 ) { if ($('span' ).hasClass ('MdIcoPlay_b' )) { link = "https://stickershop.line-scdn.net/sticonshop/v1/" + id + "/sticon/iphone/package_animation.zip" ; } else { link = "https://stickershop.line-scdn.net/sticonshop/v1/" + id + "/sticon/iphone/package.zip?v=1" ; } } else if (path.indexOf ('themeshop' ) > -1 ) { id = $("div.mdCMN38Img>img" ).attr ("src" ).replace (/https\:\/\/shop.line-scdn.net\/themeshop\/v1\/products\/(.+)\/WEBSTORE\/.+/ , '$1' ); link = 'https://shop.line-scdn.net/themeshop/v1/products/' + id + '/ANDROID/theme.zip' ; link2 = 'https://shop.line-scdn.net/themeshop/v1/products/' + id + '/IOS/theme.zip' ; btnstr2 = btnstr + ' (iOS)' ; btnstr = btnstr + ' (Android)' ; btn2 = '<li style="list-style-type: none"><button class="MdBtn01P02" style="background: #00b84f" id="download2" >' + btnstr2 + '</button></li>' ; $('.mdCMN38Item01Ul' ).find ('li:eq(1)' ).remove (); $('.mdCMN38Item01Ul' ).append (btn2); } btn = '<li style="list-style-type: none"><button class="MdBtn01P02" style="background: #33b1ff" id="download" >' + btnstr + '</button></li>' ; $('.mdCMN38Item01Ul' ).find ('li:eq(0)' ).remove (); $('.mdCMN38Item01Ul' ).prepend (btn); if ($('div' ).hasClass ('mdMN05Btn' )) { $('.mdMN05Btn' ).prepend (btn2); $('.mdMN05Btn' ).prepend (btn); } filename = document .title .replace (/(.+) (-|–) .+/g , '$1' ); filename = filename.replace (/\"|\\|\/|\:|\*|\?|\<|\>|\|/g , "" ); var file = { url : link, name : filename + '.zip' }; var file2 = { url : link2, name : filename + ' (iOS).zip' }; $('body' ).on ('click' , '#download2' , function ( ) { var result = GM_download (file2); }); $('body' ).on ('click' , '#download' , function ( ) { var result = GM_download (file); }); }());