LINE Sticker Download

Add download button for line sticker store

Fra og med 10.10.2018. Se den nyeste version.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name               LINE Sticker Download
// @name:zh-CN         LINE Sticker Download
// @namespace          https://veltlion.github.io/line-sticker-download
// @include            https://store.line.me/stickershop/product/*
// @version            1.4
// @description        Add download button for line sticker store
// @description:zh-cn  在 LINE STORE Sticker 页面添加下载按钮
// @author             空
// @grant              GM_download
// ==/UserScript==

var id = window.location.pathname.replace(/[^\d]/g, '');
var link = 'https://sdl-stickershop.line.naver.jp/stickershop/v1/product/' + id + '/iphone/[email protected]';
var aslink = 'https://sdl-stickershop.line.naver.jp/stickershop/v1/product/' + id + '/iphone/[email protected]';
if ($('span').hasClass('MdIcoAni_b') || $('span').hasClass('MdIcoPlay_b') ||$('span').hasClass('MdIcoSound_b') ||
    $('span').hasClass('MdIcoFlashAni_b') || $('span').hasClass('MdIcoFlash_b')) link = aslink;
var file = { url: link, name: document.title.replace(/(.+) (-|–) .+/g, '$1') + '.zip' };
var lang = navigator.language;
var btnstr = 'Download';
if (lang.indexOf('zh') > -1) btnstr = '下载';
else if (lang.indexOf('ja') > -1) btnstr = 'ダウンロード';
var btn = '<li class="mdCMN08Li" style="list-style-type: none">';
    btn += '<a class="MdBtn01 mdBtn01" id="download" style="background: #33b1ff">';
    btn += '<span class="mdBtn01Inner">';
    btn += '<span class="mdBtn01Txt">' + btnstr + '</span>';
    btn += '</span></a></li>';
if ($('div').hasClass('mdCMN08Txt')) {
    $('ul').find('li:eq(0)').remove();
    $('.mdCMN08Ul').prepend(btn);
}
else if ($('div').hasClass('mdMN05Btn')) {
    //$('.MdBtn01').remove();
    $('div.mdMN05Btn').prepend(btn);
}
$('body').on('click', '#download', function(){
    var result = GM_download(file);
});