How kidtomboy/remake-anisub works
Main Components
• User Interface: Represented by the command-line interface where users interact with the tool.
• CLI Controller/Orchestrator: The main script (anisub.sh) that parses user commands and directs application logic.
• Dependency Checker & Installer: A component that ensures necessary utilities (curl, jq, pup, fzf, mpv/VLC, yt-dlp, ffmpeg) are available and installs updates if needed.
• Anime Source Handler: Manages fetching anime data from the supported sources (e.g., OPhim, AniData) using HTTP calls through curl and processes JSON responses (with jq and pup).
• Media Player Integration: Interface that communicates with external media players like MPV or VLC to stream the video content.
• Download Manager & Video Processing: Module handling the downloading of episodes (using yt-dlp) and video manipulation tasks (using ffmpeg) such as cutting or joining video files.
• Configuration Manager: Reads and possibly writes settings (stored in ~/.config/anisub_cli/config.cfg) such as default media player, download directories, theme settings, etc.
• Update Module: Ability to self-update the script to newer versions.
Relationships and Data Flow
• From the CLI Controller, branch out:
• From the Anime Source Handler, data flows back to the CLI Controller and ultimately to the Media Player Integration for streaming.
• If downloading is chosen, data flows from the CLI Controller to the Download Manager/Videoprocessing module.
• The Update Module is triggered by specific user commands and interacts with the CLI Controller similarly.
Architectural Patterns and Design Principles
• Even though the implementation is a monolithic bash script, logically segment the workflow into modules to improve clarity.
• Modularity by separating concerns (e.g., network operations, media control, configuration management).