mirror of
https://github.com/zoriya/guessit.git
synced 2026-06-09 12:51:24 +00:00
Add container property
This commit is contained in:
@@ -1,19 +1,41 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
'''
|
||||
Season/Episode numbering support
|
||||
"""
|
||||
'''
|
||||
from rebulk import Rebulk
|
||||
|
||||
import regex as re
|
||||
|
||||
EXTENSION = Rebulk().regex_defaults(flags=re.IGNORECASE)
|
||||
EXTENSION.defaults(name='extension', formatter=lambda value: value[1:], conflict_solver=lambda match, other: other)
|
||||
from ..common.validators import seps_surround
|
||||
|
||||
EXTENSION.regex(r'\.\L<exts>$', exts=['srt', 'idx', 'sub', 'ssa', 'ass'], tags=["subtitle"])
|
||||
EXTENSION.regex(r'\.\L<exts>$', exts=['nfo'], tags=["info"])
|
||||
EXTENSION.regex(r'\.\L<exts>$', exts=['3g2', '3gp', '3gp2', 'asf', 'avi', 'divx', 'flv', 'm4v', 'mk2',
|
||||
'mka', 'mkv', 'mov', 'mp4', 'mp4a', 'mpeg', 'mpg', 'ogg', 'ogm',
|
||||
'ogv', 'qt', 'ra', 'ram', 'rm', 'ts', 'wav', 'webm', 'wma', 'wmv',
|
||||
'iso', 'vob'], tags=["video"])
|
||||
EXTENSION.regex(r'\.\L<exts>$', exts=['torrent'])
|
||||
EXTENSION = Rebulk().regex_defaults(flags=re.IGNORECASE).string_defaults(ignore_case=True)
|
||||
EXTENSION.defaults(name='extension',
|
||||
formatter=lambda value: value[1:],
|
||||
conflict_solver=lambda match, other: other
|
||||
if other.name in ['container', 'format', 'videoCodec']
|
||||
else '__default__')
|
||||
|
||||
subtitles = ['srt', 'idx', 'sub', 'ssa', 'ass']
|
||||
info = ['nfo']
|
||||
videos = ['3g2', '3gp', '3gp2', 'asf', 'avi', 'divx', 'flv', 'm4v', 'mk2',
|
||||
'mka', 'mkv', 'mov', 'mp4', 'mp4a', 'mpeg', 'mpg', 'ogg', 'ogm',
|
||||
'ogv', 'qt', 'ra', 'ram', 'rm', 'ts', 'wav', 'webm', 'wma', 'wmv',
|
||||
'iso', 'vob']
|
||||
torrent = ['torrent']
|
||||
|
||||
EXTENSION.regex(r'\.\L<exts>$', exts=subtitles, tags=['subtitle'])
|
||||
EXTENSION.regex(r'\.\L<exts>$', exts=info, tags=['info'])
|
||||
EXTENSION.regex(r'\.\L<exts>$', exts=videos, tags=['video'])
|
||||
EXTENSION.regex(r'\.\L<exts>$', exts=torrent, tags=['torrent'])
|
||||
|
||||
|
||||
EXTENSION.defaults(name='container',
|
||||
validator=seps_surround,
|
||||
conflict_solver=lambda match, other: match
|
||||
if other.name in ['extension', 'format', 'videoCodec']
|
||||
else '__default__')
|
||||
|
||||
EXTENSION.string(*subtitles, tags=['subtitle'])
|
||||
EXTENSION.string(*videos, tags=['video'])
|
||||
EXTENSION.string(*torrent, tags=['torrent'])
|
||||
|
||||
@@ -1473,3 +1473,66 @@
|
||||
title: One Piece
|
||||
subtitleLanguage: fr
|
||||
version: 2
|
||||
|
||||
? '[Group Name] Show Name.13'
|
||||
: episodeNumber: 13
|
||||
releaseGroup: Group Name
|
||||
title: Show Name
|
||||
|
||||
? '[Group Name] Show Name - 13'
|
||||
: episodeNumber: 13
|
||||
releaseGroup: Group Name
|
||||
title: Show Name
|
||||
|
||||
? '[Group Name] Show Name 13'
|
||||
: episodeNumber: 13
|
||||
releaseGroup: Group Name
|
||||
title: Show Name
|
||||
|
||||
# [Group Name] Show Name.13-14
|
||||
# [Group Name] Show Name - 13-14
|
||||
# Show Name 13-14
|
||||
|
||||
? '[Stratos-Subs]_Infinite_Stratos_-_12_(1280x720_H.264_AAC)_[379759DB]'
|
||||
: audioCodec: AAC
|
||||
crc32: 379759DB
|
||||
episodeNumber: 12
|
||||
releaseGroup: Stratos-Subs
|
||||
screenSize: 720p
|
||||
title: Infinite Stratos
|
||||
videoCodec: h264
|
||||
|
||||
# [ShinBunBu-Subs] Bleach - 02-03 (CX 1280x720 x264 AAC)
|
||||
|
||||
? '[SGKK] Bleach 312v1 [720p/MKV]'
|
||||
: options: -E # guessit 1.x for episodeNumber only when version is guessed, but it's doesn't make it consistent.
|
||||
episodeNumber: 312
|
||||
releaseGroup: SGKK
|
||||
screenSize: 720p
|
||||
title: Bleach
|
||||
version: 1
|
||||
|
||||
? '[Ayako]_Infinite_Stratos_-_IS_-_07_[H264][720p][EB7838FC]'
|
||||
: crc32: EB7838FC
|
||||
episodeNumber: 7
|
||||
releaseGroup: Ayako
|
||||
screenSize: 720p
|
||||
title: Infinite Stratos
|
||||
videoCodec: h264
|
||||
|
||||
? '[Ayako] Infinite Stratos - IS - 07v2 [H264][720p][44419534]'
|
||||
: crc32: '44419534'
|
||||
episodeNumber: 7
|
||||
releaseGroup: Ayako
|
||||
screenSize: 720p
|
||||
title: Infinite Stratos
|
||||
videoCodec: h264
|
||||
version: 2
|
||||
|
||||
? '[Ayako-Shikkaku] Oniichan no Koto Nanka Zenzen Suki Janain Dakara ne - 10 [LQ][h264][720p] [8853B21C]'
|
||||
: crc32: 8853B21C
|
||||
episodeNumber: 10
|
||||
releaseGroup: Ayako-Shikkaku
|
||||
screenSize: 720p
|
||||
title: Oniichan no Koto Nanka Zenzen Suki Janain Dakara ne
|
||||
videoCodec: h264
|
||||
|
||||
Reference in New Issue
Block a user