Last active
March 8, 2024 00:47
-
-
Save bemitc/edce0f1cd879fbf9df4b44d8b4b7133e to your computer and use it in GitHub Desktop.
This file contains 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
// ==UserScript== | |
// @name animelon-subtitle-downloader | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description download animelon subtitles | |
// @author mescyn#5794 | |
// @match https://animelon.com/video/* | |
// @grant unsafeWindow | |
// @grant GM_registerMenuCommand | |
// @require https://cdn.jsdelivr.net/npm/file-saver-es@2.0.5/dist/FileSaver.min.js | |
// ==/UserScript== | |
GM_registerMenuCommand("Download Subtitles", AnimelonSubtitleDownloader); | |
// downloads all subtitle options (english, hiragana, katakana, japanese romaji) | |
function AnimelonSubtitleDownloader() | |
{ | |
var subtitles = angular.element(dialogueHistoryLists).scope().$parent.subtitlesArray; | |
for (var i = 0; i < subtitles.length; i++) | |
{ | |
var s = subtitles[i].assString; | |
var decodedSubtitles = CryptoJS.AES.decrypt(s.substring(8,s.length-5),s.substring(0,8).split("").reverse().join("")).toString(CryptoJS.enc.Utf8).replace(/undefined/g,""); | |
var blob = new Blob([decodedSubtitles], {type: "text/plain;charset=utf-8"}); | |
var subtitle_name = "animelon_" + document.URL.split('/').reverse()[0] + '_' + subtitles[i].language + '.ass'; | |
saveAs(blob, subtitle_name); | |
} | |
} |
You need the tampermonkey chrome extension. You can install the userscript by hitting raw on the gist, and you'll be prompted to install it. Once installed while viewing a video, you can right click and then Tamper Monkey > anime-subtitle-downloader > Download subtitles (or just click on the tampermonkey icon and hit download subtitles from there, either way).
It does download all the subtitles for the show (normal japanese, hiragana, katakana, and english).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use this script