Update vendored guessit to 3.1.1

Updates python-dateutil to 2.8.2
Updates rebulk to 2.0.1
This commit is contained in:
Labrys of Knossos 2022-11-28 19:44:46 -05:00
commit 2226a74ef8
66 changed files with 2995 additions and 1306 deletions

View file

@ -35,9 +35,9 @@
-cd: 1
-cd_count: 3
? This.Is.Us
? This.is.Us
: options: --exclude country
title: This Is Us
title: This is Us
-country: US
? 2015.01.31
@ -286,9 +286,9 @@
: options: --exclude website
-website: wawa.co.uk
? movie.mkv
? movie.mp4
: options: --exclude mimetype
-mimetype: video/x-matroska
-mimetype: video/mp4
? another movie.mkv
: options: --exclude container

View file

@ -201,9 +201,9 @@
? Series/My Name Is Earl/My.Name.Is.Earl.S01Extras.-.Bad.Karma.DVDRip.XviD.avi
: title: My Name Is Earl
season: 1
episode_title: Extras - Bad Karma
episode_title: Bad Karma
source: DVD
other: Rip
other: [Extras, Rip]
video_codec: Xvid
? series/Freaks And Geeks/Season 1/Episode 4 - Kim Kelly Is My Friend-eng(1).srt
@ -1917,9 +1917,11 @@
? Duck.Dynasty.S02E07.Streik.German.DOKU.DL.WS.DVDRiP.x264-CDP
: episode: 7
episode_title: Streik German
episode_title: Streik
source: DVD
language: mul
language:
- German
- Multi
other: [Documentary, Widescreen, Rip]
release_group: CDP
season: 2
@ -1930,9 +1932,11 @@
? Family.Guy.S13E14.JOLO.German.AC3D.DL.720p.WebHD.x264-CDD
: audio_codec: Dolby Digital
episode: 14
episode_title: JOLO German
episode_title: JOLO
source: Web
language: mul
language:
- German
- Multi
release_group: CDD
screen_size: 720p
season: 13
@ -3025,7 +3029,7 @@
title: Show Name
episode: [493, 494, 495, 496, 497, 498, 500, 501, 502, 503, 504, 505, 506, 507]
screen_size: 720p
subtitle_language: fr
other: Variable Frame Rate
video_codec: H.264
audio_codec: AAC
type: episode
@ -4524,4 +4528,166 @@
video_codec: H.264
audio_codec: MP2
release_group: KIDKAT
type: episode
? Por Trece Razones - Temporada 2 [HDTV 720p][Cap.201][AC3 5.1 Castellano]/Por Trece Razones 2x01 [des202].mkv
: title: Por Trece Razones
season: 2
source: HDTV
screen_size: 720p
episode: 1
audio_codec: Dolby Digital
audio_channels: '5.1'
language: Catalan
release_group: des202
container: mkv
type: episode
? Cuerpo de Elite - Temporada 1 [HDTV 720p][Cap.113][AC3 5.1 Esp Castellano]\CuerpoDeElite720p_113_desca202.mkv
: title: Cuerpo de Elite
season: 1
source: HDTV
screen_size: 720p
episode: 13
audio_codec: Dolby Digital
audio_channels: '5.1'
language:
- Spanish
- Catalan
container: mkv
type: episode
? Show.Name.S01E01.St.Patricks.Day.1080p.mkv
: title: Show Name
season: 1
episode: 1
episode_title: St Patricks Day
screen_size: 1080p
container: mkv
type: episode
? Show.Name.S01E01.St.Patricks.Day.1080p-grp.mkv
: title: Show Name
season: 1
episode: 1
episode_title: St Patricks Day
screen_size: 1080p
release_group: grp
container: mkv
type: episode
? Titans.2018.S01E09.Hank.And.Dawn.720p.DCU.WEB-DL.AAC2.0.H264-NTb
: title: Titans
year: 2018
season: 1
episode: 9
episode_title: Hank And Dawn
screen_size: 720p
streaming_service: DC Universe
source: Web
audio_codec: AAC
audio_channels: '2.0'
video_codec: H.264
release_group: NTb
type: episode
? S.W.A.T.2017.S01E21.Treibjagd.German.Dubbed.DL.AmazonHD.x264-TVS
: title: S.W.A.T.
year: 2017
season: 1
episode: 21
episode_title: Treibjagd
language:
- German
- Multi
streaming_service: Amazon Prime
other: HD
video_codec: H.264
release_group: TVS
type: episode
? S.W.A.T.2017.S01E16.READNFO.720p.HDTV.x264-KILLERS
: title: S.W.A.T.
year: 2017
season: 1
episode: 16
other: Read NFO
screen_size: 720p
source: HDTV
video_codec: H.264
release_group: KILLERS
type: episode
? /mnt/NAS/NoSubsTVShows/Babylon 5/Season 01/Ep. 02 - Soul Hunter
: title: Babylon 5
season: 1
episode: 2
episode_title: Soul Hunter
type: episode
? This.is.Us.S01E01.HDTV.x264-KILLERS.mkv
: title: This is Us
season: 1
episode: 1
source: HDTV
video_codec: H.264
release_group: KILLERS
container: mkv
type: episode
? Videos/Office1080/The Office (US) (2005) Season 2 S02 + Extras (1080p AMZN WEB-DL x265 HEVC 10bit AAC 2.0 LION)/The Office (US) (2005) - S02E12 - The Injury (1080p AMZN WEB-DL x265 LION).mkv
: title: The Office
country: US
year: 2005
season: 2
other: Extras
screen_size: 1080p
streaming_service: Amazon Prime
source: Web
video_codec: H.265
video_profile: High Efficiency Video Coding
color_depth: 10-bit
audio_codec: AAC
audio_channels: '2.0'
release_group: LION
episode: 12
episode_title: The Injury
container: mkv
type: episode
? Thumping.Spike.2.E01.DF.WEBRip.720p-DRAMATV.mp4
: title: Thumping Spike 2
episode: 1
source: Web
other: Rip
screen_size: 720p
streaming_service: DramaFever
release_group: DRAMATV
container: mp4
mimetype: video/mp4
type: episode
? About.Time.E01.1080p.VIKI.WEB-DL-BLUEBERRY.mp4
: title: About Time
episode: 1
screen_size: 1080p
streaming_service: Viki
source: Web
release_group: BLUEBERRY
container: mp4
mimetype: video/mp4
type: episode
? Eyes.Of.Dawn.1991.E01.480p.MBCVOD.AAC.x264-NOGPR.mp4
: title: Eyes Of Dawn
year: 1991
season: 1991
episode: 1
screen_size: 480p
streaming_service: MBC
audio_codec: AAC
video_codec: H.264
release_group: NOGPR
container: mp4
mimetype: video/mp4
type: episode

View file

@ -815,10 +815,12 @@
? Das.Appartement.German.AC3D.DL.720p.BluRay.x264-TVP
: audio_codec: Dolby Digital
source: Blu-ray
language: mul
language:
- German
- Multi
release_group: TVP
screen_size: 720p
title: Das Appartement German
title: Das Appartement
type: movie
video_codec: H.264
@ -1723,7 +1725,7 @@
? Ant-Man.and.the.Wasp.2018.Digital.Extras.1080p.AMZN.WEB-DL.DDP5.1.H.264-NTG.mkv
: title: Ant-Man and the Wasp
year: 2018
alternative_title: Digital Extras
other: Extras
screen_size: 1080p
streaming_service: Amazon Prime
source: Web
@ -1770,4 +1772,15 @@
audio_channels: '5.1'
video_codec: H.264
release_group: CMRG
type: movie
type: movie
? The.Girl.in.the.Spiders.Web.2019.1080p.WEB-DL.x264.AC3-EVO.mkv
: title: The Girl in the Spiders Web
year: 2019
screen_size: 1080p
source: Web
video_codec: H.264
audio_codec: Dolby Digital
release_group: EVO
container: mkv
type: movie

View file

@ -0,0 +1,467 @@
? is
: title: is
? it
: title: it
? am
: title: am
? mad
: title: mad
? men
: title: men
? man
: title: man
? run
: title: run
? sin
: title: sin
? st
: title: st
? to
: title: to
? 'no'
: title: 'no'
? non
: title: non
? war
: title: war
? min
: title: min
? new
: title: new
? car
: title: car
? day
: title: day
? bad
: title: bad
? bat
: title: bat
? fan
: title: fan
? fry
: title: fry
? cop
: title: cop
? zen
: title: zen
? gay
: title: gay
? fat
: title: fat
? one
: title: one
? cherokee
: title: cherokee
? got
: title: got
? an
: title: an
? as
: title: as
? cat
: title: cat
? her
: title: her
? be
: title: be
? hat
: title: hat
? sun
: title: sun
? may
: title: may
? my
: title: my
? mr
: title: mr
? rum
: title: rum
? pi
: title: pi
? bb
: title: bb
? bt
: title: bt
? tv
: title: tv
? aw
: title: aw
? by
: title: by
? md
: other: Mic Dubbed
? mp
: title: mp
? cd
: title: cd
? in
: title: in
? ad
: title: ad
? ice
: title: ice
? ay
: title: ay
? at
: title: at
? star
: title: star
? so
: title: so
? he
: title: he
? do
: title: do
? ax
: title: ax
? mx
: title: mx
? bas
: title: bas
? de
: title: de
? le
: title: le
? son
: title: son
? ne
: title: ne
? ca
: title: ca
? ce
: title: ce
? et
: title: et
? que
: title: que
? mal
: title: mal
? est
: title: est
? vol
: title: vol
? or
: title: or
? mon
: title: mon
? se
: title: se
? je
: title: je
? tu
: title: tu
? me
: title: me
? ma
: title: ma
? va
: title: va
? au
: country: AU
? lu
: title: lu
? wa
: title: wa
? ga
: title: ga
? ao
: title: ao
? la
: title: la
? el
: title: el
? del
: title: del
? por
: title: por
? mar
: title: mar
? al
: title: al
? un
: title: un
? ind
: title: ind
? arw
: title: arw
? ts
: source: Telesync
? ii
: title: ii
? bin
: title: bin
? chan
: title: chan
? ss
: title: ss
? san
: title: san
? oss
: title: oss
? iii
: title: iii
? vi
: title: vi
? ben
: title: ben
? da
: title: da
? lt
: title: lt
? ch
: title: ch
? sr
: title: sr
? ps
: title: ps
? cx
: title: cx
? vo
: title: vo
? mkv
: container: mkv
? avi
: container: avi
? dmd
: title: dmd
? the
: title: the
? dis
: title: dis
? cut
: title: cut
? stv
: title: stv
? des
: title: des
? dia
: title: dia
? and
: title: and
? cab
: title: cab
? sub
: title: sub
? mia
: title: mia
? rim
: title: rim
? las
: title: las
? une
: title: une
? par
: title: par
? srt
: container: srt
? ano
: title: ano
? toy
: title: toy
? job
: title: job
? gag
: title: gag
? reel
: title: reel
? www
: title: www
? for
: title: for
? ayu
: title: ayu
? csi
: title: csi
? ren
: title: ren
? moi
: title: moi
? sur
: title: sur
? fer
: title: fer
? fun
: title: fun
? two
: title: two
? big
: title: big
? psy
: title: psy
? air
: title: air
? brazil
: title: brazil
? jordan
: title: jordan
? bs
: title: bs
? kz
: title: kz
? gt
: title: gt
? im
: title: im
? pt
: language: pt
? scr
: title: scr
? sd
: title: sd
? hr
: other: High Resolution

View file

@ -5,8 +5,8 @@
: country: US
title: this is title
? This.is.us.title
: title: This is us title
? This.is.Us
: title: This is Us
? This.Is.Us
: options: --no-default-config

View file

@ -48,7 +48,7 @@
proper_count: 3
? Proper
? Proper.720p
? +Repack
? +Rerip
: other: Proper
@ -80,7 +80,7 @@
? Remux
: other: Remux
? 3D
? 3D.2019
: other: 3D
? HD

View file

@ -0,0 +1,21 @@
{
"titles": [
"13 Reasons Why",
"Star Wars: Episode VII - The Force Awakens",
"3%",
"The 100",
"3 Percent",
"This is Us",
"Open Season 2",
"Game of Thrones",
"The X-Files",
"11.22.63"
],
"suggested": [
"13 Reasons Why",
"Star Wars: Episode VII - The Force Awakens",
"The 100",
"Open Season 2",
"11.22.63"
]
}

View file

@ -1,13 +1,14 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=no-self-use, pointless-statement, missing-docstring, invalid-name, pointless-string-statement
import json
import os
import sys
import pytest
import six
from ..api import guessit, properties, GuessitException
from ..api import guessit, properties, suggested_expected, GuessitException
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
@ -27,12 +28,16 @@ def test_forced_binary():
assert ret and 'title' in ret and isinstance(ret['title'], six.binary_type)
@pytest.mark.skipif('sys.version_info < (3, 4)', reason="Path is not available")
@pytest.mark.skipif(sys.version_info < (3, 4), reason="Path is not available")
def test_pathlike_object():
from pathlib import Path
path = Path('Fear.and.Loathing.in.Las.Vegas.FRENCH.ENGLISH.720p.HDDVD.DTS.x264-ESiR.mkv')
ret = guessit(path)
assert ret and 'title' in ret
try:
from pathlib import Path
path = Path('Fear.and.Loathing.in.Las.Vegas.FRENCH.ENGLISH.720p.HDDVD.DTS.x264-ESiR.mkv')
ret = guessit(path)
assert ret and 'title' in ret
except ImportError: # pragma: no-cover
pass
def test_unicode_japanese():
@ -69,3 +74,10 @@ def test_exception():
assert "An internal error has occured in guessit" in str(excinfo.value)
assert "Guessit Exception Report" in str(excinfo.value)
assert "Please report at https://github.com/guessit-io/guessit/issues" in str(excinfo.value)
def test_suggested_expected():
with open(os.path.join(__location__, 'suggested.json'), 'r') as f:
content = json.load(f)
actual = suggested_expected(content['titles'])
assert actual == content['suggested']

View file

@ -7,9 +7,8 @@ import os
from io import open # pylint: disable=redefined-builtin
import babelfish
import pytest
import six
import yaml
import six # pylint:disable=wrong-import-order
import yaml # pylint:disable=wrong-import-order
from rebulk.remodule import re
from rebulk.utils import is_iterable
@ -21,13 +20,6 @@ logger = logging.getLogger(__name__)
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
filename_predicate = None
string_predicate = None
# filename_predicate = lambda filename: 'episode_title' in filename
# string_predicate = lambda string: '-DVD.BlablaBla.Fix.Blablabla.XVID' in string
class EntryResult(object):
def __init__(self, string, negates=False):
@ -134,7 +126,49 @@ class TestYml(object):
options_re = re.compile(r'^([ +-]+)(.*)')
files, ids = files_and_ids(filename_predicate)
def _get_unique_id(self, collection, base_id):
ret = base_id
i = 2
while ret in collection:
suffix = "-" + str(i)
ret = base_id + suffix
i += 1
return ret
def pytest_generate_tests(self, metafunc):
if 'yml_test_case' in metafunc.fixturenames:
entries = []
entry_ids = []
entry_set = set()
for filename, _ in zip(*files_and_ids()):
with open(os.path.join(__location__, filename), 'r', encoding='utf-8') as infile:
data = yaml.load(infile, OrderedDictYAMLLoader)
last_expected = None
for string, expected in reversed(list(data.items())):
if expected is None:
data[string] = last_expected
else:
last_expected = expected
default = None
try:
default = data['__default__']
del data['__default__']
except KeyError:
pass
for string, expected in data.items():
TestYml.set_default(expected, default)
string = TestYml.fix_encoding(string, expected)
entries.append((filename, string, expected))
unique_id = self._get_unique_id(entry_set, '[' + filename + '] ' + str(string))
entry_set.add(unique_id)
entry_ids.append(unique_id)
metafunc.parametrize('yml_test_case', entries, ids=entry_ids)
@staticmethod
def set_default(expected, default):
@ -143,34 +177,8 @@ class TestYml(object):
if k not in expected:
expected[k] = v
@pytest.mark.parametrize('filename', files, ids=ids)
def test(self, filename, caplog):
caplog.set_level(logging.INFO)
with open(os.path.join(__location__, filename), 'r', encoding='utf-8') as infile:
data = yaml.load(infile, OrderedDictYAMLLoader)
entries = Results()
last_expected = None
for string, expected in reversed(list(data.items())):
if expected is None:
data[string] = last_expected
else:
last_expected = expected
default = None
try:
default = data['__default__']
del data['__default__']
except KeyError:
pass
for string, expected in data.items():
TestYml.set_default(expected, default)
entry = self.check_data(filename, string, expected)
entries.append(entry)
entries.assert_ok()
def check_data(self, filename, string, expected):
@classmethod
def fix_encoding(cls, string, expected):
if six.PY2:
if isinstance(string, six.text_type):
string = string.encode('utf-8')
@ -183,16 +191,23 @@ class TestYml(object):
expected[k] = v
if not isinstance(string, str):
string = str(string)
if not string_predicate or string_predicate(string): # pylint: disable=not-callable
entry = self.check(string, expected)
if entry.ok:
logger.debug('[%s] %s', filename, entry)
elif entry.warning:
logger.warning('[%s] %s', filename, entry)
elif entry.error:
logger.error('[%s] %s', filename, entry)
for line in entry.details:
logger.error('[%s] %s', filename, ' ' * 4 + line)
return string
def test_entry(self, yml_test_case):
filename, string, expected = yml_test_case
result = self.check_data(filename, string, expected)
assert not result.error
def check_data(self, filename, string, expected):
entry = self.check(string, expected)
if entry.ok:
logger.debug('[%s] %s', filename, entry)
elif entry.warning:
logger.warning('[%s] %s', filename, entry)
elif entry.error:
logger.error('[%s] %s', filename, entry)
for line in entry.details:
logger.error('[%s] %s', filename, ' ' * 4 + line)
return entry
def check(self, string, expected):

View file

@ -946,3 +946,254 @@
source: Blu-ray
audio_codec: DTS-HD
type: movie
? Mr Robot - S03E01 - eps3 0 power-saver-mode h (1080p AMZN WEB-DL x265 HEVC 10bit EAC3 6.0 RCVR).mkv
: title: Mr Robot
season: 3
episode: 1
episode_title: eps3 0 power-saver-mode h
screen_size: 1080p
streaming_service: Amazon Prime
source: Web
video_codec: H.265
video_profile: High Efficiency Video Coding
color_depth: 10-bit
audio_codec: Dolby Digital Plus
audio_channels: '5.1'
release_group: RCVR
container: mkv
type: episode
? Panorama.15-05-2018.Web-DL.540p.H264.AAC.Subs.mp4
: title: Panorama
date: 2018-05-15
source: Web
screen_size: 540p
video_codec: H.264
audio_codec: AAC
subtitle_language: und
container: mp4
type: episode
? Shaolin 2011.720p.BluRay.x264-x0r.mkv
: title: Shaolin
year: 2011
screen_size: 720p
source: Blu-ray
video_codec: H.264
release_group: x0r
container: mkv
type: movie
? '[ Engineering Catastrophes S02E10 1080p AMZN WEB-DL DD+ 2.0 x264-TrollHD ]'
: title: Engineering Catastrophes
season: 2
episode: 10
screen_size: 1080p
streaming_service: Amazon Prime
source: Web
audio_codec: Dolby Digital Plus
audio_channels: '2.0'
video_codec: H.264
release_group: TrollHD
type: episode
? A Very Harold & Kumar 3D Christmas (2011).mkv
: title: A Very Harold & Kumar 3D Christmas
year: 2011
container: mkv
type: movie
? Cleveland.Hustles.S01E03.Downward.Dogs.and.Proper.Pigs.720p.HDTV.x264-W4F
: title: Cleveland Hustles
season: 1
episode: 3
episode_title: Downward Dogs and Proper Pigs
screen_size: 720p
source: HDTV
video_codec: H.264
release_group: W4F
type: episode
? Pawn.Stars.S12E20.The.Pawn.Awakens.REAL.READ.NFO.720p.HDTV.x264-DHD
: title: Pawn Stars
season: 12
episode: 20
episode_title: The Pawn Awakens
other:
- Proper
- Read NFO
proper_count: 2
screen_size: 720p
source: HDTV
video_codec: H.264
release_group: DHD
type: episode
? Pawn.Stars.S12E22.Racing.Revolution.REAL.720p.HDTV.x264-DHD
: title: Pawn Stars
season: 12
episode: 22
episode_title: Racing Revolution
other: Proper
proper_count: 2
screen_size: 720p
source: HDTV
video_codec: H.264
release_group: DHD
type: episode
? Luksusfellen.S18E02.REAL.NORWEGiAN.720p.WEB.h264-NORPiLT
: title: Luksusfellen
season: 18
episode: 2
other: Proper
proper_count: 2
language: Norwegian
screen_size: 720p
source: Web
video_codec: H.264
release_group: NORPiLT
type: episode
? The.Exorcist.S02E07.REAL.FRENCH.720p.HDTV.x264-SH0W
: title: The Exorcist
season: 2
episode: 7
other: Proper
proper_count: 2
language: fr
screen_size: 720p
source: HDTV
video_codec: H.264
release_group: SH0W
type: episode
? Outrageous.Acts.of.Science.S05E02.Is.This.for.Real.720p.HDTV.x264-DHD
: title: Outrageous Acts of Science
season: 5
episode: 2
# corner case
# episode_title: Is This for Real
screen_size: 720p
source: HDTV
video_codec: H.264
release_group: DHD
type: episode
? How.the.Universe.Works.S06E08.Strange.Lives.of.Dwarf.Planets.REAL.720p.WEB.x264-DHD
: title: How the Universe Works
season: 6
episode: 8
episode_title: Strange Lives of Dwarf Planets
other: Proper
proper_count: 2
screen_size: 720p
source: Web
video_codec: H.264
release_group: DHD
type: episode
? Vampirina.S01E16.REAL.HDTV.x264-W4F
: title: Vampirina
season: 1
episode: 16
other: Proper
proper_count: 2
source: HDTV
video_codec: H.264
release_group: W4F
type: episode
? Test.S01E16.Some Real Episode Title.HDTV.x264-W4F
: title: Test
season: 1
episode: 16
episode_title: Some Real Episode Title
source: HDTV
video_codec: H.264
release_group: W4F
type: episode
? NOS4A2.S01E01.The.Shorter.Way.REPACK.720p.AMZN.WEB-DL.DDP5.1.H.264-NTG.mkv
: title: NOS4A2
season: 1
episode: 1
episode_title: The Shorter Way
other: Proper
proper_count: 1
screen_size: 720p
streaming_service: Amazon Prime
source: Web
audio_codec: Dolby Digital Plus
audio_channels: '5.1'
video_codec: H.264
release_group: NTG
container: mkv
type: episode
? Star Trek DS9 Ep 2x03 The Siege (Part III)
: title: Star Trek DS9
season: 2
episode: 3
episode_title: The Siege
part: 3
type: episode
? The.Red.Line.S01E01
: title: The Red Line
season: 1
episode: 1
type: episode
? Show.S01E01.WEB.x264-METCON.mkv
: title: Show
season: 1
episode: 1
source: Web
video_codec: H.264
release_group: METCON
container: mkv
type: episode
? Show.S01E01.WEB.x264-TCMEON.mkv
: title: Show
season: 1
episode: 1
source: Web
video_codec: H.264
release_group: TCMEON
container: mkv
type: episode
? Show.S01E01.WEB.x264-MEONTC.mkv
: title: Show
season: 1
episode: 1
source: Web
video_codec: H.264
release_group: MEONTC
container: mkv
type: episode
? '[TorrentCouch.com].Westworld.S02.Complete.720p.WEB-DL.x264.[MP4].[5.3GB].[Season.2.Full]/[TorrentCouch.com].Westworld.S02E03.720p.WEB-DL.x264.mp4'
: website: TorrentCouch.com
title: Westworld
season: 2
other: Complete
screen_size: 720p
source: Web
video_codec: H.264
container: mp4
size: 5.3GB
episode: 3
type: episode
? Vita.&.Virginia.2018.720p.H.264.YTS.LT.mp4
: title: Vita & Virginia
year: 2018
screen_size: 720p
video_codec: H.264
release_group: YTS.LT
container: mp4
type: movie