Skip to content

Instantly share code, notes, and snippets.

@bemitc
Last active April 21, 2025 16:18
Show Gist options
  • Select an option

  • Save bemitc/edce0f1cd879fbf9df4b44d8b4b7133e to your computer and use it in GitHub Desktop.

Select an option

Save bemitc/edce0f1cd879fbf9df4b44d8b4b7133e to your computer and use it in GitHub Desktop.
// ==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);
}
}
@EyeXoYui

Copy link
Copy Markdown

How to use this script

@bemitc

bemitc commented Apr 23, 2023

Copy link
Copy Markdown
Author

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).

@48kMcFae

48kMcFae commented Sep 4, 2024

Copy link
Copy Markdown

doesnt seem to list when right clicking on a video, does this still work?

@bemitc

bemitc commented Sep 4, 2024

Copy link
Copy Markdown
Author

I just tested it, and the menu correctly displayed under tampermonkey > animelon-subtitle-downloader > download subtitles

If that doesn't work, you can access the same functionality from the tampermonkey menu

@PumpkinSoupactuallytastesgood

Copy link
Copy Markdown

Hi, actually I have the same issue. I downloaded Tampermonkey and the code but it doesn't seem to work :'(. Do you perhaps know what the issue could be? Thank you for the help!
image
image

@bemitc

bemitc commented Sep 11, 2024

Copy link
Copy Markdown
Author

I did notice the menu disappears after the first time you right click on it which I can look into. However, not working at all seems like it might be related to dev mode not being enabled, based on the 2nd screenshot.

@pesawaterbang

Copy link
Copy Markdown

Anyone knows? which sites provide multiple substitle like animelon?

@bemitc

bemitc commented Nov 22, 2024

Copy link
Copy Markdown
Author

I don't know offhand but you might ask in refold japanese or migaku's discord or one of the other large japanese discords...alternately get kitsunekko subs from whatever show you're watching and use asbplayer

@origin2008

Copy link
Copy Markdown

Hey guys. This script appears to use the Dynamic UserScript API. However, TamperMonkey's default settings are not like that, so go to the settings in the dashboard and change to expert mode, access script cookies in security settings, and Default tab types to run scripts in, All tabs.
Change the Allow scripts to access local files setting to all. And you can use it by changing the content script API to userscripts API dynamics.

Since I used Google Translator, there may be inaccurate translations. I ask for your understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment