Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

Latest commit

 

History

26 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Archive Notice

Important

This project is archived as of February 23, 2026.
No further updates or maintenance.

I'm now developing a completely new version in Go. with better architecture, more features, and improved UX/UI.

→ Check out the successor project:
hianime-cli

Hianime with Local MPV

Python

Description

A CLI Python tool for streaming anime from hianime.to—the standout site for its superior soft-subbed episodes—straight into your local MPV player. Unlike other anime platforms, this lets you override them with your own, especially people want to use Japanese originals sub fetched via the Jimaku API. Perfect for people wants a lightweight hianime MPV extension with series pinning, history tracking, and seamless multi-language subtitle swaps.

Disclaimer

This tool is for educational and personal use only. It demonstrates web scraping and media integration techniques—use responsibly, respect site terms of service, and be mindful of copyrights. I'm not affiliated with any third-party sites or services.

Introduction

This code was mostly written with AI assistance. I just gave the idea for what to build, then handled some code tweaks and cleanup. It's great for people who want to importing subtitles in other languages and using MPV extensions for hianime.

cli-demo.mp4

Shoutouts

  • Huge thanks to the MediaVanced repo—this project wouldn't have been possible without it!
  • And big props to aniyomi-extensions for the inspiration.

Features

  • 📌 Pin Series: Save your favorites for quick access.
  • 📺 Recent History: Pick up where you left off.
  • 🌐 Jimaku API Integration: Fetch and import Japanese subtitles.

Enhancements

Pair this tool with these for an even better experience:

  • For automatic subtitle syncing with the English subs from hianime.to, check out AutoSubSync-MPV. It handles unsync subs automatically. Select to 'Sync to another subtitle' then select the sub_english_temp..srt (It should be in the last order and the format is .srt).

Requirements

  • Python 3.12+
  • MPV player (install via official site) and add to PATH. Test with mpv --version
  • yt-dlp (download the latest release here place yt-dlp.exe in the same directory as MPV or another PATH directory)
  • FFmpeg (install via official site or with winget install ffmpeg) and add to PATH. Test with ffmpeg -version
  • Key libraries (via requirements.txt): requests (for APIs), beautifulsoup4 (for parsing), etc. Full list in requirements.txt

Installation

  1. git clone https://github.com/dhilzyi/hianime-with-local-mpv.git
  2. cd hianime-with-local-mpv
  3. pip install -r requirements.txt

Usage

python hianime.py

Use python hianime.py --command as you can print the raw mpv command for debugging such as using another command mpv.

  • Paste an anime URL (e.g., https://hianime.to/watch/one-piece-100).
  • Select options like episode, or 'p' to pin to series.
  • Choose servers manually or automatically.
  • Set your directory for downloaded subtitle in variable SUBTITLE_BASE_DIR. It is "F:/Subtitle" as a default.
  • Set your JIMAKU_API_KEY in environment variables.
  • Turn on/off Jimaku in config.json by setting "jimaku_enabled": true. or false.

Troubleshooting

  • Jimaku API issues: Get your key from jimaku.cc and add it to environment variables (e.g. JIMAKU_API_KEY=yourkey) or paste directly in the code.
  • MPV not launching? Ensure it's in your PATH. Test with mpv --version
  • If subtitle are not converting. Ensure FFmpeg in your PATH. Test with ffmpeg -version or if it's not installed, install first.
  • yt-dlp not detected? Run yt-dlp --version to check. If not found, make sure the folder containing yt-dlp.exe is in your PATH (you can also put it in the same folder as MPV).

Contributing

Pull requests welcome! Fork the repo, create a branch, and submit.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Python CLI for streaming hianime.to anime in local MPV with Jimaku subtitle imports, series pinning, and history tracking

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages