-
Notifications
You must be signed in to change notification settings - Fork 16
/
media.py
25 lines (21 loc) · 885 Bytes
/
media.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from part import Part
class Media(object):
def __init__(self, element, server):
self.server = server
self.element = element
self.part = Part(element.find('.Part'), self.server)
try:
self.videoFrameRate = element.attrib['videoFrameRate']
self.videoCodec = element.attrib['videoCodec']
self.container = element.attrib['container']
self.bitrate = int(element.attrib['bitrate'])
self.height = int(element.attrib['height'])
self.width = int(element.attrib['width'])
self.videoResolution = element.attrib['videoResolution']
self.audioCodec = element.attrib['audioCodec']
except KeyError as e:
print "Missing key in element: ", e.message
def __str__(self):
return "<Media)>"
def __repr__(self):
return "<Media>"