-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from anxdpanic/dev
2.0.6
- Loading branch information
Showing
9 changed files
with
149 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- encoding: utf-8 -*- | ||
""" | ||
Reference: https://dev.twitch.tv/docs/api/reference | ||
Copyright (C) 2016-2019 script.module.python.twitch | ||
This file is part of script.module.python.twitch | ||
SPDX-License-Identifier: GPL-3.0-only | ||
See LICENSES/GPL-3.0-only for more information. | ||
""" | ||
|
||
from ..parameters import ItemCount | ||
from ... import keys, methods | ||
from ...queries import HelixQuery as Qry | ||
from ...queries import query | ||
|
||
|
||
# required scope: channel:read:subscriptions | ||
@query | ||
def get_broadcaster_subscriptions(broadcaster_id): | ||
q = Qry('subscriptions', use_app_token=False, method=methods.GET) | ||
q.add_param(keys.BROADCASTER_ID, broadcaster_id) | ||
|
||
return q | ||
|
||
|
||
# required scope: channel:read:subscriptions | ||
@query | ||
def get_user_subscriptions(broadcaster_id, user_id): | ||
q = Qry('subscriptions', use_app_token=False, method=methods.GET) | ||
q.add_param(keys.BROADCASTER_ID, broadcaster_id) | ||
q.add_param(keys.USER_ID, ItemCount().validate(user_id), list()) | ||
|
||
return q |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- encoding: utf-8 -*- | ||
""" | ||
Reference: https://dev.twitch.tv/docs/api/reference | ||
Copyright (C) 2016-2019 script.module.python.twitch | ||
This file is part of script.module.python.twitch | ||
SPDX-License-Identifier: GPL-3.0-only | ||
See LICENSES/GPL-3.0-only for more information. | ||
""" | ||
|
||
from ..parameters import Cursor, IntRange, ItemCount | ||
from ... import keys, methods | ||
from ...queries import HelixQuery as Qry | ||
from ...queries import query | ||
|
||
|
||
# required scope: none | ||
# requires app access token | ||
@query | ||
def get_all_stream_tags(tag_id, after='MA==', first=20): | ||
q = Qry('tags/streams', use_app_token=True, method=methods.GET) | ||
q.add_param(keys.TAG_ID, ItemCount().validate(tag_id), list()) | ||
q.add_param(keys.AFTER, Cursor.validate(after), 'MA==') | ||
q.add_param(keys.FIRST, IntRange(1, 100).validate(first), 20) | ||
|
||
return q | ||
|
||
|
||
# required scope: none | ||
# requires app access token | ||
@query | ||
def get_stream_tags(broadcaster_id): | ||
q = Qry('streams/tags', use_app_token=True, method=methods.GET) | ||
q.add_param(keys.BROADCASTER_ID, broadcaster_id) | ||
|
||
return q | ||
|
||
|
||
# required scope: user:edit:broadcast | ||
@query | ||
def replace_stream_tags(broadcaster_id, tag_ids=list()): | ||
q = Qry('tags/streams', use_app_token=False, method=methods.PUT) | ||
q.add_param(keys.BROADCASTER_ID, broadcaster_id) | ||
q.add_param(keys.TAG_IDS, ItemCount().validate(tag_ids), list()) | ||
|
||
return q |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters