@media-engine/providers 1.8.1 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Media Engine contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,164 +1,172 @@
1
- # @media-engine/providers
2
-
3
- **English** | [Русский](https://github.com/Yaneart/media-engine/blob/main/packages/providers/README.ru.md)
4
-
5
- Ready-to-use data sources for Media Engine. Install this package when you want to search real public
6
- catalogs without writing provider adapters yourself.
7
-
8
- ## Install
9
-
10
- ```bash
11
- npm install @media-engine/core @media-engine/providers
12
- ```
13
-
14
- The built-in providers do not need your API keys.
15
-
16
- ## Search metadata
17
-
18
- ```ts
19
- import { MediaEngine } from "@media-engine/core";
20
- import {
21
- aniListProvider,
22
- cinemetaProvider,
23
- kinobdProvider,
24
- shikimoriProvider,
25
- } from "@media-engine/providers";
26
-
27
- const media = new MediaEngine({
28
- providers: [
29
- kinobdProvider(),
30
- cinemetaProvider(),
31
- shikimoriProvider(),
32
- aniListProvider(),
33
- ],
34
- });
35
-
36
- const result = await media.search({ title: "One Piece" });
37
- ```
38
-
39
- Connect only the sources your application needs. The engine calls suitable providers and merges
40
- matching results for you.
41
-
42
- Shikimori and AniList also support explicit anime relationships:
43
-
44
- Shikimori details normalize the first usable full-size screenshot as a landscape `backdrop` and
45
- preserve the remaining screenshots as `still` images. AniList's wider banner remains a fallback.
46
- For merged anime posters, Core prefers AniList's higher-resolution `coverImage.extraLarge` when
47
- providers do not expose dimensions.
48
-
49
- ```ts
50
- const relations = await media.getRelatedMedia({
51
- shikimori: "52991",
52
- type: "anime",
53
- });
54
- ```
55
-
56
- The response preserves prequel, sequel, side-story, and other official relation kinds without
57
- grouping titles by franchise-name heuristics.
58
-
59
- Available metadata providers:
60
-
61
- - `kinobdProvider()` and `cinemetaProvider()` for movies and series;
62
- - `shikimoriProvider()` and `aniListProvider()` for anime;
63
- - `tvMazeProvider()` and `wikidataProvider()` as additional identity sources;
64
- - `imdbDatasetProvider()` for an IMDb dataset managed by your application.
65
-
66
- TVmaze data requires attribution. Keep and display the TVmaze source link included in a result. See
67
- the [TVmaze API license](https://www.tvmaze.com/api#licensing).
68
-
69
- The optional SQLite-backed IMDb dataset tools need Node.js 22.13 or newer. Everything else in the
70
- package keeps the normal Node.js 20 baseline.
71
-
72
- ## Find player options
73
-
74
- ```ts
75
- import {
76
- flixHqStreamingProvider,
77
- kinobdStreamingProvider,
78
- } from "@media-engine/providers";
79
-
80
- const media = new MediaEngine({
81
- streamingProviders: [kinobdStreamingProvider(), flixHqStreamingProvider()],
82
- });
83
-
84
- const result = await media.getAvailability({
85
- type: "series",
86
- title: "Game of Thrones",
87
- seasonNumber: 1,
88
- episodeNumber: 1,
89
- });
90
-
91
- for await (const snapshot of media.getAvailabilityProgressively({
92
- type: "series",
93
- ids: { kinopoisk: "435" },
94
- seasonNumber: 1,
95
- episodeNumber: 1,
96
- })) {
97
- updatePlayerSources(snapshot.availability?.options ?? []);
98
- }
99
- ```
100
-
101
- The package also exports `ddbbStreamingProvider()`, `aniLibertyStreamingProvider()`,
102
- `filmixStreamingProvider()`, `veoVeoStreamingProvider()`, `videoHubStreamingProvider()`,
103
- `rutubeStreamingProvider()`, and
104
- `experimentalStreamingProvider()`.
105
- Add them explicitly when they fit your application. Filmix guest mode is capped at 480p and filters
106
- known copyright/service placeholder videos. A user-owned device token raises the cap to 720p.
107
- Authenticated mode requires an HTTPS `baseUrl` unless the application explicitly enables
108
- `allowInsecureHttpToken` for a local compatibility test. That override sends the token without TLS
109
- and must not be used in a public deployment. Returned CDN video URLs use HTTPS. VeoVeo uses DDBB only to resolve its
110
- public content ID, discards the iframe token, and returns direct signed HTTPS HLS. VideoHUB uses a Kinopoisk ID, lists an
111
- anime season/episode catalog from one playlist request, and returns short-lived direct MP4 qualities
112
- for movies or one exact series/anime episode. Anime accepts an absolute episode or a seasonal episode
113
- pair and preserves both identities in its result. Its links are bound to the
114
- playback User-Agent and may also be bound to the requesting public IP. Pass the playback client's
115
- exact User-Agent as `MediaEngineOperationOptions.playbackUserAgent`; the required value is retained
116
- in each option's `access.headers` for non-browser clients.
117
- VideoHUB implements progressive availability, so every resolved translation can be displayed before
118
- slower lookups finish. Its bounded warm cache keeps playlists and signed video resolutions separate,
119
- never serves signed links stale, and preserves their original expiry.
120
- Rutube performs a bounded exact title/year movie search and returns only Rutube's documented public
121
- embed player. It does not expose or proxy Rutube media URLs and intentionally skips series.
122
-
123
- These providers return third-party links or streams. Media Engine does not host the video, and an
124
- external player may be unavailable in some countries, networks, or browsers.
125
-
126
- ## Discover torrent releases
127
-
128
- Torrent providers are always opt-in:
129
-
130
- ```ts
131
- import {
132
- bitsearchTorrentProvider,
133
- jacRedTorrentProvider,
134
- magnetzTorrentProvider,
135
- ytsTorrentProvider,
136
- } from "@media-engine/providers";
137
-
138
- const media = new MediaEngine({
139
- torrentProviders: [
140
- ytsTorrentProvider(),
141
- jacRedTorrentProvider(),
142
- bitsearchTorrentProvider(),
143
- magnetzTorrentProvider(),
144
- ],
145
- });
146
-
147
- const result = await media.discoverTorrents({
148
- type: "movie",
149
- title: "Inception",
150
- year: 2010,
151
- ids: { imdb: "tt1375666" },
152
- });
153
- ```
154
-
155
- Discovery only returns normalized candidates and their handoff data. It does not download torrent
156
- metadata, contact trackers, join a swarm, or play a file.
157
-
158
- Public sources can change, rate-limit requests, or go offline. Keep engine caching enabled and
159
- expect occasional partial results. Provider-specific settings and safety boundaries are described in
160
- the [provider guide](https://github.com/Yaneart/media-engine/blob/main/docs/providers.md).
161
-
162
- ## License
163
-
164
- MIT
1
+ # @media-engine/providers
2
+
3
+ **English** | [Русский](https://github.com/Yaneart/media-engine/blob/main/packages/providers/README.ru.md)
4
+
5
+ Ready-to-use data sources for Media Engine. Install this package when you want to search real public
6
+ catalogs without writing provider adapters yourself.
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ npm install @media-engine/core @media-engine/providers
12
+ ```
13
+
14
+ The built-in providers do not need your API keys.
15
+
16
+ ## Search metadata
17
+
18
+ ```ts
19
+ import { MediaEngine } from "@media-engine/core";
20
+ import {
21
+ aniListProvider,
22
+ cinemetaProvider,
23
+ kinobdProvider,
24
+ tmdbProvider,
25
+ shikimoriProvider,
26
+ } from "@media-engine/providers";
27
+
28
+ const media = new MediaEngine({
29
+ providers: [
30
+ kinobdProvider(),
31
+ tmdbProvider(),
32
+ cinemetaProvider(),
33
+ shikimoriProvider(),
34
+ aniListProvider(),
35
+ ],
36
+ });
37
+
38
+ const result = await media.search({ title: "One Piece" });
39
+ ```
40
+
41
+ Connect only the sources your application needs. The engine calls suitable providers and merges
42
+ matching results for you.
43
+
44
+ Shikimori and AniList also support explicit anime relationships:
45
+
46
+ Shikimori details normalize the first usable full-size screenshot as a landscape `backdrop` and
47
+ preserve the remaining screenshots as `still` images. AniList's wider banner remains a fallback.
48
+ For merged anime posters, Core prefers AniList's higher-resolution `coverImage.extraLarge` when
49
+ providers do not expose dimensions.
50
+
51
+ ```ts
52
+ const relations = await media.getRelatedMedia({
53
+ shikimori: "52991",
54
+ type: "anime",
55
+ });
56
+ ```
57
+
58
+ The response preserves prequel, sequel, side-story, and other official relation kinds without
59
+ grouping titles by franchise-name heuristics.
60
+
61
+ Available metadata providers:
62
+
63
+ - `tmdbProvider()` for localized movie and series metadata through a public Stremio addon;
64
+ - `kinobdProvider()` and `cinemetaProvider()` as independent movie and series sources;
65
+ - `shikimoriProvider()` and `aniListProvider()` for anime;
66
+ - `tvMazeProvider()` and `wikidataProvider()` as additional identity sources;
67
+ - `imdbDatasetProvider()` for an IMDb dataset managed by your application.
68
+
69
+ TVmaze data requires attribution. Keep and display the TVmaze source link included in a result. See
70
+ the [TVmaze API license](https://www.tvmaze.com/api#licensing).
71
+
72
+ `tmdbProvider()` uses the public [TMDB Stremio addon](https://github.com/mrcanelas/tmdb-addon)
73
+ and needs no user token. Its host can be changed with `baseUrl`; Cinemeta continues to work if
74
+ the addon is unavailable. Applications displaying TMDB data should follow
75
+ [TMDB's attribution requirements](https://developer.themoviedb.org/docs/faq).
76
+
77
+ The optional SQLite-backed IMDb dataset tools need Node.js 22.13 or newer. Everything else in the
78
+ package keeps the normal Node.js 20 baseline.
79
+
80
+ ## Find player options
81
+
82
+ ```ts
83
+ import {
84
+ flixHqStreamingProvider,
85
+ kinobdStreamingProvider,
86
+ } from "@media-engine/providers";
87
+
88
+ const media = new MediaEngine({
89
+ streamingProviders: [kinobdStreamingProvider(), flixHqStreamingProvider()],
90
+ });
91
+
92
+ const result = await media.getAvailability({
93
+ type: "series",
94
+ title: "Game of Thrones",
95
+ seasonNumber: 1,
96
+ episodeNumber: 1,
97
+ });
98
+
99
+ for await (const snapshot of media.getAvailabilityProgressively({
100
+ type: "series",
101
+ ids: { kinopoisk: "435" },
102
+ seasonNumber: 1,
103
+ episodeNumber: 1,
104
+ })) {
105
+ updatePlayerSources(snapshot.availability?.options ?? []);
106
+ }
107
+ ```
108
+
109
+ The package also exports `ddbbStreamingProvider()`, `aniLibertyStreamingProvider()`,
110
+ `filmixStreamingProvider()`, `veoVeoStreamingProvider()`, `videoHubStreamingProvider()`,
111
+ `rutubeStreamingProvider()`, and
112
+ `experimentalStreamingProvider()`.
113
+ Add them explicitly when they fit your application. Filmix guest mode is capped at 480p and filters
114
+ known copyright/service placeholder videos. A user-owned device token raises the cap to 720p.
115
+ Authenticated mode requires an HTTPS `baseUrl` unless the application explicitly enables
116
+ `allowInsecureHttpToken` for a local compatibility test. That override sends the token without TLS
117
+ and must not be used in a public deployment. Returned CDN video URLs use HTTPS. VeoVeo uses DDBB only to resolve its
118
+ public content ID, discards the iframe token, and returns direct signed HTTPS HLS. VideoHUB uses a Kinopoisk ID, lists an
119
+ anime season/episode catalog from one playlist request, and returns short-lived direct MP4 qualities
120
+ for movies or one exact series/anime episode. Anime accepts an absolute episode or a seasonal episode
121
+ pair and preserves both identities in its result. Its links are bound to the
122
+ playback User-Agent and may also be bound to the requesting public IP. Pass the playback client's
123
+ exact User-Agent as `MediaEngineOperationOptions.playbackUserAgent`; the required value is retained
124
+ in each option's `access.headers` for non-browser clients.
125
+ VideoHUB implements progressive availability, so every resolved translation can be displayed before
126
+ slower lookups finish. Its bounded warm cache keeps playlists and signed video resolutions separate,
127
+ never serves signed links stale, and preserves their original expiry.
128
+ Rutube performs a bounded exact title/year movie search and returns only Rutube's documented public
129
+ embed player. It does not expose or proxy Rutube media URLs and intentionally skips series.
130
+
131
+ These providers return third-party links or streams. Media Engine does not host the video, and an
132
+ external player may be unavailable in some countries, networks, or browsers.
133
+
134
+ ## Discover torrent releases
135
+
136
+ Torrent providers are always opt-in:
137
+
138
+ ```ts
139
+ import {
140
+ bitsearchTorrentProvider,
141
+ jacRedTorrentProvider,
142
+ magnetzTorrentProvider,
143
+ ytsTorrentProvider,
144
+ } from "@media-engine/providers";
145
+
146
+ const media = new MediaEngine({
147
+ torrentProviders: [
148
+ ytsTorrentProvider(),
149
+ jacRedTorrentProvider(),
150
+ bitsearchTorrentProvider(),
151
+ magnetzTorrentProvider(),
152
+ ],
153
+ });
154
+
155
+ const result = await media.discoverTorrents({
156
+ type: "movie",
157
+ title: "Inception",
158
+ year: 2010,
159
+ ids: { imdb: "tt1375666" },
160
+ });
161
+ ```
162
+
163
+ Discovery only returns normalized candidates and their handoff data. It does not download torrent
164
+ metadata, contact trackers, join a swarm, or play a file.
165
+
166
+ Public sources can change, rate-limit requests, or go offline. Keep engine caching enabled and
167
+ expect occasional partial results. Provider-specific settings and safety boundaries are described in
168
+ the [provider guide](https://github.com/Yaneart/media-engine/blob/main/docs/providers.md).
169
+
170
+ ## License
171
+
172
+ MIT