coherence.backends.twitch_storage (module)¶
A backend to access twitch.tv streams.
To enable personalized features (e.g. ‘Following’ streams), add ‘access_token’ key into your config file:
Click the link below to automatically request an access token for your account:
After authorization you will be redirected to http://localhost with access token in fragment part, e.g:
http://localhost/#access_token= <YOUR_ACCESS_TOKEN_IS_HERE> &scope=user_read
Copy the token and paste in TwitchStore section of your config file:
access_token = <YOUR_ACCESS_TOKEN (step 2)>
-
class
LiveStreamerProxyResource
(url, stream_id, content_type='video/mpeg')[source]¶ Bases:
twisted.web.resource.Resource
,coherence.log.LogAble
-
logCategory
= 'twitch_store'¶
-
-
class
TwitchLazyContainer
(parent, title, limit=None, **kwargs)[source]¶ Bases:
coherence.backend.LazyContainer
-
logCategory
= 'twitch_store'¶
-
-
class
GamesContainer
(parent, title='Games', description=None, limit=None, children_limit=None, **kwargs)[source]¶ Bases:
coherence.backends.twitch_storage.TwitchLazyContainer
-
class
StreamsContainer
(parent, title, viewers=0, channels=0, streams_url='%s/streams/', cover_url=None, **kwargs)[source]¶ Bases:
coherence.backends.twitch_storage.TwitchLazyContainer
-
URL
= '%s/streams/'¶
-
-
class
TwitchStreamItem
(title, url, status=None, viewers=0, created_at=None, preview_url=None)[source]¶ Bases:
coherence.backend.BackendItem
-
logCategory
= 'twitch_store'¶
-
-
class
TwitchStore
(server, **kwargs)[source]¶ Bases:
coherence.backend.AbstractBackendStore
-
logCategory
= 'twitch_store'¶
-
implements
= ['MediaServer']¶
-
wmc_mapping
= {'16': 1000}¶
-
description
= ('twitch.tv', 'twitch.tv', None)¶
-
options
= [{'option': 'name', 'text': 'Server Name:', 'type': 'string', 'default': 'twitch.tv', 'help': 'the name under this MediaServer shall show up with on other UPnP clients'}, {'option': 'access_token', 'text': 'OAuth Access Token:', 'type': 'string', 'default': '', 'help': 'access token to show personalized list of followed streams'}, {'option': 'version', 'text': 'UPnP Version:', 'type': 'int', 'default': 2, 'enum': (2, 1), 'help': 'the highest UPnP version this MediaServer shall support', 'level': 'advance'}, {'option': 'uuid', 'text': 'UUID Identifier:', 'type': 'string', 'default': 'twitch_tv', 'help': 'the unique (UPnP) identifier for this MediaServer', 'level': 'advance'}]¶
-