guessit-js 3.8.1 → 4.0.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/dist/openapi.json DELETED
@@ -1,617 +0,0 @@
1
- {
2
- "openapi": "3.1.0",
3
- "info": {
4
- "title": "guessit-js API",
5
- "description": "Extract metadata from media filenames. A TypeScript port of the Python [guessit](https://github.com/guessit-io/guessit) library.\n\nParses movie and TV episode filenames to extract properties like title, year, season, episode, resolution, codec, language, release group, and 40+ other metadata fields.\n\n## Quick Start\n\n```bash\ncurl \"https://opensubtitles.github.io/guessit-js/api/guessit?filename=Breaking.Bad.S01E02.720p.BluRay.x264-DEMAND.mkv\"\n```\n\n## Features\n- **97.2% compatibility** with Python guessit test suite (996/1025 tests)\n- **3.47x faster** than Python (6.87ms vs 23.86ms per parse)\n- **Zero runtime dependencies**\n- **40+ detected properties**: title, year, season, episode, resolution, codec, language, and more",
6
- "version": "3.8.0",
7
- "contact": {
8
- "name": "guessit-js",
9
- "url": "https://opensubtitles.github.io/guessit-js"
10
- },
11
- "license": {
12
- "name": "LGPLv3",
13
- "url": "https://www.gnu.org/licenses/lgpl-3.0.en.html"
14
- }
15
- },
16
- "servers": [
17
- {
18
- "url": "https://opensubtitles.github.io/guessit-js",
19
- "description": "Production"
20
- },
21
- {
22
- "url": "http://localhost:3847",
23
- "description": "Local development"
24
- }
25
- ],
26
- "paths": {
27
- "/api/guessit": {
28
- "get": {
29
- "operationId": "guessitGet",
30
- "summary": "Parse a media filename",
31
- "description": "Extracts metadata from a media filename using pattern matching. Returns a JSON object with all detected properties.\n\nThe filename can include directory paths (e.g., `Movies/Title (2020)/file.mkv`) — the parser uses path segments as additional context for title disambiguation.",
32
- "tags": ["Parsing"],
33
- "parameters": [
34
- {
35
- "name": "filename",
36
- "in": "query",
37
- "required": true,
38
- "description": "The media filename (or full path) to parse. URL-encode special characters.",
39
- "schema": {
40
- "type": "string",
41
- "example": "The.Dark.Knight.2008.1080p.BluRay.x264-GROUP.mkv"
42
- },
43
- "examples": {
44
- "movie": {
45
- "summary": "Movie filename",
46
- "value": "The.Dark.Knight.2008.1080p.BluRay.x264-GROUP.mkv"
47
- },
48
- "tvshow": {
49
- "summary": "TV episode",
50
- "value": "Breaking.Bad.S01E02.720p.BluRay.x264-DEMAND.mkv"
51
- },
52
- "anime": {
53
- "summary": "Anime with group",
54
- "value": "[SubGroup] Naruto Shippuden - 301 [720p][AAC].mkv"
55
- },
56
- "fullpath": {
57
- "summary": "Full path with directory",
58
- "value": "Movies/The Matrix (1999)/The.Matrix.1999.REMASTERED.1080p.BluRay.x264-GROUP.mkv"
59
- },
60
- "uhd": {
61
- "summary": "UHD with HDR and Atmos",
62
- "value": "Dune Part Two 2024 1080p WEB-DL DD+ 5.1 Atmos H.265-FLUX.mkv"
63
- }
64
- }
65
- },
66
- {
67
- "name": "type",
68
- "in": "query",
69
- "required": false,
70
- "description": "Force the type detection. If omitted, the parser auto-detects based on the presence of season/episode indicators.",
71
- "schema": {
72
- "type": "string",
73
- "enum": ["movie", "episode"]
74
- }
75
- }
76
- ],
77
- "responses": {
78
- "200": {
79
- "description": "Successfully parsed filename",
80
- "content": {
81
- "application/json": {
82
- "schema": {
83
- "$ref": "#/components/schemas/GuessitResult"
84
- },
85
- "examples": {
86
- "movie": {
87
- "summary": "Movie result",
88
- "value": {
89
- "title": "The Dark Knight",
90
- "year": 2008,
91
- "screen_size": "1080p",
92
- "source": "Blu-ray",
93
- "video_codec": "H.264",
94
- "release_group": "GROUP",
95
- "container": "mkv",
96
- "mimetype": "video/x-matroska",
97
- "type": "movie"
98
- }
99
- },
100
- "episode": {
101
- "summary": "TV episode result",
102
- "value": {
103
- "title": "Breaking Bad",
104
- "season": 1,
105
- "episode": 2,
106
- "screen_size": "720p",
107
- "source": "Blu-ray",
108
- "video_codec": "H.264",
109
- "release_group": "DEMAND",
110
- "container": "mkv",
111
- "mimetype": "video/x-matroska",
112
- "type": "episode"
113
- }
114
- },
115
- "complex": {
116
- "summary": "Complex result with multiple codecs",
117
- "value": {
118
- "title": "Dune",
119
- "part": 2,
120
- "year": 2024,
121
- "screen_size": "1080p",
122
- "source": "Web",
123
- "audio_codec": ["Dolby Digital Plus", "Dolby Atmos"],
124
- "audio_channels": "5.1",
125
- "video_codec": "H.265",
126
- "release_group": "FLUX",
127
- "container": "mkv",
128
- "type": "movie"
129
- }
130
- }
131
- }
132
- }
133
- }
134
- },
135
- "400": {
136
- "description": "Missing or invalid parameters",
137
- "content": {
138
- "application/json": {
139
- "schema": {
140
- "$ref": "#/components/schemas/Error"
141
- },
142
- "example": {
143
- "error": "Missing required parameter: filename"
144
- }
145
- }
146
- }
147
- },
148
- "500": {
149
- "description": "Internal parsing error",
150
- "content": {
151
- "application/json": {
152
- "schema": {
153
- "$ref": "#/components/schemas/Error"
154
- }
155
- }
156
- }
157
- }
158
- }
159
- },
160
- "post": {
161
- "operationId": "guessitPost",
162
- "summary": "Parse a filename with options",
163
- "description": "Parse a media filename with full options support. Use this endpoint when you need to pass additional configuration like expected titles, allowed languages, or country restrictions.\n\nThe request body accepts the same options as the Python guessit library.",
164
- "tags": ["Parsing"],
165
- "requestBody": {
166
- "required": true,
167
- "content": {
168
- "application/json": {
169
- "schema": {
170
- "$ref": "#/components/schemas/GuessitRequest"
171
- },
172
- "examples": {
173
- "simple": {
174
- "summary": "Simple filename",
175
- "value": {
176
- "filename": "The.Matrix.1999.REMASTERED.2160p.UHD.BluRay.x265-GROUP.mkv"
177
- }
178
- },
179
- "withType": {
180
- "summary": "Force movie type",
181
- "value": {
182
- "filename": "10.Cloverfield.Lane.2016.1080p.BluRay.x264.mkv",
183
- "options": {
184
- "type": "movie"
185
- }
186
- }
187
- },
188
- "withExpectedTitle": {
189
- "summary": "Provide expected title hint",
190
- "value": {
191
- "filename": "my 720p show S01E02.mkv",
192
- "options": {
193
- "expected_title": ["my 720p show"]
194
- }
195
- }
196
- },
197
- "withLanguages": {
198
- "summary": "Restrict languages and countries",
199
- "value": {
200
- "filename": "The.Office.US.S02E01.HDTV.mkv",
201
- "options": {
202
- "allowed_languages": ["en", "fr"],
203
- "allowed_countries": ["us", "gb"]
204
- }
205
- }
206
- }
207
- }
208
- }
209
- }
210
- },
211
- "responses": {
212
- "200": {
213
- "description": "Successfully parsed filename",
214
- "content": {
215
- "application/json": {
216
- "schema": {
217
- "$ref": "#/components/schemas/GuessitResult"
218
- }
219
- }
220
- }
221
- },
222
- "400": {
223
- "description": "Missing or invalid request body",
224
- "content": {
225
- "application/json": {
226
- "schema": {
227
- "$ref": "#/components/schemas/Error"
228
- }
229
- }
230
- }
231
- },
232
- "500": {
233
- "description": "Internal parsing error",
234
- "content": {
235
- "application/json": {
236
- "schema": {
237
- "$ref": "#/components/schemas/Error"
238
- }
239
- }
240
- }
241
- }
242
- }
243
- }
244
- },
245
- "/api/health": {
246
- "get": {
247
- "operationId": "healthCheck",
248
- "summary": "Health check",
249
- "description": "Returns the service status and version. Use for monitoring and load balancer health checks.",
250
- "tags": ["System"],
251
- "responses": {
252
- "200": {
253
- "description": "Service is healthy",
254
- "content": {
255
- "application/json": {
256
- "schema": {
257
- "$ref": "#/components/schemas/HealthResponse"
258
- },
259
- "example": {
260
- "status": "ok",
261
- "version": "3.8.0"
262
- }
263
- }
264
- }
265
- }
266
- }
267
- }
268
- }
269
- },
270
- "components": {
271
- "schemas": {
272
- "GuessitRequest": {
273
- "type": "object",
274
- "required": ["filename"],
275
- "properties": {
276
- "filename": {
277
- "type": "string",
278
- "description": "The media filename or path to parse",
279
- "example": "The.Matrix.1999.1080p.BluRay.x264-GROUP.mkv"
280
- },
281
- "options": {
282
- "$ref": "#/components/schemas/GuessitOptions"
283
- }
284
- }
285
- },
286
- "GuessitOptions": {
287
- "type": "object",
288
- "description": "Parsing options to control guessit behavior",
289
- "properties": {
290
- "type": {
291
- "type": "string",
292
- "enum": ["movie", "episode"],
293
- "description": "Force the type detection instead of auto-detecting"
294
- },
295
- "expected_title": {
296
- "oneOf": [
297
- { "type": "string" },
298
- { "type": "array", "items": { "type": "string" } }
299
- ],
300
- "description": "Expected title(s) to help the parser identify the title in ambiguous cases. Supports `re:` prefix for regex patterns (e.g., `re:my \\d+p show`)."
301
- },
302
- "expected_group": {
303
- "oneOf": [
304
- { "type": "string" },
305
- { "type": "array", "items": { "type": "string" } }
306
- ],
307
- "description": "Expected release group name(s)"
308
- },
309
- "allowed_languages": {
310
- "type": "array",
311
- "items": { "type": "string" },
312
- "description": "Restrict language detection to these ISO 639 codes (e.g., `[\"en\", \"fr\", \"de\"]`). Languages not in this list will not be detected."
313
- },
314
- "allowed_countries": {
315
- "type": "array",
316
- "items": { "type": "string" },
317
- "description": "Restrict country detection to these ISO 3166-1 alpha-2 codes (e.g., `[\"us\", \"gb\"]`)"
318
- },
319
- "includes": {
320
- "type": "array",
321
- "items": { "type": "string" },
322
- "description": "Only detect these property names (whitelist). All other properties are disabled."
323
- },
324
- "excludes": {
325
- "type": "array",
326
- "items": { "type": "string" },
327
- "description": "Do not detect these property names (blacklist)"
328
- },
329
- "name_only": {
330
- "type": "boolean",
331
- "description": "Treat the entire input as a single filename (ignore path separators)"
332
- },
333
- "date_year_first": {
334
- "type": "boolean",
335
- "description": "Assume dates are in year-first format (e.g., 2008.03.09)"
336
- },
337
- "date_day_first": {
338
- "type": "boolean",
339
- "description": "Assume dates are in day-first format (e.g., 09.03.2008)"
340
- },
341
- "episode_prefer_number": {
342
- "type": "boolean",
343
- "description": "Prefer episode number detection over other patterns"
344
- }
345
- }
346
- },
347
- "GuessitResult": {
348
- "type": "object",
349
- "description": "Extracted metadata from the filename. Only detected properties are included — the set of keys varies per filename.",
350
- "properties": {
351
- "title": {
352
- "oneOf": [
353
- { "type": "string" },
354
- { "type": "array", "items": { "type": "string" } }
355
- ],
356
- "description": "Main title of the movie or TV show"
357
- },
358
- "alternative_title": {
359
- "oneOf": [
360
- { "type": "string" },
361
- { "type": "array", "items": { "type": "string" } }
362
- ],
363
- "description": "Alternative title (e.g., from dash-separated segments or parenthetical titles)"
364
- },
365
- "year": {
366
- "oneOf": [
367
- { "type": "integer" },
368
- { "type": "array", "items": { "type": "integer" } }
369
- ],
370
- "description": "Release year (e.g., 2008)"
371
- },
372
- "date": {
373
- "type": "string",
374
- "format": "date",
375
- "description": "Release date in ISO 8601 format (YYYY-MM-DD)"
376
- },
377
- "country": {
378
- "type": "string",
379
- "description": "Country code (ISO 3166-1 alpha-2, e.g., \"US\", \"GB\")"
380
- },
381
- "language": {
382
- "oneOf": [
383
- { "$ref": "#/components/schemas/Language" },
384
- { "type": "array", "items": { "$ref": "#/components/schemas/Language" } }
385
- ],
386
- "description": "Detected language(s) as ISO 639-3 alpha3 codes"
387
- },
388
- "subtitle_language": {
389
- "oneOf": [
390
- { "$ref": "#/components/schemas/Language" },
391
- { "type": "array", "items": { "$ref": "#/components/schemas/Language" } }
392
- ],
393
- "description": "Subtitle language(s) as ISO 639-3 alpha3 codes"
394
- },
395
- "season": {
396
- "oneOf": [
397
- { "type": "integer" },
398
- { "type": "array", "items": { "type": "integer" } }
399
- ],
400
- "description": "Season number(s)"
401
- },
402
- "episode": {
403
- "oneOf": [
404
- { "type": "integer" },
405
- { "type": "array", "items": { "type": "integer" } }
406
- ],
407
- "description": "Episode number(s)"
408
- },
409
- "episode_title": {
410
- "type": "string",
411
- "description": "Title of the specific episode"
412
- },
413
- "episode_details": {
414
- "type": "string",
415
- "description": "Episode details (e.g., \"Special\", \"Pilot\", \"Final\")"
416
- },
417
- "episode_count": {
418
- "type": "integer",
419
- "description": "Total episode count (from \"X of Y\" patterns)"
420
- },
421
- "season_count": {
422
- "type": "integer",
423
- "description": "Total season count (from \"Season X of Y\" patterns)"
424
- },
425
- "absolute_episode": {
426
- "oneOf": [
427
- { "type": "integer" },
428
- { "type": "array", "items": { "type": "integer" } }
429
- ],
430
- "description": "Absolute episode number(s) for anime-style numbering"
431
- },
432
- "disc": {
433
- "oneOf": [
434
- { "type": "integer" },
435
- { "type": "array", "items": { "type": "integer" } }
436
- ],
437
- "description": "Disc number(s)"
438
- },
439
- "part": {
440
- "type": "integer",
441
- "description": "Part number (e.g., Part 2)"
442
- },
443
- "film": {
444
- "type": "integer",
445
- "description": "Film number in a franchise"
446
- },
447
- "film_title": {
448
- "type": "string",
449
- "description": "Film franchise title"
450
- },
451
- "bonus": {
452
- "type": "integer",
453
- "description": "Bonus/extra feature number"
454
- },
455
- "bonus_title": {
456
- "type": "string",
457
- "description": "Bonus feature title"
458
- },
459
- "edition": {
460
- "type": "string",
461
- "description": "Edition (e.g., \"Director's Cut\", \"Extended\", \"IMAX\")"
462
- },
463
- "screen_size": {
464
- "type": "string",
465
- "description": "Screen resolution (e.g., \"1080p\", \"2160p\", \"720p\", \"4320p\")"
466
- },
467
- "aspect_ratio": {
468
- "type": "number",
469
- "description": "Aspect ratio computed from WxH resolution (e.g., 1.778 for 1920x1080)"
470
- },
471
- "frame_rate": {
472
- "type": "string",
473
- "description": "Frame rate (e.g., \"24fps\", \"25fps\", \"60fps\")"
474
- },
475
- "video_codec": {
476
- "type": "string",
477
- "description": "Video codec (e.g., \"H.264\", \"H.265\", \"Xvid\", \"VP9\")"
478
- },
479
- "video_profile": {
480
- "type": "string",
481
- "description": "Video codec profile (e.g., \"High\", \"Main 10\", \"Advanced\")"
482
- },
483
- "color_depth": {
484
- "type": "string",
485
- "description": "Color depth (e.g., \"8-bit\", \"10-bit\")"
486
- },
487
- "audio_codec": {
488
- "oneOf": [
489
- { "type": "string" },
490
- { "type": "array", "items": { "type": "string" } }
491
- ],
492
- "description": "Audio codec(s) (e.g., \"AAC\", \"DTS\", \"Dolby Digital\", \"Dolby Atmos\")"
493
- },
494
- "audio_profile": {
495
- "oneOf": [
496
- { "type": "string" },
497
- { "type": "array", "items": { "type": "string" } }
498
- ],
499
- "description": "Audio codec profile (e.g., \"Master Audio\", \"High Efficiency\", \"Extended Surround\")"
500
- },
501
- "audio_channels": {
502
- "type": "string",
503
- "description": "Audio channel configuration (e.g., \"5.1\", \"7.1\", \"2.0\")"
504
- },
505
- "audio_bit_rate": {
506
- "type": "string",
507
- "description": "Audio bit rate (e.g., \"448Kbps\")"
508
- },
509
- "video_bit_rate": {
510
- "type": "string",
511
- "description": "Video bit rate (e.g., \"20Mbps\")"
512
- },
513
- "source": {
514
- "type": "string",
515
- "description": "Media source (e.g., \"Blu-ray\", \"Web\", \"DVD\", \"HDTV\")"
516
- },
517
- "streaming_service": {
518
- "oneOf": [
519
- { "type": "string" },
520
- { "type": "array", "items": { "type": "string" } }
521
- ],
522
- "description": "Streaming service (e.g., \"Netflix\", \"Amazon Prime\", \"HBO Go\")"
523
- },
524
- "other": {
525
- "oneOf": [
526
- { "type": "string" },
527
- { "type": "array", "items": { "type": "string" } }
528
- ],
529
- "description": "Other properties (e.g., \"Proper\", \"Repack\", \"3D\", \"HDR\", \"Remux\", \"IMAX\")"
530
- },
531
- "release_group": {
532
- "type": "string",
533
- "description": "Scene/P2P release group name"
534
- },
535
- "container": {
536
- "type": "string",
537
- "description": "File container format (e.g., \"mkv\", \"avi\", \"mp4\")"
538
- },
539
- "mimetype": {
540
- "type": "string",
541
- "description": "MIME type derived from the container (e.g., \"video/x-matroska\")"
542
- },
543
- "size": {
544
- "type": "string",
545
- "description": "File size if present in the filename (e.g., \"4.3GB\")"
546
- },
547
- "crc32": {
548
- "type": "string",
549
- "description": "CRC32 checksum (8 hex characters, common in anime releases)"
550
- },
551
- "uuid": {
552
- "type": "string",
553
- "description": "UUID found in the filename or path"
554
- },
555
- "proper_count": {
556
- "type": "integer",
557
- "description": "Proper/repack count. Positive = proper/repack, negative = fix."
558
- },
559
- "type": {
560
- "type": "string",
561
- "enum": ["movie", "episode"],
562
- "description": "Detected content type"
563
- }
564
- }
565
- },
566
- "Language": {
567
- "type": "object",
568
- "description": "Language object with ISO 639-3 alpha3 code",
569
- "properties": {
570
- "alpha3": {
571
- "type": "string",
572
- "description": "ISO 639-3 three-letter language code (e.g., \"eng\", \"fra\", \"deu\")"
573
- }
574
- },
575
- "required": ["alpha3"]
576
- },
577
- "HealthResponse": {
578
- "type": "object",
579
- "properties": {
580
- "status": {
581
- "type": "string",
582
- "enum": ["ok"]
583
- },
584
- "version": {
585
- "type": "string",
586
- "description": "Library version"
587
- }
588
- },
589
- "required": ["status", "version"]
590
- },
591
- "Error": {
592
- "type": "object",
593
- "properties": {
594
- "error": {
595
- "type": "string",
596
- "description": "Error message"
597
- },
598
- "detail": {
599
- "type": "string",
600
- "description": "Additional error details (only for 500 errors)"
601
- }
602
- },
603
- "required": ["error"]
604
- }
605
- }
606
- },
607
- "tags": [
608
- {
609
- "name": "Parsing",
610
- "description": "Filename parsing endpoints"
611
- },
612
- {
613
- "name": "System",
614
- "description": "System and monitoring endpoints"
615
- }
616
- ]
617
- }