-
Notifications
You must be signed in to change notification settings - Fork 0
/
media_entry.py
69 lines (55 loc) · 1.65 KB
/
media_entry.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
class MediaEntry(object):
def __init__(self, media_url, thumbnail_urls, title, duration, description, service, audio_only=False):
self._media_url = media_url
self._thumbnail_urls = thumbnail_urls
self._title = title
self._duration = duration
self._description = description
self._service = service
self._audio_only = audio_only
@property
def thumbnail_urls(self):
return self._thumbnail_urls
@thumbnail_urls.setter
def thumbnail_urls(self, value):
if not type(value) == list:
raise TypeError("thumbnail urls must be a list")
self._thumbnail_urls = value
@property
def media_url(self):
return self._media_url
@media_url.setter
def media_url(self, value):
if not type(value) == str:
raise TypeError("media url must be a string")
self._media_url = value
@property
def title(self):
return self._title
@title.setter
def title(self, value):
self._title = value
@property
def duration(self):
return self._duration
@duration.setter
def duration(self, value):
self._duration = value
@property
def description(self):
return self._description
@description.setter
def description(self, value):
self._description = value
@property
def service(self):
return self._service
@service.setter
def service(self, value):
self._service = value
@property
def audio_only(self):
return self._audio_only
@audio_only.setter
def audio_only(self, value):
self._audio_only = value