A site for hosting (Japanese) subtitles

Related tags

Command-line jimaku
Overview

jimaku (字幕)

jimaku is a simple site dedicated to hosting Japanese subtitles of anime or other Japanese content. It's the spiritual successor of kitsunekko.

Install

Right now, Rust v1.74 or higher is required. To install just run cargo build.

In order to actually run the server the static directory needs to be next to the executable. Maybe in the future there'll be a way to automatically move it.

In order to create an admin account, run the admin subcommand.

Configuration

Configuration is done using a JSON file. The location of the configuration file depends on the operating system:

  • Linux: $XDG_CONFIG_HOME/jimaku/config.json or $HOME/.config/jimaku/config.json
  • macOS: $HOME/Library/Application Support/jimaku/config.json
  • Windows: %AppData%/jimaku/config.json

The documentation for the actual configuration options is documented in the source code.

Data and Logs

The server also contains a database and some logs which are written to different directories depending on the operating system as well:

For data it is as follows:

  • Linux: $XDG_DATA_HOME/jimaku or $HOME/.local/share/jimaku
  • macOS: $HOME/Library/Application Support/jimaku
  • Windows: %AppData%/jimaku

For logs it is as follows:

  • Linux: $XDG_STATE_HOME/jimaku or $HOME/.local/state/jimaku
  • macOS: ./logs
  • Windows: ./logs

The data directory contains both a database and a secluded managed "trash" directory.

Fixtures

Since this site is made to be a replacement for kitsunekko, it has support for scraping and then loading the data to this server. In order to do this initially, a bootstrapping phase is necessary where it downloads all the files necessary and then generates a fixture.json file.

This fixture.json file essentially has all the data that was scraped in a format that the program can understand when loaded using the fixtures subcommand. This flow allows you to edit the data in a way without committing it to the database yet.

Long Term Scraping

As a temporary migration period, this program supports periodically scraping from kitsunekko to get the newest data uploaded in a similar manner to the fixtures and scrape subcommands. Currently this is set to every hour.

License

AGPL-v3.

Comments
  • [Feature Request] Route for searching by AniList ID

    [Feature Request] Route for searching by AniList ID

    Feature

    • Route for searching by AniList ID
      • Automatically redirects to the corresponding Jimaku entry
      • e.g. for the AniList URL anilist.co/anime/145728/-MERCHANT-MEETS-THE-WISE-WOLF/:
        • jimaku.cc/anilist?id=145728 -> jimaku.cc/entry/2272

    Motivation

    • This would enable creating a Tampermonkey script that adds a button to AniList anime pages that takes you directly to the corresponding Jimaku entry (if it exists)
    opened by RadianttK 8
  • [Feature Request / Discussion] Reducing the load time of the main page

    [Feature Request / Discussion] Reducing the load time of the main page

    Context

    • Currently the Jimaku home page loads in every entry from the database all at once, much the same way as Kitsunekko does.
      • As Kitsunekko does not have a search bar, this is useful as it gives the user the option to search for a particular entry using ctrl + f.
    • Since Jimaku has a proper search bar, it's not as necessary to load in every single entry when loading the main page.
    • Currently when loading Jimaku it takes me approximately ~7 seconds to load on average.
      • I think it would significantly improve the user experience if this was reduced.

    Ideas for possible solutions

    1. Deferred loading

      • Only load entries when the user initiates a search.
      • This reduces the initial load time significantly as it avoids fetching and rendering all entries at once.
    2. Data caching

      • Cache subtitle entries locally in the browser after the initial load.
      • Subsequent visits or searches can then use the cached data, reducing the need for frequent database queries.
        • I assume this would also require a mechanism to periodically update the cached data to reflect changes in the database, such as modified or deleted entries.
    3. Incremental loading

      • Only load a portion of the subtitle entries initially.
        • As the user scrolls, dynamically load additional entries from the database in smaller batches.
    4. Data pagination

      • Implement pagination for the main page to display entries in manageable chunks.
      • Only a set number of subtitles would load on a page, and the user could then click to go to the next page to see more.
      • This distributes the load evenly and prevents overwhelming the browser with a large amount of data at once.
    5. Server-side caching

      • Server-side caching mechanisms (e.g., Memcached or Redis) to store frequently accessed data and reduce database load.
    opened by RadianttK 5
  • [Feature Request] ass / srt conversion

    [Feature Request] ass / srt conversion

    not always ass subtitles are convenient, and third-party conversion is additional actions. ass and srt subtitles only have a difference in formatting, so it seems to me that it wouldn't be hard to do the conversion before downloading on the client side. i'm using this website now and it converts instantly, apparently it doesn't take a lot of resources to do it.

    opened by Kellenok 3
  • [Feature Request] Add provider script for Bazarr integration

    [Feature Request] Add provider script for Bazarr integration

    I'm not sure where Jimaku is getting all its great subtitle files but Bazarr's current set of sub providers is totally lacking when it comes to jp subs.

    I was wonder if it would be possible for the devs here to add integration of jimaku into bazarr. Bazarr provides some instructions and python boilerplate here

    https://wiki.bazarr.media/Troubleshooting/FAQ/#im-missing-or-want-a-subtitle-provider-added-to-bazarr

    Their API Template seems to be preferred but they also provide an alternative Page Scraping Template.

    This would be a huge help to those of us who use Sonarr to download anime and want JP subs added in automatically!

    opened by TaakoMagnusen 3
  • Mitigate spyware | Consider bridging with Matrix

    Mitigate spyware | Consider bridging with Matrix

    Hi! On your site you have a link to a discord server. This is considered dangerous because people who don't know that discord is malware could accidentally click on the link and install malware on their computer.

    In your PR you say that you don't want to remove the link. I understand that, but there are other options to consider.

    • [ ] Add a Matrix space (or just one room) and bridge it with discord.

      t2bot can be used to create a bridge between Discord and Matrix. Alternatively, the bot can be self-hosted. This way people would be able to talk to each other without being forced to interact with discord. People who still use discord will be able to talk with people who have joined the matrix room.

    • [ ] Add any other privacy-respecting communication platform. Session, Briar, Telegram, Simplex, etc.

    • [ ] Add a warning that the users will see before they are forwarded to discord.

      When people click on the discord link, they should be warned about the consequences. If they click "ok", then you could redirect them to the discord website.

    • [ ] Add a mailto link. Even though in the PR you say that there's a email address ([email protected]), it's nowhere to be found on the website. Consider linking it next to the other links in the footer.

    Since DJT already has a Matrix space, we could actually help you moderate your Matrix space, if you don't want to bother with it. You still need to set up the discord bridge yourself though.

    opened by tatsumoto-ren 3
  • [Feature Request] Indicate whether the Anime or the Drama section is active

    [Feature Request] Indicate whether the Anime or the Drama section is active

    Feature

    • Indicate whether "Anime" or "Live Action" is the page currently selected, e.g. by highlighting the text in the header

    Motivation

    • When switching between the two (in the process of uploading) I end up getting no search results and only then realize that I have to change to the other section. Looking at the URL helps, but having it highlighted would be easier.
    opened by conquerist 3
  • [API `/files`] The `episode` parameter seems to not always match files with a JPN name

    [API `/files`] The `episode` parameter seems to not always match files with a JPN name

    When selectively searching for subs using the episode parameter, files are likely not returned if they use the Japanese name of the show.
    This behavior can be primarily observed with live action entries, whose files usually follow this naming scheme:
    <show_name_jpn>#<episode_number>.srt

    An example using the following entry:

    {
      "id": 4583,
      "name": "#Remolove: Futsuu no Koi wa Jado",
      "english_name": "#Remolove",
      "japanese_name": "#リモラブ 〜普通の恋は邪道〜"
    }
    

    Looking at the files (list truncated), only subs with Japanese titles are available.

    [
      {"name": "#リモラブ~普通の恋は邪道~#10.srt"},
      {"name": "#リモラブ~普通の恋は邪道~#03.srt"},
      {"name": "#リモラブ~普通の恋は邪道~#05.srt"}
    ]
    

    Searching for episode number 3 using the API doesn't return anything.

    As a test, I reuploaded the subtitle for episode 5 using the full English name:
    #Remolove Futsuu no Koi wa Jado #05.srt

    Now, searching for episode 5 actually returns something:

    [
      {"name": "#Remolove Futsuu no Koi wa Jado #05.srt"}
    ]
    

    Interestingly enough, doing the same with the following entry...

    {
      "id": 240,
      "name": "2.43: Seiin Koukou Danshi Volley-bu",
      "english_name": "2.43: Seiin High School Boys Volleyball Team",
      "japanese_name": "2.43 清陰高校男子バレー部"
    }
    

    ...which has files with both the English and Japanese names of the show, it actually works fine.
    Here's what you get back when searching for episode 5:

    [
      {"name": "2.43.清陰高校男子バレー部.S01E05.スタンド・バイ・ミー.WEBRip.Netflix.ja[cc].srt"},
      {"name": "Ni Ten Yonsan Seiin Koukou Danshi Volley-bu 005.srt"}
    ]
    

    This led me to assume that the S01E05 substring is the key for a successful match, but turns out that might not necessarily be the case:
    As a test, I reuploaded yet another subtitle of entry 4583 using the JPN name, but this time with a season/episode format:
    #リモラブ~普通の恋は邪道~#S01E03.srt

    Unfortunately, searching for episode 3 still returns [].

    I am aware that matching is done on a best effort basis, but perhaps the filtering mechanism could be improved?
    Other example entries to test with: 2445, 4420

    opened by ThisIsntTheWay 2
  • Consider adding missing documentation

    Consider adding missing documentation

    In https://github.com/Rapptz/jimaku/issues/10 I mention that when I'm trying to open /admin, I'm getting immediately redirected back to /. There's no docs on managing the server, so I had to try different things. I've figured a way to access /admin. Apparently, You have to edit the database and mark yourself as admin by changing the user flag from 0 to 1. I don't know if this is the correct way, or if this is the only way, but I suggest documenting it in the README.

    Additionally, I suggest explaining how to manage the website because the /admin page is rather bare-bones.

    • [ ] How to add, remove, users.
    • [ ] How to assign someone as an editor.
    • [ ] How to add, delete, edit subtitles.
    opened by tatsumoto-ren 2
  • Update readme

    Update readme

    As I mentioned in #10, there's not enough documentation about setting up the server. This PR adds some information about the locally created files and directories, but it doesn't address all the mentioned issues. Those can be addressed in a separate PR.

    opened by tatsumoto-ren 2
  • Regarding the server

    Regarding the server

    Since there's no Matrix space yet, can I ask some questions here instead?

    When I ran the site locally, I noticed one strange thing. If you change an html file and reload the page, or even restart the binary, the page doesn't update. The new content is shown only when I re-run cargo run. I haven't studied the code much, but are the html pages being baked into the binary? Otherwise I'm not sure why it's happening.

    Sometimes, when I run the server, I can't kill it with ctrl+c afterwards. Only kill -9 works. But sometimes it works just fine.

    It is not documented where I should look for configs,databases,logs,leftovers,etc. By running lsof and find I could figure out that:

    • the config is placed in ~/.config/jimaku,
    • the databases are placed in ~/.local/share/jimaku,
    • the logs are placed in ~/.local/state/jimaku.

    Are there any other files that jimaku creates? I think, ideally they should be mentioned in the README.

    Lastly, how do I access the admin page? Haven't quite figured it out yet.

    opened by tatsumoto-ren 2
  • Add license information in *.js files

    Add license information in *.js files

    Related to #7. Related to https://github.com/tatsumoto-ren/tatsumoto-ren.github.io/pull/28

    As I said there, I don't know what to do with https://cdn.jsdelivr.net/npm/@scalar/api-reference yet, but if this is merged, all pages except the API reference should work fine.

    opened by tatsumoto-ren 2
  • [Feature Request - API] Display amount of files for an entry

    [Feature Request - API] Display amount of files for an entry

    Feature

    Add a new key to an entries metadata that displays the amount of files associated with said entry, e.g.:

    {
      "id": 729,
      "name": "Sousou no Frieren",
      "files": 109, # <----
      ...
    }
    

    Motivation

    Some shows, mostly unverified and externally imported ones, only have archives instead of uncompressed subtitles uploaded.
    As such, the amount of files is often times much lower than the shows episode count.
    (Of course, one also needs to take into account the amount of currently available episodes for currently airing shows)

    Knowing the beforehand would make it possible to estimate if an entry only has archives uploaded. This could save one API call for every files query because we'd be able to make an educated guess whether to use the episode parameter or not.
    (Many archives have names that seem to elude the episode number matching algorithm, so nothing would get returned)

    Perhaps the key could even show the amount of archives vs uncompressed subtitles to facilitate an even more 'accurate' guess.

    opened by ThisIsntTheWay 1
Standalone analytics provider and realtime dashboard designed for self-hosting.

Stats Stats is a high-performance, standalone analytics provider designed for self-hosting, enabling the collection and viewing of event data from web

Udara Jay 120 Mar 23, 2024
Node.js Project Template for hosting on shuttle.rs

Node.js on shuttle.rs Template This Template is a starting point for creating a Node.js project on the shuttle.rs. It is a simple discord bot template

Arnav Kumar 7 Apr 18, 2024
Kurzlink is a simple static site generator built in rust

kurzlink What is kurzlink? Kurzlink is a simple static site generator built in rust.

Evy Garden 2 Dec 15, 2022
A Rust on-site channel benchmarking helper. Inter-Process (async / busy) & Intra-Process (async single threaded / async multi threaded)

On-Site Rust Channel Benchmarking Helper Deploy on server to determine which public crates are the fastest for communicating in different architecture

null 23 Jul 9, 2024
Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

null 294 Dec 23, 2022
Subtitles-rs - Use SRT subtitle files to study foreign languages

Rust subtitle utilities Are you looking for substudy? Try here. (substudy has been merged into the subtitles-rs project.) This repository contains a n

Eric Kidd 268 Dec 29, 2022
A Japanese Morphological Analyzer written in pure Rust

Yoin - A Japanese Morphological Analyzer yoin is a Japanese morphological analyze engine written in pure Rust. mecab-ipadic is embedded in yoin. :) $

Agata Naomichi 21 Apr 30, 2022
A highly customizable snake clone made in Rust with the Bevy engine, named after the Japanese word for snake, 蛇.

Hebi ?? A highly customizable snake clone made in Rust with the Bevy engine, named after the Japanese word for snake, 蛇(へび). Configuration One of the

Elnu 79 Dec 7, 2022
Rust programming, in Japanese

sabi In Japanese version https://github.com/bnjbvr/rouille. Shamelessly copied and updated from it. 日本語で Rust プログラムを書くことができます! 例 main.rs sabi::sabi! {

Yuki Toyoda 54 Dec 30, 2022
A CLI tool to get World Cup 2022 tweets for Japanese fans.

samuraicup A CLI tool to get World Cup 2022 tweets for Japanese fans. 仕事中にワールドカップをばれないように見る、CLI ツールを Rust で作ってみた こんにちは、ekusiadadus です。 日本が死の組をまさかの一位通過

ekusiadadus 3 Dec 10, 2022
murasaki: Nostr to Speech (in Japanese)

murasaki: Nostr to Speech ⚠ このソフトウェアはα版です ⚠ VOICEVOX を利用したタイムライン読み上げツールです。 指定したリレーのグローバルタイムライン、または指定した公開鍵でフォローしているユーザのタイムラインを読み上げます。 つかいかた Rust をインストー

Yoji Shidara 16 Mar 27, 2023
Web service generating images of Japanese (Riichi) Mahjong hands.

chombo-gen ChomboGen is a web service that allows to generate images of Japanese (Riichi) Mahjong hands. The hands are provided in a text format and a

Mateusz Maćkowski 5 May 2, 2023
A small CLI utility for helping you learn japanese words made in rust 🦀

Memofante (Clique aqui ver em português) Memofante is here, a biiiig help: Do you often forget japanese words you really didn't want to forget? Do you

Tiaguinho 3 Nov 4, 2023
Host These Things Please - a basic http server for hosting a folder fast and simply

http Host These Things Please - a basic HTTP server for hosting a folder fast and simply Selected features See the manpage for full list. Symlinks fol

thecoshman 367 Dec 23, 2022
A low-ish level tool for easily writing and hosting WASM based plugins.

A low-ish level tool for easily writing and hosting WASM based plugins. The goal of wasm_plugin is to make communicating across the host-plugin bounda

Alec Deason 62 Sep 20, 2022
A tool to aid in self-hosting. Expose local services on your computer, via a public IPv4 address.

innisfree A tool to aid in self-hosting. Expose local services on your computer, via a public IPv4 address. Why? Most of the data I maintain is local,

Conor Schaefer 7 Mar 19, 2022
Bottlerocket - An operating system designed for hosting containers

Bottlerocket OS Welcome to Bottlerocket! Bottlerocket is a free and open-source Linux-based operating system meant for hosting containers. If you’re r

null 7k Dec 31, 2022
A free file hosting server that focuses on speed, reliability and security.

Triox Next Generation cloud storage server that is secure, fast, and reliable. Why Triox? ☘️ Open Source - We strongly believe in collaboration and tr

Triox 81 Nov 16, 2022
Build your service-server fast, easy (and without hosting!)

service-io is a library to build servers that offering services with really little effort. Choose an input connector. Choose an output connector. Choo

Luis Enrique Muñoz Martín 34 Jan 4, 2023
A stupidly simple and easy to self-host, personal server for file hosting on the web

Grasswave CDN A stupidly simple and easy to self-host, personal server for file hosting on the web. Written in Rust. Thanks, @Maciejowski, for the sty

Rafał Baran 3 Jan 3, 2023