guessit-io / guessit

GuessIt is a python library that extracts as much information as possible from a video filename.
https://guessit-io.github.io/guessit
GNU Lesser General Public License v3.0
824 stars 92 forks source link

xxx should be parsed as movie title #773

Open milahu opened 6 months ago

milahu commented 6 months ago

there is at least one movie called xXx

guessit 3.8.0 returns

>>> print(json.dumps(guessit.guessit("xXx.2002.mp4"), indent=2))
{
  "other": "XXX",
  "year": 2002,
  "container": "mp4",
  "mimetype": "video/mp4",
  "type": "movie"
}

expected: guessit should look for any.string.2000 or any.string.3000.2000 and parse everything before the year as title

workaround

filepath = "/a/b\\c\\d\\xXx.2002.mp4"
filename = re.split(r"[/\\]", filepath)[-1]
parsed = guessit.guessit(filename)
title = parsed.get("title") or filename.split(str(parsed.get("year")))[0][:-1]
assert title == 'xXx'

example filenames

xXx.2002.mp4
xXx.2002.720p.BDRip.aac-YTS.mp4
XXx.2002.15TH.ANNIVERSARY.EDITION.REPACK.720p.BluRay.x264.AAC-YTS.mp4
xXx.Triple.X.2002.REMASTERED.German.AC3.DL.1080p.BluRay.x264-HQXD.mkv

see also #246