Migration¶
Guessit 2 has been rewritten from scratch. You can find in this file all information required to perform a migration from previous version 0.x or 1.x.
API¶
guess_video_info, guess_movie_info and guess_episode_info have been removed in favor of a unique function guessit.
Example:
>>> from guessit import guessit
>>> guessit('Treme.1x03.Right.Place,.Wrong.Time.HDTV.XviD-NoTV.avi')
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')])
MatchesDict is a dict that keeps matches ordering.
Command line options can be given as dict or string to the second argument.
Properties¶
Some properties have been renamed.
seriesis nowtitle.titleis nowepisode_title(forepisodetypeonly).episodeNumberis nowepisode.bonusNumberis nowbonusfilmNumberis nowfilmcdNumberis nowcdandcdNumberTotalis nowcd_countidNumberis nowuuid
episodeList and partList have been removed. episode_number and part properties that can now contains an int or a list[int].
All info type, like seriesinfo and movieinfo. You can check directly nfo value in container property.
All camelCase properties have been renamed to underscore_case.
releaseGroupis nowrelease_groupepisodeCountis nowepisode_countepisodeDetailsis nowepisode_detailsepisodeFormatis nowepisode_formatscreenSizeis nowscreen_sizevideoCodecis nowvideo_codecvideoProfileis nowvideo_profilevideoApiis nowvideo_apiaudioChannelsis nowaudio_channelsaudioCodecis nowaudio_codecaudioProfileis nowaudio_profilesubtitleLanguageis nowsubtitle_languagebonusTitleis nowbonus_titleproperCountis nowproper_count
Options¶
Some options have been removed.
-
-X DISABLED_TRANSFORMERS,-s, --transformersThere's no transformer anymore.
-
-S EXPECTED_SERIESAs
serieswas renamed totitle, use-T EXPECTED_TITLEinstead. -
-G EXPECTED_GROUPGuessIt is now better to guess release group, so this option has been removed.
-
-d, --demoProbably not that useful.
-
-i INFO, --info INFOFeatures related to this option have been removed.
-
-c, --split-camel,-u, --unidentified,-b, --bugWill be back soon... (work in progress)
Other GuessIt 1.x options have been kept.
Output¶
Output produced by guessit api function is now an instance of OrderedDict. Property values are automatically ordered based on filename, and you can still use this output as a default python dict.
If multiple values are available for a property, value in the dict will be a list instance.
country 2-letter code is not added to the title anymore. As country is added to the returned guess dict, it's up to the user to edit the guessed title.
Advanced display option (-a, --advanced) output is also changed. It now list Match objects from Rebulk, and may display duplicates that would have been merged in standard output.:
$ guessit "Treme.1x03.Right.Place,.Wrong.Time.HDTV.XviD-NoTV.avi" -a
For: Treme.1x03.Right.Place,.Wrong.Time.HDTV.XviD-NoTV.avi
GuessIt found: {
"title": {
"value": "Treme",
"raw": "Treme.",
"start": 0,
"end": 6
},
"season": {
"value": 1,
"raw": "1",
"start": 6,
"end": 7
},
"episode": {
"value": 3,
"raw": "03",
"start": 8,
"end": 10
},
"episode_title": {
"value": "Right Place, Wrong Time",
"raw": ".Right.Place,.Wrong.Time.",
"start": 10,
"end": 35
},
"format": {
"value": "HDTV",
"raw": "HDTV",
"start": 35,
"end": 39
},
"video_codec": {
"value": "XviD",
"raw": "XviD",
"start": 40,
"end": 44
},
"release_group": {
"value": "NoTV",
"raw": "-NoTV",
"start": 44,
"end": 49
},
"container": {
"value": "avi",
"raw": ".avi",
"start": 49,
"end": 53
},
"mimetype": {
"value": "video/x-msvideo",
"start": 53,
"end": 53
},
"type": {
"value": "episode",
"start": 53,
"end": 53
}
}