titles Package

titles Package

movie Module

class flexget.utils.titles.movie.MovieParser

Bases: flexget.utils.titles.parser.TitleParser

is_movie
is_series
parse(data=None)

Parse movie name. Populates name, year, quality and proper_count attributes

proper
reset()
valid
flexget.utils.titles.movie.diff_pos(string1, string2)

Returns first position where string1 and string2 differ.

parser Module

class flexget.utils.titles.parser.TitleParser

Bases: object

codecs = [u'x264', u'x.264', u'h264', u'h.264', u'XViD']
cutoffs = [u'limited', u'xvid', u'h264', u'x264', u'h.264', u'x.264', u'screener', u'unrated', u'3d', u'extended', u'directors', u"director's", u'multisubs', u'dubbed', u'subbed', u'multi', u'proper', u'repack', u'rerip', u'real', u'final', u'special', u'bonus', u'extra', u'omake', u'ova', u'dc', u'extended', u'uncut', u'remastered', u'unrated', u'theatrical', u'chrono', u'se']
editions = [u'dc', u'extended', u'uncut', u'remastered', u'unrated', u'theatrical', u'chrono', u'se']
static ireplace(data, old, new, count=0, not_in_word=False)

Case insensitive string replace

propers = [u'proper', u'repack', u'rerip', u'real', u'final']
static re_not_in_word(regexp)
remove = [u'imax']
static remove_words(text, words, not_in_word=False)

Clean all given :words: from :text: case insensitively

sounds = [u'AC3', u'DD5.1', u'DTS']
specials = [u'special', u'bonus', u'extra', u'omake', u'ova']
static strip_spaces(text)

Removes all unnecessary duplicate spaces from a text

series Module

class flexget.utils.titles.series.SeriesParser(name=None, alternate_names=None, identified_by=u'auto', name_regexps=None, ep_regexps=None, date_regexps=None, sequence_regexps=None, id_regexps=None, strict_name=False, allow_groups=None, allow_seasonless=True, date_dayfirst=None, date_yearfirst=None, special_ids=None, prefer_specials=False, assume_special=False)

Bases: flexget.utils.titles.parser.TitleParser

Parse series.

Name:series name
Data:data to parse
Expect_ep:expect series to be in season, ep format (ep_regexps)
Expect_id:expect series to be in id format (id_regexps)
clean_regexps = [u'\\[.*?\\]', u'\\(.*?\\)']
date_regexps = [u'(?<![^\\W_])(\\d{2,4})[/ -](\\d{1,2})[/ -](\\d{1,2})(?![^\\W_])', u'(?<![^\\W_])(\\d{1,2})[/ -](\\d{1,2})[/ -](\\d{2,4})(?![^\\W_])', u'(?<![^\\W_])(\\d{4})x(\\d{1,2})[/ -](\\d{1,2})(?![^\\W_])', u'(?<![^\\W_])(\\d{1,2})(?:st|nd|rd|th)?[/ -]([a-z]{3,10})[/ -](\\d{4})(?![^\\W_])']
english_numbers = [u'one', u'two', u'three', u'four', u'five', u'six', u'seven', u'eight', u'nine', u'ten']
ep_regexps = [u'(?<![^\\W_])(?:series|season|s)\\s?(\\d{1,4})(?:\\s(?:.*\\s)?)?(?:episode|ep|e|part|pt)\\s?(\\d{1,3}|X{0,3}(?:IX|XI{0,4}|VI{0,4}|IV|V|I{1,4}))(?:\\s?e?(\\d{1,2}))?(?![^\\W_])', u'(?<![^\\W_])(?:series|season)\\s?(\\d{1,4})\\s(\\d{1,3})\\s?of\\s?(?:\\d{1,3})(?![^\\W_])', u'(?<![^\\W_])(\\d{1,2})\\s?x\\s?(\\d+)(?:\\s(\\d{1,2}))?(?![^\\W_])', u'(?<![^\\W_])(\\d{1,3})\\s?of\\s?(?:\\d{1,3})(?![^\\W_])', u'(?<![^\\W_])(?:episode|ep|part|pt)\\s?(\\d{1,3}|X{0,3}(?:IX|XI{0,4}|VI{0,4}|IV|V|I{1,4}))(?![^\\W_])', u'(?<![^\\W_])part\\s(one|two|three|four|five|six|seven|eight|nine|ten)(?![^\\W_])']
guess_name()

This will attempt to guess a series name based on the provided data.

id_regexps = []
identifier

Return String identifier for parsed episode, eg. S01E02 (will be the first identifier if this is a pack)

identifiers

Return all identifiers this parser represents. (for packs)

ignore_prefixes = [u'(?:\\[[^\\[\\]]*\\])', u'(?:HD.720p?:)', u'(?:HD.1080p?:)']
is_movie
is_series
pack_identifier

Return a combined identifier for the whole pack if this has more than one episode.

parse(data=None, field=None, quality=None)
parse_date(data)

Parses :data: for a date identifier. If found, returns the date and regexp match object If no date is found returns False

parse_episode(data)

Parses :data: for an episode identifier. If found, returns a dict with keys for season, episode, end_episode and the regexp match object If no episode id is found returns False

parse_unwanted(data)

Parses data for an unwanted hits. Return True if the data contains unwanted hits.

parse_unwanted_sequence(data)

Parses data for an unwanted id hits. Return True if the data contains unwanted hits.

proper
regexp = u'(?:pt|part)\\s?(\\d+|X{0,3}(?:IX|XI{0,4}|VI{0,4}|IV|V|I{1,4}))'
remove_dirt(data)

Replaces some characters with spaces

roman_numeral_re = u'X{0,3}(?:IX|XI{0,4}|VI{0,4}|IV|V|I{1,4})'
roman_to_int(roman)

Converts roman numerals up to 39 to integers

separators = u'[/ -]'
sequence_regexps = [u'(?<![^\\W_])(\\d{1,3})(?:v(?P<version>\\d))?(?![^\\W_])', u'(?<![^\\W_])(?:pt|part)\\s?(\\d+|X{0,3}(?:IX|XI{0,4}|VI{0,4}|IV|V|I{1,4}))(?![^\\W_])']
unwanted_regexps = [u'(\\d{1,3})\\s?x\\s?(0+)[^1-9]', u'S(\\d{1,3})D(\\d{1,3})', u'(\\d{1,3})\\s?x\\s?(all)', u'(?:season(?:s)|s|series|\\b)\\s?\\d\\s?(?:&\\s?\\d)?[\\s-]*(?:complete|full)', u'seasons\\s(\\d\\s){2,}', u'disc\\s\\d']
unwanted_sequence_regexps = [u'seasons?\\s?\\d{1,2}']