Models Reference

Model class

class twitcaspy.models.Model(api=None)

Model Base Class

_api

API

classmethod parse(api, json)

JSONオブジェクトをモデルインスタンスに解析します。

Result class

class twitcaspy.models.Result(api=None)

ベースクラス: twitcaspy.models.model.Model

API Result Object

latelimit

LateLimit

Raw class

class twitcaspy.models.Raw

Raw Object

元のデータをそのまま返却します。
このクラスはインスタンスを生成しません。

User class

class twitcaspy.models.User(api=None)

ベースクラス: twitcaspy.models.model.Model

User Object

id
ライブ配信者のユーザID

str

screen_id
ライブ配信者のID(例: @~~)
注意: screen_idはユーザによって変更される場合があります。

str

name
ヒューマンリーダブルなユーザの名前

str

image
ユーザアイコンのURL

str

profile
プロフィール文章

str

level
ユーザのレベル

int

last_movie_id
ユーザが最後に配信したライブのID

str or None

is_live
現在ライブ配信中かどうか

bool

supporter_count(deprecated)
ユーザーのサポーターの数
固定値0を返します。
このパラメータは非推奨です。

int

supporting_count(deprecated)
ユーザーがサポートしている数
固定値0を返します。
このパラメータは非推奨です。

int

created(deprecated)
このアカウントの作成日時
固定値0を返します。
このパラメータは非推奨です。

int

参照

https://apiv2-doc.twitcasting.tv/#user-object

App class

class twitcaspy.models.App(api=None)

ベースクラス: twitcaspy.models.model.Model

Application Object

client_id
アプリケーションのクライアントID

str

name
アプリケーション名

str

owner_user_id
アプリケーション開発者のユーザID

str

参照

https://apiv2-doc.twitcasting.tv/#app-object

Live class

class twitcaspy.models.Live(api=None)

ベースクラス: twitcaspy.models.model.Model

Live Object

movie

Movie

broadcaster

User

tags

list

Movie class

class twitcaspy.models.Movie(api=None)

ベースクラス: twitcaspy.models.model.Model

Movie Object

id
ライブのID

str

user_id
ライブ配信者のユーザID

str

title
タイトル

str

subtitle
テロップ

str

last_owner_comment
ライブ配信者の最新コメントの文章

str or None

category
カテゴリID

str or None

ライブ(録画)へのリンクURL

str

is_live
ライブ配信中かどうか

bool

is_recorded
録画が公開されているかどうか

bool

comment_count
総コメント数

int

large_thumbnail
サムネイル画像(大)のURL

str

small_thumbnail
サムネイル画像(小)のURL

str

country
配信地域(国コード)

str

duration
配信時間(秒)

int

created
配信開始日時のunixタイムスタンプを datetime.datetime 型へ変換したもの

datetime.datetime

is_collabo
コラボ配信かどうか

bool

is_protected
合言葉配信かどうか

bool

max_view_count
最大同時視聴数
(配信中の場合0)

int

current_view_count
現在の同時視聴者数
(配信中ではない場合0)

int

total_view_count
総視聴者数

int

hls_url
HTTP Live Streaming再生用のURL
hls_url パラメータの URL を http から https に変更しました。

str or None

参照

https://apiv2-doc.twitcasting.tv/#movie-object

Comment class

class twitcaspy.models.Comment(api=None)

ベースクラス: twitcaspy.models.model.Model

Comment Object

id
コメントのID

str

message
コメント本文

str

from_user
コメント投稿者の情報

User

created
コメント投稿日時のunixタイムスタンプを datetime.datetime 型へ変換したもの

datetime.datetime

参照

https://apiv2-doc.twitcasting.tv/#comment-object

Gift class

class twitcaspy.models.Gift(api=None)

ベースクラス: twitcaspy.models.model.Model

Gift Object

id
アイテム送信ID

str

message
アイテム送信時のメッセージ本文

str

item_image
アイテム画像のURL

str

item_sub_image
アイテム送信時に選択された画像があれば画像のURL

str or None

item_id
アイテムのID

str

item_mp
アイテムのMP

str

item_name
アイテム名

str

user_image
ユーザアイコンのURL

str

user_screen_id
ユーザアイコンのURL

str

user_screen_name
ヒューマンリーダブルな screen_id

str

user_name
ヒューマンリーダブルなユーザの名前

str

参照

https://apiv2-doc.twitcasting.tv/#gift-object

Supporter class

class twitcaspy.models.Supporter(api=None)

ベースクラス: twitcaspy.models.model.Model

Supporter Object

id
ライブ配信者のユーザID

str

screen_id
ライブ配信者のID(例: @~~)
注意: screen_idはユーザによって変更される場合があります。

str

name
ヒューマンリーダブルなユーザの名前

str

image
ユーザアイコンのURL

str

profile
プロフィール文章

str

level
ユーザのレベル

int

last_movie_id
ユーザが最後に配信したライブのID

str or None

is_live
現在ライブ配信中かどうか

bool

supporter_count(deprecated)
ユーザーのサポーターの数
固定値0を返します。
このパラメータは非推奨です。

int

supporting_count(deprecated)
ユーザーがサポートしている数
固定値0を返します。
このパラメータは非推奨です。

int

point
Item score

int

total_point
Cumulative score

int

created(deprecated)
このアカウントの作成日時
固定値0を返します。
このパラメータは非推奨です。

int

参照

https://apiv2-doc.twitcasting.tv/#supporteruser-object

Category class

class twitcaspy.models.Category(api=None)

ベースクラス: twitcaspy.models.model.Model

Category Object

id
カテゴリID

str

name
カテゴリ名

str

sub_categories

SubCategorylist

参照

https://apiv2-doc.twitcasting.tv/#category-object

SubCategory class

class twitcaspy.models.SubCategory(api=None)

ベースクラス: twitcaspy.models.model.Model

SubCategory Object

id
サブカテゴリID

str

name
サブカテゴリ名

str

count
サブカテゴリ配信数

int

参照

https://apiv2-doc.twitcasting.tv/#sub-category-object

WebHook class

class twitcaspy.models.WebHook(api=None)

ベースクラス: twitcaspy.models.model.Model

WebHook Object

user_id
ユーザーID

str

event
フックするイベント種別
event は下記のいずれかである必要があります。
'livestart' : ライブ開始
'liveend' : ライブ終了

str

参照

https://apiv2-doc.twitcasting.tv/#webhook-object

LateLimit class

class twitcaspy.models.LateLimit

Late Limit Object

limit
APIの実行上限回数

int

remaining
APIの残り実行可能回数

int

reset
APIの残り実行可能回数がリセットされる時刻のUnixTimestamp

int

reset_time
resetを datetime.datetime 型へ変換したもの

datetime.datetime

参照

https://apiv2-doc.twitcasting.tv/#response-headers

ModelFactory class

class twitcaspy.models.ModelFactory
パーサーがモデルのインスタンスを作成するために使用されます。
独自のモデルを追加する場合は、このクラスを継承してください。
app

alias of twitcaspy.models.app.App

category

alias of twitcaspy.models.category.Category

comment

alias of twitcaspy.models.comment.Comment

gift

alias of twitcaspy.models.gift.Gift

live

alias of twitcaspy.models.live.Live

movie

alias of twitcaspy.models.movie.Movie

raw

alias of twitcaspy.models.raw.Raw

subcategory

alias of twitcaspy.models.subcategory.SubCategory

supporter

alias of twitcaspy.models.supporter.Supporter

user

alias of twitcaspy.models.user.User

webhook

alias of twitcaspy.models.webhook.WebHook