1GUESSIT(1) GuessIt GUESSIT(1)
2
3
4
6 guessit - GuessIt Documentation Latest VersionLGPLv3 LicenseBuild
7 StatusCoveralls
8
9 GuessIt is a python library that extracts as much information as possi‐
10 ble from a video filename.
11
12 It has a very powerful matcher that allows to guess properties from a
13 video using its filename only. This matcher works with both movies and
14 tv shows episodes.
15
16 For example, GuessIt can do the following:
17
18 $ guessit "Treme.1x03.Right.Place,.Wrong.Time.HDTV.XviD-NoTV.avi"
19 For: Treme.1x03.Right.Place,.Wrong.Time.HDTV.XviD-NoTV.avi
20 GuessIt found: {
21 "title": "Treme",
22 "season": 1,
23 "episode": 3,
24 "episode_title": "Right Place, Wrong Time",
25 "format": "HDTV",
26 "video_codec": "XviD",
27 "release_group": "NoTV",
28 "container": "avi",
29 "mimetype": "video/x-msvideo",
30 "type": "episode"
31 }
32
34 GuessIt 2 has been rewriten from scratch. GuessIt is now a release name
35 parser only, and support for additional features like hashes computa‐
36 tions has been dropped.
37
38 To migrate from guessit 0.x or 1.x, please read the migration page.
39
41 Installing GuessIt is simple with pip:
42
43 $ pip install guessit
44
45 You can also install from sources.
46
48 GuessIt can be used from command line:
49
50 $ guessit
51 usage: guessit [-h] [-t TYPE] [-n] [-Y] [-D] [-L ALLOWED_LANGUAGES]
52 [-C ALLOWED_COUNTRIES] [-E] [-T EXPECTED_TITLE] [-G EXPECTED_GROUP]
53 [-f INPUT_FILE] [-v] [-P SHOW_PROPERTY] [-a] [-1] [-l] [-j] [-y]
54 [-c CONFIG] [--no-embedded-config] [-p] [-V] [--version]
55 [filename [filename ...]]
56
57 positional arguments:
58 filename Filename or release name to guess
59
60 optional arguments:
61 -h, --help show this help message and exit
62
63 Naming:
64 -t TYPE, --type TYPE The suggested file type: movie, episode. If undefined,
65 type will be guessed.
66 -n, --name-only Parse files as name only, considering "/" and "\" like
67 other separators.
68 -Y, --date-year-first
69 If short date is found, consider the first digits as
70 the year.
71 -D, --date-day-first If short date is found, consider the second digits as
72 the day.
73 -L ALLOWED_LANGUAGES, --allowed-languages ALLOWED_LANGUAGES
74 Allowed language (can be used multiple times)
75 -C ALLOWED_COUNTRIES, --allowed-countries ALLOWED_COUNTRIES
76 Allowed country (can be used multiple times)
77 -E, --episode-prefer-number
78 Guess "serie.213.avi" as the episode 213. Without this
79 option, it will be guessed as season 2, episode 13
80 -T EXPECTED_TITLE, --expected-title EXPECTED_TITLE
81 Expected title to parse (can be used multiple times)
82 -G EXPECTED_GROUP, --expected-group EXPECTED_GROUP
83 Expected release group (can be used multiple times)
84
85 Input:
86 -f INPUT_FILE, --input-file INPUT_FILE
87 Read filenames from an input text file. File should
88 use UTF-8 charset.
89
90 Output:
91 -v, --verbose Display debug output
92 -P SHOW_PROPERTY, --show-property SHOW_PROPERTY
93 Display the value of a single property (title, series,
94 video_codec, year, ...)
95 -a, --advanced Display advanced information for filename guesses, as
96 json output
97 -s, --single-value Keep only first value found for each property
98 -l, --enforce-list Wrap each found value in a list even when property has
99 a single value
100 -j, --json Display information for filename guesses as json
101 output
102 -y, --yaml Display information for filename guesses as yaml
103 output
104
105 Configuration:
106 -c CONFIG, --config CONFIG
107 Filepath to the configuration file. Configuration
108 contains the same options as those command line
109 options, but option names have "-" characters replaced
110 with "_". If not defined, guessit tries to read a
111 configuration default configuration file at
112 ~/.guessit/options.(json|yml|yaml) and
113 ~/.config/guessit/options.(json|yml|yaml). Set to
114 "false" to disable default configuration file loading.
115 --no-embedded-config Disable default configuration.
116
117 Information:
118 -p, --properties Display properties that can be guessed.
119 -V, --values Display property values that can be guessed.
120 --version Display the guessit version.
121
122 It can also be used as a python module:
123
124 >>> from guessit import guessit
125 >>> guessit('Treme.1x03.Right.Place,.Wrong.Time.HDTV.XviD-NoTV.avi') # doctest: +ALLOW_UNICODE
126 MatchesDict([('title', 'Treme'), ('season', 1), ('episode', 3), ('episode_title', 'Right Place, Wrong Time'), ('format', 'HDTV'), ('video_codec', 'XviD'), ('release_group', 'NoTV'), ('container', 'avi'), ('mimetype', 'video/x-msvideo'), ('type', 'episode')])
127
128 MatchesDict is a dict that keeps matches ordering.
129
130 Command line options can be given as dict or string to the second argu‐
131 ment.
132
134 A REST API will be available soon ...
135
136 Sources are available in a dedicated guessit-rest repository.
137
139 This project is hosted on GitHub. Feel free to open an issue if you
140 think you have found a bug or something is missing in guessit.
141
142 GuessIt relies on Rebulk project for pattern and rules registration.
143
145 GuessIt is licensed under the LGPLv3 license.
146
148 Remi Alvergnat
149
151 2015, Remi Alvergnat
152
153
154
155
1562.1.4 Feb 02, 2019 GUESSIT(1)