def get_comments(channel_id, post_id, limit=10, cursor='MA=='):
    q = Qry('feed/{channel_id}/posts/{post_id}/comments')
    q.add_urlkw(keys.CHANNEL_ID, channel_id)
    q.add_urlkw(keys.POST_ID, post_id)
    q.add_param(keys.LIMIT, limit, 10)
    q.add_param(keys.CURSOR, Cursor.validate(cursor), 'MA==')
    return q
def delete_comment_reaction(channel_id, post_id, comment_id, emote_id):
    q = Qry('feed/{channel_id}/posts/{post_id}/comments/{comment_id}/reactions', method=methods.DELETE)
    q.add_urlkw(keys.CHANNEL_ID, channel_id)
    q.add_urlkw(keys.POST_ID, post_id)
    q.add_urlkw(keys.COMMENT_ID, comment_id)
    q.add_param(keys.EMOTE_ID, emote_id)
    return q
Esempio n. 3
0
def get_top(limit=10, offset=0, game=None, period=Period.WEEK, broadcast_type=BroadcastType.HIGHLIGHT):
    q = Qry('videos/top', use_token=False)
    q.add_param(keys.LIMIT, limit, 10)
    q.add_param(keys.OFFSET, offset, 0)
    q.add_param(keys.GAME, game)
    q.add_param(keys.PERIOD, Period.validate(period), Period.WEEK)
    q.add_param(keys.BROADCAST_TYPE, BroadcastType.validate(broadcast_type))
    return q
Esempio n. 4
0
def update(video_id, title=None, description=None, game=None, language=None, tag_list=None):
    q = Qry('videos/{video_id}', method=methods.PUT)
    q.add_urlkw(keys.VIDEO_ID, video_id)
    q.add_param(keys.TITLE, title)
    q.add_param(keys.DESCRIPTION, description)
    q.add_param(keys.GAME, game)
    if language is not None:
        q.add_param(keys.LANGUAGE, Language.validate(language))
    q.add_param(keys.TAG_LIST, tag_list)
    return q
Esempio n. 5
0
def streams(search_query, limit=25, offset=0, hls=Boolean.FALSE):
    q = Qry('search/streams')
    q.add_param(keys.QUERY, search_query)
    q.add_param(keys.LIMIT, limit, 25)
    q.add_param(keys.OFFSET, offset, 0)
    q.add_param(keys.HLS, hls, Boolean.FALSE)
    return q
Esempio n. 6
0
def get_follows(user_id,
                limit=25,
                offset=0,
                direction=Direction.DESC,
                sort_by=SortBy.CREATED_AT):
    q = Qry('users/{user_id}/follows/channels')
    q.add_urlkw(keys.USER_ID, user_id)
    q.add_param(keys.LIMIT, limit, 25)
    q.add_param(keys.OFFSET, offset, 0)
    q.add_param(keys.DIRECTION, direction, Direction.DESC)
    q.add_param(keys.SORT_BY, sort_by, SortBy.CREATED_AT)
    return q
def get_followers(channel_id,
                  limit=25,
                  offset=0,
                  cursor='MA==',
                  direction=Direction.DESC):
    q = Qry('channels/{channel_id}/follows')
    q.add_urlkw(keys.CHANNEL_ID, channel_id)
    q.add_param(keys.LIMIT, limit, 25)
    q.add_param(keys.OFFSET, offset, 0)
    q.add_param(keys.CURSOR, Cursor.validate(cursor), 'MA==')
    q.add_param(keys.DIRECTION, direction, Direction.DESC)
    return q
def get_posts(channel_id, limit=10, cursor='MA==', comments=5):
    q = Qry('feed/{channel_id}/posts')
    q.add_urlkw(keys.CHANNEL_ID, channel_id)
    q.add_param(keys.LIMIT, limit, 10)
    q.add_param(keys.CURSOR, Cursor.validate(cursor), 'MA==')
    q.add_param(keys.COMMENTS, comments, 5)
    return q
Esempio n. 9
0
def get_followed(stream_type=StreamType.LIVE, limit=25, offset=0):
    q = Qry('streams/followed')
    q.add_param(keys.STREAM_TYPE, StreamType.validate(stream_type),
                StreamType.LIVE)
    q.add_param(keys.LIMIT, limit, 25)
    q.add_param(keys.OFFSET, offset, 0)
    return q
def get_subscribers(channel_id, limit=25, offset=0, direction=Direction.ASC):
    q = Qry('channels/{channel_id}/subscriptions')
    q.add_urlkw(keys.CHANNEL_ID, channel_id)
    q.add_param(keys.LIMIT, limit, 25)
    q.add_param(keys.OFFSET, offset, 0)
    q.add_param(keys.DIRECTION, direction, Direction.DESC)
    return q
Esempio n. 11
0
def get_collections(channel_id, limit=10, cursor='MA==', containing_item=None):
    q = Qry('channels/{channel_id}/collections', use_token=False)
    q.add_urlkw(keys.CHANNEL_ID, channel_id)
    q.add_param(keys.LIMIT, limit, 10)
    q.add_param(keys.CURSOR, Cursor.validate(cursor), 'MA==')
    q.add_param(keys.CONTAINING_ITEM, containing_item,
                None)  # 'video:<video_id>'
    return q
Esempio n. 12
0
def games(search_query, live=Boolean.FALSE):
    q = Qry('search/games')
    q.add_param(keys.QUERY, search_query)
    q.add_param(
        keys.TYPE,
        'suggest')  # 'type' can currently only be suggest, so it is hardcoded

    q.add_param(keys.LIVE, live, Boolean.FALSE)
    return q
Esempio n. 13
0
def get_followed(trending=Boolean.FALSE,
                 language=Language.ALL,
                 cursor='MA==',
                 limit=10):
    q = Qry('clips/followed')
    q.add_param(keys.TRENDING, Boolean.validate(trending), Boolean.FALSE)
    q.add_param(keys.LANGUAGE, Language.validate(language), Language.ALL)
    q.add_param(keys.LIMIT, limit, 10)
    q.add_param(keys.CURSOR, Cursor.validate(cursor), 'MA==')
    return q
Esempio n. 14
0
def get_top(limit=10, offset=0):
    q = Qry('games/top')
    q.add_param(keys.LIMIT, limit, 10)
    q.add_param(keys.OFFSET, offset, 0)
    return q
Esempio n. 15
0
def get_top(channels=None,
            games=None,
            period=ClipPeriod.WEEK,
            trending=Boolean.FALSE,
            language=Language.ALL,
            cursor='MA==',
            limit=10):
    q = Qry('clips/top')
    q.add_param(keys.CHANNEL, channels, None)
    q.add_param(keys.GAME, games, None)
    q.add_param(keys.PERIOD, ClipPeriod.validate(period), ClipPeriod.WEEK)
    q.add_param(keys.TRENDING, Boolean.validate(trending), Boolean.FALSE)
    q.add_param(keys.LANGUAGE, Language.validate(language), Language.ALL)
    q.add_param(keys.LIMIT, limit, 10)
    q.add_param(keys.CURSOR, Cursor.validate(cursor), 'MA==')
    return q
Esempio n. 16
0
def channels(search_query, limit=25, offset=0):
    q = Qry('search/channels')
    q.add_param(keys.QUERY, search_query)
    q.add_param(keys.LIMIT, limit, 25)
    q.add_param(keys.OFFSET, offset, 0)
    return q
Esempio n. 17
0
def create(channel_id, title, description=None, game=None, language=None, tag_list=None):
    q = Qry('videos/', method=methods.POST)
    q.add_param(keys.CHANNEL_ID, channel_id)
    q.add_param(keys.TITLE, title)
    q.add_param(keys.DESCRIPTION, description)
    q.add_param(keys.GAME, game)
    if language is not None:
        q.add_param(keys.LANGUAGE, Language.validate(language))
    q.add_param(keys.TAG_LIST, tag_list)
    return q
Esempio n. 18
0
def get_followed(limit=10, offset=0, broadcast_type=BroadcastType.HIGHLIGHT):
    q = Qry('videos/followed')
    q.add_param(keys.LIMIT, limit, 10)
    q.add_param(keys.OFFSET, offset, 0)
    q.add_param(keys.BROADCAST_TYPE, BroadcastType.validate(broadcast_type))
    return q
def create_post(channel_id, content, share=Boolean.FALSE):
    q = Qry('feed/{channel_id}/posts/', method=methods.POST)
    q.add_urlkw(keys.CHANNEL_ID, channel_id)
    q.add_param(keys.SHARE, Boolean.validate(share))
    q.add_data(keys.CONTENT, content)
    return q
Esempio n. 20
0
def get_cheermotes(channel_id=None):
    q = Qry('bits/actions')
    q.add_param(keys.CHANNEL_ID, channel_id, None)
    return q
def get_post(channel_id, post_id, comments=5):
    q = Qry('feed/{channel_id}/posts/{post_id}')
    q.add_urlkw(keys.CHANNEL_ID, channel_id)
    q.add_urlkw(keys.POST_ID, post_id)
    q.add_param(keys.COMMENTS, comments, 5)
    return q
Esempio n. 22
0
def get_emoticons_by_set(emotesets=None):
    q = Qry('chat/emoticon_images', use_token=False)
    q.add_param(keys.EMOTESETS, emotesets, None)
    return q
Esempio n. 23
0
def users(logins):
    q = Qry('users')
    q.add_param(keys.LOGIN, logins)
    return q
def get_videos(channel_id,
               limit=10,
               offset=0,
               broadcast_type=BroadcastType.HIGHLIGHT,
               hls=Boolean.FALSE,
               sort_by=VideoSort.TIME,
               language=Language.ALL):
    q = Qry('channels/{id}/videos')
    q.add_urlkw(keys.ID, channel_id)
    q.add_param(keys.LIMIT, limit, 10)
    q.add_param(keys.OFFSET, offset, 0)
    q.add_param(keys.BROADCAST_TYPE, BroadcastType.validate(broadcast_type))
    q.add_param(keys.SORT, VideoSort.validate(sort_by), VideoSort.TIME)
    q.add_param(keys.LANGUAGE, Language.validate(language), Language.ALL)
    q.add_param(keys.HLS, Boolean.validate(hls), Boolean.FALSE)
    return q
def by_name(name):
    q = Qry('communities')
    q.add_param(keys.NAME, name)
    return q
def create_post_reaction(channel_id, post_id, emote_id):
    q = Qry('feed/{channel_id}/posts/{post_id}/reactions', method=methods.POST)
    q.add_urlkw(keys.CHANNEL_ID, channel_id)
    q.add_urlkw(keys.POST_ID, post_id)
    q.add_param(keys.EMOTE_ID, emote_id)
    return q
Esempio n. 27
0
def get_active(limit=25, offset=0):
    q = Qry('teams', use_token=False)
    q.add_param(keys.LIMIT, limit, 25)
    q.add_param(keys.OFFSET, offset, 0)
    return q
def get_top(limit=10, cursor='MA=='):
    q = Qry('communities/top')
    q.add_param(keys.LIMIT, limit, 10)
    q.add_param(keys.CURSOR, Cursor.validate(cursor), 'MA==')
    return q
Esempio n. 29
0
def get_blocks(user_id, limit=25, offset=0):
    q = Qry('users/{user_id}/blocks')
    q.add_urlkw(keys.USER_ID, user_id)
    q.add_param(keys.LIMIT, limit, 25)
    q.add_param(keys.OFFSET, offset, 0)
    return q
def get_bans(community_id, limit=10, cursor='MA=='):
    q = Qry('communities/{community_id}/bans')
    q.add_urlkw(keys.COMMUNITY_ID, community_id)
    q.add_param(keys.LIMIT, limit, 10)
    q.add_param(keys.CURSOR, Cursor.validate(cursor), 'MA==')
    return q