Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
container.register_property('screenSize', '360p', '(?:\d{3,}(?:\\|\/|x|\*))?360(?:i|p?x?)')
container.register_property('screenSize', '368p', '(?:\d{3,}(?:\\|\/|x|\*))?368(?:i|p?x?)')
container.register_property('screenSize', '480p', '(?:\d{3,}(?:\\|\/|x|\*))?480(?:i|p?x?)')
container.register_property('screenSize', '480p', 'hr', confidence=0.2)
container.register_property('screenSize', '576p', '(?:\d{3,}(?:\\|\/|x|\*))?576(?:i|p?x?)')
container.register_property('screenSize', '720p', '(?:\d{3,}(?:\\|\/|x|\*))?720(?:i|p?x?)')
container.register_property('screenSize', '900p', '(?:\d{3,}(?:\\|\/|x|\*))?900(?:i|p?x?)')
container.register_property('screenSize', '1080i', '(?:\d{3,}(?:\\|\/|x|\*))?1080i(?:i|p?x?)')
container.register_property('screenSize', '1080p', '(?:\d{3,}(?:\\|\/|x|\*))?1080(?:i|p?x?)')
container.register_property('screenSize', '4K', '(?:\d{3,}(?:\\|\/|x|\*))?2160(?:i|p?x?)')
register_quality('screenSize', '360p', -300)
register_quality('screenSize', '368p', -200)
register_quality('screenSize', '480p', -100)
register_quality('screenSize', '576p', 0)
register_quality('screenSize', '720p', 100)
register_quality('screenSize', '900p', 130)
register_quality('screenSize', '1080i', 180)
register_quality('screenSize', '1080p', 200)
register_quality('screenSize', '4K', 400)
# http://blog.mediacoderhq.com/h264-profiles-and-levels/
_videoProfiles = {'BS':('BS',),
'EP':('EP', 'XP'),
'MP':('MP',),
'HP':('HP', 'HiP'),
'10bit':('10.?bit', 'Hi10P'),
'Hi422P':('Hi422P',),
'Hi444PP':('Hi444PP'),
}
register_quality('audioCodec', 'AC3', 40)
register_quality('audioCodec', 'Flac', 45)
register_quality('audioCodec', 'DTS', 100)
register_quality('audioCodec', 'TrueHD', 120)
register_quality('audioProfile', 'HD', 20)
register_quality('audioProfile', 'HDMA', 50)
register_quality('audioProfile', 'LC', 0)
register_quality('audioProfile', 'HE', 20)
container.register_property('audioChannels', '7.1', '7[\W_]1', '7ch')
container.register_property('audioChannels', '5.1', '5[\W_]1', '5ch')
container.register_property('audioChannels', '2.0', '2[\W_]0', '2ch', 'stereo')
container.register_property('audioChannels', '1.0', '1[\W_]0', '1ch', 'mono')
register_quality('audioChannels', '1.0', -100)
register_quality('audioChannels', '2.0', 0)
register_quality('audioChannels', '5.1', 100)
register_quality('audioChannels', '7.1', 200)
container.register_property('episodeFormat', 'Minisode', r'Minisodes?')
container.register_property('other', 'AudioFix', 'Audio-Fix', 'Audio-Fixed')
container.register_property('other', 'SyncFix', 'Sync-Fix', 'Sync-Fixed')
container.register_property('other', 'DualAudio', 'Dual-Audio')
container.register_properties('other', 'Proper', 'Repack', 'R5', 'Screener', '3D', 'Fix', 'HD', 'HQ', 'DDC')
container.register_property('other', 'WideScreen', 'ws', 'wide-screen')
container.register_properties('other', 'Limited', 'Complete', 'Classic', 'Final', 'Unrated', weak=True)
for prop in container.get_properties('format'):
container.register_property('other', 'Screener', prop.pattern + '(-?Scr(?:eener)?)')
container.register_property('format', 'DVD', 'DVD', 'DVD-Rip', 'VIDEO-TS')
container.register_property('format', 'DVB', 'DVB-Rip', 'DVB', 'PD-TV')
container.register_property('format', 'HDTV', 'HD-TV')
container.register_property('format', 'VOD', 'VOD', 'VOD-Rip')
container.register_property('format', 'WEBRip', 'WEB-Rip')
container.register_property('format', 'WEB-DL', 'WEB-DL')
container.register_property('format', 'HD-DVD', 'HD-(?:DVD)?-Rip', 'HD-DVD')
container.register_property('format', 'BluRay', 'Blu-ray', 'B[DR]', 'B[DR]-Rip', 'BD[59]', 'BD25', 'BD50')
register_quality('format', 'VHS', -100)
register_quality('format', 'Cam', -90)
register_quality('format', 'Telesync', -80)
register_quality('format', 'Workprint', -70)
register_quality('format', 'Telecine', -60)
register_quality('format', 'Pay-Per-View', -50)
register_quality('format', 'DVB', -20)
register_quality('format', 'DVD', 0)
register_quality('format', 'HDTV', 20)
register_quality('format', 'VOD', 40)
register_quality('format', 'WEBRip', 50)
register_quality('format', 'WEB-DL', 60)
register_quality('format', 'HD-DVD', 80)
register_quality('format', 'BluRay', 100)
container.register_property('screenSize', '360p', '(?:\d{3,}(?:\\|\/|x|\*))?360(?:i|p?x?)')
container.register_property('screenSize', '368p', '(?:\d{3,}(?:\\|\/|x|\*))?368(?:i|p?x?)')
container.register_property('screenSize', '480p', '(?:\d{3,}(?:\\|\/|x|\*))?480(?:i|p?x?)')
container.register_property('screenSize', '480p', 'hr', confidence=0.2)
container.register_property('screenSize', '576p', '(?:\d{3,}(?:\\|\/|x|\*))?576(?:i|p?x?)')
container.register_property('screenSize', '720p', '(?:\d{3,}(?:\\|\/|x|\*))?720(?:i|p?x?)')
container.register_property('screenSize', '900p', '(?:\d{3,}(?:\\|\/|x|\*))?900(?:i|p?x?)')
container.register_property('screenSize', '1080i', '(?:\d{3,}(?:\\|\/|x|\*))?1080i(?:i|p?x?)')
}
}
for audioCodec, codecProfiles in _audioProfiles.items():
for profile, profile_regexps in codecProfiles.items():
for profile_regexp in profile_regexps:
for prop in container.get_properties('audioCodec', audioCodec):
container.register_property('audioProfile', profile, prop.pattern + '(-' + profile_regexp + ')')
container.register_property('audioProfile', profile, '(' + profile_regexp + '-)' + prop.pattern)
register_quality('audioCodec', 'MP3', 10)
register_quality('audioCodec', 'DolbyDigital', 30)
register_quality('audioCodec', 'AAC', 35)
register_quality('audioCodec', 'AC3', 40)
register_quality('audioCodec', 'Flac', 45)
register_quality('audioCodec', 'DTS', 100)
register_quality('audioCodec', 'TrueHD', 120)
register_quality('audioProfile', 'HD', 20)
register_quality('audioProfile', 'HDMA', 50)
register_quality('audioProfile', 'LC', 0)
register_quality('audioProfile', 'HE', 20)
container.register_property('audioChannels', '7.1', '7[\W_]1', '7ch')
container.register_property('audioChannels', '5.1', '5[\W_]1', '5ch')
container.register_property('audioChannels', '2.0', '2[\W_]0', '2ch', 'stereo')
container.register_property('audioChannels', '1.0', '1[\W_]0', '1ch', 'mono')
register_quality('audioChannels', '1.0', -100)
register_quality('audioChannels', '2.0', 0)
register_quality('audioChannels', '5.1', 100)
register_quality('audioChannels', '7.1', 200)
}
for audioCodec, codecProfiles in _audioProfiles.items():
for profile, profile_regexps in codecProfiles.items():
for profile_regexp in profile_regexps:
for prop in container.get_properties('audioCodec', audioCodec):
container.register_property('audioProfile', profile, prop.pattern + '(-' + profile_regexp + ')')
container.register_property('audioProfile', profile, '(' + profile_regexp + '-)' + prop.pattern)
register_quality('audioCodec', 'MP3', 10)
register_quality('audioCodec', 'DolbyDigital', 30)
register_quality('audioCodec', 'AAC', 35)
register_quality('audioCodec', 'AC3', 40)
register_quality('audioCodec', 'Flac', 45)
register_quality('audioCodec', 'DTS', 100)
register_quality('audioCodec', 'TrueHD', 120)
register_quality('audioProfile', 'HD', 20)
register_quality('audioProfile', 'HDMA', 50)
register_quality('audioProfile', 'LC', 0)
register_quality('audioProfile', 'HE', 20)
container.register_property('audioChannels', '7.1', '7[\W_]1', '7ch')
container.register_property('audioChannels', '5.1', '5[\W_]1', '5ch')
container.register_property('audioChannels', '2.0', '2[\W_]0', '2ch', 'stereo')
container.register_property('audioChannels', '1.0', '1[\W_]0', '1ch', 'mono')
register_quality('audioChannels', '1.0', -100)
register_quality('audioChannels', '2.0', 0)
register_quality('audioChannels', '5.1', 100)
register_quality('audioChannels', '7.1', 200)
register_quality('audioCodec', 'DTS', 100)
register_quality('audioCodec', 'TrueHD', 120)
register_quality('audioProfile', 'HD', 20)
register_quality('audioProfile', 'HDMA', 50)
register_quality('audioProfile', 'LC', 0)
register_quality('audioProfile', 'HE', 20)
container.register_property('audioChannels', '7.1', '7[\W_]1', '7ch')
container.register_property('audioChannels', '5.1', '5[\W_]1', '5ch')
container.register_property('audioChannels', '2.0', '2[\W_]0', '2ch', 'stereo')
container.register_property('audioChannels', '1.0', '1[\W_]0', '1ch', 'mono')
register_quality('audioChannels', '1.0', -100)
register_quality('audioChannels', '2.0', 0)
register_quality('audioChannels', '5.1', 100)
register_quality('audioChannels', '7.1', 200)
container.register_property('episodeFormat', 'Minisode', r'Minisodes?')
container.register_property('other', 'AudioFix', 'Audio-Fix', 'Audio-Fixed')
container.register_property('other', 'SyncFix', 'Sync-Fix', 'Sync-Fixed')
container.register_property('other', 'DualAudio', 'Dual-Audio')
container.register_properties('other', 'Proper', 'Repack', 'R5', 'Screener', '3D', 'Fix', 'HD', 'HQ', 'DDC')
container.register_property('other', 'WideScreen', 'ws', 'wide-screen')
container.register_properties('other', 'Limited', 'Complete', 'Classic', 'Final', 'Unrated', weak=True)
for prop in container.get_properties('format'):
container.register_property('other', 'Screener', prop.pattern + '(-?Scr(?:eener)?)')
container.register_property('format', 'PPV', 'PPV', 'PPV-Rip') # Pay Per View
container.register_property('format', 'DVD', 'DVD', 'DVD-Rip', 'VIDEO-TS')
container.register_property('format', 'DVB', 'DVB-Rip', 'DVB', 'PD-TV')
container.register_property('format', 'HDTV', 'HD-TV')
container.register_property('format', 'VOD', 'VOD', 'VOD-Rip')
container.register_property('format', 'WEBRip', 'WEB-Rip')
container.register_property('format', 'WEB-DL', 'WEB-DL')
container.register_property('format', 'HD-DVD', 'HD-(?:DVD)?-Rip', 'HD-DVD')
container.register_property('format', 'BluRay', 'Blu-ray', 'B[DR]', 'B[DR]-Rip', 'BD[59]', 'BD25', 'BD50')
register_quality('format', 'VHS', -100)
register_quality('format', 'Cam', -90)
register_quality('format', 'Telesync', -80)
register_quality('format', 'Workprint', -70)
register_quality('format', 'Telecine', -60)
register_quality('format', 'Pay-Per-View', -50)
register_quality('format', 'DVB', -20)
register_quality('format', 'DVD', 0)
register_quality('format', 'HDTV', 20)
register_quality('format', 'VOD', 40)
register_quality('format', 'WEBRip', 50)
register_quality('format', 'WEB-DL', 60)
register_quality('format', 'HD-DVD', 80)
register_quality('format', 'BluRay', 100)
container.register_property('screenSize', '360p', '(?:\d{3,}(?:\\|\/|x|\*))?360(?:i|p?x?)')
container.register_property('screenSize', '368p', '(?:\d{3,}(?:\\|\/|x|\*))?368(?:i|p?x?)')
container.register_property('screenSize', '480p', '(?:\d{3,}(?:\\|\/|x|\*))?480(?:i|p?x?)')
container.register_property('screenSize', '480p', 'hr', confidence=0.2)
container.register_property('screenSize', '576p', '(?:\d{3,}(?:\\|\/|x|\*))?576(?:i|p?x?)')
container.register_property('screenSize', '720p', '(?:\d{3,}(?:\\|\/|x|\*))?720(?:i|p?x?)')
container.register_property('screenSize', '900p', '(?:\d{3,}(?:\\|\/|x|\*))?900(?:i|p?x?)')
container.register_property('format', 'WEBRip', 'WEB-Rip')
container.register_property('format', 'WEB-DL', 'WEB-DL')
container.register_property('format', 'HD-DVD', 'HD-(?:DVD)?-Rip', 'HD-DVD')
container.register_property('format', 'BluRay', 'Blu-ray', 'B[DR]', 'B[DR]-Rip', 'BD[59]', 'BD25', 'BD50')
register_quality('format', 'VHS', -100)
register_quality('format', 'Cam', -90)
register_quality('format', 'Telesync', -80)
register_quality('format', 'Workprint', -70)
register_quality('format', 'Telecine', -60)
register_quality('format', 'Pay-Per-View', -50)
register_quality('format', 'DVB', -20)
register_quality('format', 'DVD', 0)
register_quality('format', 'HDTV', 20)
register_quality('format', 'VOD', 40)
register_quality('format', 'WEBRip', 50)
register_quality('format', 'WEB-DL', 60)
register_quality('format', 'HD-DVD', 80)
register_quality('format', 'BluRay', 100)
container.register_property('screenSize', '360p', '(?:\d{3,}(?:\\|\/|x|\*))?360(?:i|p?x?)')
container.register_property('screenSize', '368p', '(?:\d{3,}(?:\\|\/|x|\*))?368(?:i|p?x?)')
container.register_property('screenSize', '480p', '(?:\d{3,}(?:\\|\/|x|\*))?480(?:i|p?x?)')
container.register_property('screenSize', '480p', 'hr', confidence=0.2)
container.register_property('screenSize', '576p', '(?:\d{3,}(?:\\|\/|x|\*))?576(?:i|p?x?)')
container.register_property('screenSize', '720p', '(?:\d{3,}(?:\\|\/|x|\*))?720(?:i|p?x?)')
container.register_property('screenSize', '900p', '(?:\d{3,}(?:\\|\/|x|\*))?900(?:i|p?x?)')
container.register_property('screenSize', '1080i', '(?:\d{3,}(?:\\|\/|x|\*))?1080i(?:i|p?x?)')
container.register_property('screenSize', '1080p', '(?:\d{3,}(?:\\|\/|x|\*))?1080(?:i|p?x?)')
container.register_property('screenSize', '4K', '(?:\d{3,}(?:\\|\/|x|\*))?2160(?:i|p?x?)')
register_quality('screenSize', '360p', -300)
container.register_property('format', 'BluRay', 'Blu-ray', 'B[DR]', 'B[DR]-Rip', 'BD[59]', 'BD25', 'BD50')
register_quality('format', 'VHS', -100)
register_quality('format', 'Cam', -90)
register_quality('format', 'Telesync', -80)
register_quality('format', 'Workprint', -70)
register_quality('format', 'Telecine', -60)
register_quality('format', 'Pay-Per-View', -50)
register_quality('format', 'DVB', -20)
register_quality('format', 'DVD', 0)
register_quality('format', 'HDTV', 20)
register_quality('format', 'VOD', 40)
register_quality('format', 'WEBRip', 50)
register_quality('format', 'WEB-DL', 60)
register_quality('format', 'HD-DVD', 80)
register_quality('format', 'BluRay', 100)
container.register_property('screenSize', '360p', '(?:\d{3,}(?:\\|\/|x|\*))?360(?:i|p?x?)')
container.register_property('screenSize', '368p', '(?:\d{3,}(?:\\|\/|x|\*))?368(?:i|p?x?)')
container.register_property('screenSize', '480p', '(?:\d{3,}(?:\\|\/|x|\*))?480(?:i|p?x?)')
container.register_property('screenSize', '480p', 'hr', confidence=0.2)
container.register_property('screenSize', '576p', '(?:\d{3,}(?:\\|\/|x|\*))?576(?:i|p?x?)')
container.register_property('screenSize', '720p', '(?:\d{3,}(?:\\|\/|x|\*))?720(?:i|p?x?)')
container.register_property('screenSize', '900p', '(?:\d{3,}(?:\\|\/|x|\*))?900(?:i|p?x?)')
container.register_property('screenSize', '1080i', '(?:\d{3,}(?:\\|\/|x|\*))?1080i(?:i|p?x?)')
container.register_property('screenSize', '1080p', '(?:\d{3,}(?:\\|\/|x|\*))?1080(?:i|p?x?)')
container.register_property('screenSize', '4K', '(?:\d{3,}(?:\\|\/|x|\*))?2160(?:i|p?x?)')
register_quality('screenSize', '360p', -300)
register_quality('screenSize', '368p', -200)
register_quality('screenSize', '480p', -100)
register_quality('screenSize', '576p', 0)
container.register_property('screenSize', '360p', '(?:\d{3,}(?:\\|\/|x|\*))?360(?:i|p?x?)')
container.register_property('screenSize', '368p', '(?:\d{3,}(?:\\|\/|x|\*))?368(?:i|p?x?)')
container.register_property('screenSize', '480p', '(?:\d{3,}(?:\\|\/|x|\*))?480(?:i|p?x?)')
container.register_property('screenSize', '480p', 'hr', confidence=0.2)
container.register_property('screenSize', '576p', '(?:\d{3,}(?:\\|\/|x|\*))?576(?:i|p?x?)')
container.register_property('screenSize', '720p', '(?:\d{3,}(?:\\|\/|x|\*))?720(?:i|p?x?)')
container.register_property('screenSize', '900p', '(?:\d{3,}(?:\\|\/|x|\*))?900(?:i|p?x?)')
container.register_property('screenSize', '1080i', '(?:\d{3,}(?:\\|\/|x|\*))?1080i(?:i|p?x?)')
container.register_property('screenSize', '1080p', '(?:\d{3,}(?:\\|\/|x|\*))?1080(?:i|p?x?)')
container.register_property('screenSize', '4K', '(?:\d{3,}(?:\\|\/|x|\*))?2160(?:i|p?x?)')
register_quality('screenSize', '360p', -300)
register_quality('screenSize', '368p', -200)
register_quality('screenSize', '480p', -100)
register_quality('screenSize', '576p', 0)
register_quality('screenSize', '720p', 100)
register_quality('screenSize', '900p', 130)
register_quality('screenSize', '1080i', 180)
register_quality('screenSize', '1080p', 200)
register_quality('screenSize', '4K', 400)
# http://blog.mediacoderhq.com/h264-profiles-and-levels/
_videoProfiles = {'BS':('BS',),
'EP':('EP', 'XP'),
'MP':('MP',),
'HP':('HP', 'HiP'),
'10bit':('10.?bit', 'Hi10P'),
'Hi422P':('Hi422P',),
'Hi444PP':('Hi444PP'),
}
container.register_property('videoCodec', 'Real', 'Rv\d{2}') # http://en.wikipedia.org/wiki/RealVideo