Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pixeldesu/shirase
:rabbit: Get anime information from currently running media players
https://github.com/pixeldesu/shirase
anime anitomy media-library processes
Last synced: 4 months ago
JSON representation
:rabbit: Get anime information from currently running media players
- Host: GitHub
- URL: https://github.com/pixeldesu/shirase
- Owner: pixeldesu
- License: mit
- Created: 2019-02-09T17:59:17.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-20T20:11:50.000Z (over 1 year ago)
- Last Synced: 2024-10-06T04:48:47.815Z (4 months ago)
- Topics: anime, anitomy, media-library, processes
- Language: TypeScript
- Size: 21.5 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# shirase
Shirase is a library that enables developers to get information of anime currently being played in media players.
## Installation
You can get shirase over npm
```
npm install shirase
```## Usage
Using shirase is really easy!
```js
import Shirase from 'shirase';
const shi = new Shirase();(async () => {
const information = await shi.getInformation();
console.log(information);
});
````information` (or however you name the Promise return value) is an object containing various fields of information coming from [anitomy](https://github.com/skiptirengu/anitomy-js).
## How does it work?
There are a lot of programs using a multitude of batch/shell/PowerShell scripts to get currently running anime, I wondered about there being a way to grab all of that information just inside NodeJS.
Shirase will query for all running processes, then check for a whitelist of media player process names (found in `Shirase.MEDIA_PLAYER_PROCESSES`) and filter these out.
Out of the narrowed list of processes, Shirase will use the PID to query the system for window information of that specific process.
This information includes the title, which we will prepare beforehand, consisting of removing eventual title suffixes (e.g. VLCs `- VLC media player`) and trimming it down.
Once that is done, the title will be passed to [anitomy](https://github.com/skiptirengu/anitomy-js), which parses the title into an object with various different fields from information given. After all players have been checked through, an array with all found information sets will be returned in the Promise.
## Contributing
### Feature Request / Player Support
If you run `shirase` locally, in a development setup and find that there's a player that hasn't been added to the internal list of supported ones yet, feel free to [open an issue](https://github.com/pixeldesu/shirase/issues/new) or a [pull request](https://github.com/pixeldesu/shirase/compare)!
## License
Shirase is licensed under the MIT License.