Documentation ¶
Overview ¶
! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Ver. 0.0.0 srapi.goから分離する。 Ver. 1.0.0 戻り値 status を err に変更する。
! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Ver. 0.0.0 srapi.goから分離する。 Ver. 1.0.0 戻り値 status を err に変更する。 Ver. 1.1.1 ダミーのユーザーエージェントを FireFox/124.0に変更する。
! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Ver. 1.1.1 Contribution_ranking.Me のtypeをanyからinterface{}に変更する。
! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Ver. 0.1.0
! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Ver. 0.1.0
! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Ver. 0.1.0
! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Ver. 0.1.0
! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Ver. 0.1.0 ApiLiveCurrentUser.goをsrapi.goから分離する。ApiLiveCurrentUser()のRoomIDをstring型に変更する。 Ver. 1.0.0 戻り値 status を err に変更する。
! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Ver. 0.0.0 Ver. 1.0.0 戻り値 status を err に変更する。 Ver. 2.0.0 ExtrRoomLiveByCtg()とExtrRoomLiveByGnr()をRoomOnlivesのメソッドとする。 Ver. 2.0.1 fmt.Errorf()の %v を %w に変更する。 Ver. 3.0.0 ExtrRoomLiveByCtg(), ExtrRoomLiveyypByGnr()をそれぞれExtrByCtg()、ExtrByCtg()に変更する。 Ver. 4.0.0 ExtrByCtg()、ExtrByCtg()の引数を Roomonlives から *RoomOnLives に変更する。 Ver. 4.1.0 上位でsort.Sort()をsort.Slice()に変更したため、sort.Sort()のためのメソッドを削除する。 Ver. 4.1.0 ExtrByCtg()の引数を Roomonlives から *RoomOnLives に変更する(修正もれ)
! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Ver. 0.1.0
! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Ver. 0.0.0 Ver. 0.1.0 レベルイベントのRankとGapを−1とする。
! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Ver. 0.1.0
! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Ver. 0.1.0
! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Ver. 0.0.0 Ver. 0.1.0 リスナー情報 UserDetail にエラーに関するメンバーを追加する(作成済みのプログラムに影響はない) Ver. 1.0.0 戻り値の staus を error 変更する Ver. 1.1.0 err に fmt.Errorf("package.Function: %w", err) を設定する。
! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Ver. 0.0.0 srapi.goから分離する。 Ver. 1.0.0 戻り値の staus を error 変更する
Index ¶
- func ApiCsrftoken(client *http.Client) (csrftoken string, err error)
- func CrawlEventRoomList(valuehtml string, roomlist *[]Room, usernomap *map[int]bool, ib int, ie int, ...) (err error)
- func GetPointByApi(client *http.Client, roomid int) (point int, rank int, gap int, eventid int, eventurl string, eventname string, ...)
- type ActiveFanNextLevel
- type Block_ranking
- type BulkGiftingFree
- type Contribution_ranking
- type CsrfToken
- type Event
- type EventBlockRanking
- type EventRoomList
- type EventSearch
- type Eventranking
- type FollowRooms
- type Live
- type LiveCurrentUser
- type LiveGiftingFree
- type LivePolling
- type Lives
- type Room
- type RoomEvnetAndSupport
- type RoomFollowed
- type RoomInf
- type RoomListInf
- type RoomNextlive
- type RoomOnlives
- type RoomStatus
- type UserDetail
- type UserLogin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApiCsrftoken ¶
csrf_tokenを取得する。
func CrawlEventRoomList ¶ added in v0.5.0
Types ¶
type ActiveFanNextLevel ¶
type ActiveFanNextLevel struct { Level int // 現在のファンレベル Next_level struct { Level int // 次のファンレベル Conditions []struct { Condition_details []struct { Goal int // 次のレベルになるのに必要な要素(視聴時間、ギフト、コメントの数) Unit string // 単位(分、pt、G、コメント) Value int // (レベルアップに使った分を除く)現在の実績(手持ちの要素数)(視聴時間、ギフト、コメントの数) Label string // 次のレベルになるのに必要な要素の詳細(視聴時間、無料ギフト、有料ギフト、コメント数) } Label string // 次のレベルになるのに必要な要素(視聴時間、有料ギフト or 無料ギフト、コメント数) } } Title_id int // 不明 }
ファンレベルの進捗状況の詳細
func ApiActivefanNextlevel ¶
func ApiActivefanNextlevel( client *http.Client, userid string, roomid string, ) ( afnl ActiveFanNextLevel, err error, )
ファンレベルの進捗状況を得るためのAPI(/api/active_fan/next_level)を実行する。
type Block_ranking ¶ added in v0.6.0
type BulkGiftingFree ¶ added in v0.2.0
type BulkGiftingFree struct { Ua int // 3: ? Aft int // 0: ? Gifting_bonus interface{} // null: ? 現時点では型が不明 Ok bool // true: 正常終了? Notify_level_up bool // false: ? Gifts []struct { Gift_id int // (Official) 1, 2, 1001, 1002, 1003, (Free) 1501, 1502, 1503, 1504. 1505 Add_point int // ボーナスを含んだ獲得ポイント Remaining_num int // 残りの星、種の個数(呼び出し後は0になっているはず) Gift_name string // ギフト名 (Offiicial) "星A", "星B", "星C", "星D", "星E",(Free)"種A", "種B", "種C", "種D", "種E" Bonus_rate float64 // ボーナス率(num >= 10であれば0.2) Gift_type int // 2: ? // contains filtered or unexported fields } Fan_level struct { Next_level_point int // 未確認 Current_level_point int // 未確認 Next_fan_level int // 未確認 Contribution_point int // 累積貢献ポイント ? User_id int // リスナーの識別子 Fan_level int // いわゆるリスナーレベル(現時点で最大値 56) } Level_up string // "0": ? }
星・種の一気投げの結果
func ApiLiveBulkGiftingFree ¶ added in v0.2.0
func ApiLiveBulkGiftingFree( client *http.Client, csrftoken string, liveid string, ) ( bulkgiftingfree *BulkGiftingFree, err error, )
星・種をまとめて投げる
type Contribution_ranking ¶ added in v1.1.0
type Contribution_ranking struct { Ranking []struct { AvatarID int `json:"avatar_id"` Point int `json:"point"` AvatarURL string `json:"avatar_url"` Name string `json:"name"` UserID int `json:"user_id"` Rank int `json:"rank"` } `json:"ranking"` Me interface{} `json:"me"` MyPoint int `json:"my_point"` Event struct { EndedAt int `json:"ended_at"` EventName string `json:"event_name"` EventType string `json:"event_type"` StartedAt int `json:"started_at"` EventURL string `json:"event_url"` ShowRanking int `json:"show_ranking"` Image string `json:"image"` } `json:"event"` }
func ApiEventContribution_ranking ¶ added in v1.1.0
func ApiEventContribution_ranking( client *http.Client, ieventid int, roomid int, ) ( pranking *Contribution_ranking, err error, )
リスナー別の貢献ポイントを取得する
type Event ¶ added in v0.2.0
type Event struct { Content_region_permission int Order_no int Event_id int // イベント識別子 Tag_list []struct { Tag_name string } Event_description string Is_event_Block bool Is_entry_scope_inner bool // 対象者限定か否か(?) Start_soon bool League_ids []int // val.= 9:XX, 10:S, 20:A, 30:B, 40:C (?) End_soon bool Type_name string Is_official bool Event_name string // イベント名 Image_l string Event_type string Image_s string Genre_id int Default_locale string Ended_at int64 // イベント終了日時(UnixTime) Updated_at int64 Start_comming interface{} Event_block_label interface{} Event_image_file_type string Required_level_max int // 参加可能レベル上限 Required_level int // 参加可能レベル下限 Image_m string Offer_started_at int64 No_amateur bool End_remain interface{} Just_offer_started interface{} Created_at int64 Started_at int64 // イベント開始日時(UnixTime) Event_url_key string // イベントURL(最後のフィールド) Is_box_event bool // 親イベントか否か(?) Parent_event_id int Show_ranking bool Is_watch bool Is_public bool Public_status int Is_closed bool Is_pickup bool Reward_rank int Offer_ended_at int64 // 申込み終了日時(UnixTime) }
type EventBlockRanking ¶ added in v0.6.0
type EventBlockRanking struct { Total_entries int Entries_per_pages int Current_page int Block_ranking_list []Block_ranking }
func ApiBlockEventRnaking ¶ added in v0.6.0
func GetEventBlockRanking ¶ added in v0.6.0
func GetEventBlockRanking( client *http.Client, eventid int, blockid int, ib int, ie int, ) ( ebr *EventBlockRanking, err error, )
ブロックランキングイベント参加中のルーム情報の一覧を取得する。
type EventRoomList ¶ added in v0.5.0
func ApiEventRoomList ¶ added in v0.5.0
func ApiEventRoomList( client *http.Client, eventid int, page int, ) ( eventroomlist *EventRoomList, err error, )
配信状況を確認し、room_url_key から room_id を取得する。
type EventSearch ¶ added in v0.2.0
type EventSearch struct { Next_page int Previous_page int Last_page int // ページ数、この数だけ取得を繰り返す。 First_page int Current_page int Total_count int // イベント数、イベント情報取得後数が一致しているかチェックする。 Event_list []Event }
func ApiEventSearch ¶ added in v0.2.0
func ApiEventSearch( client *http.Client, args ...int, ) ( es *EventSearch, err error, )
type Eventranking ¶ added in v1.1.0
type Eventranking struct { Ranking []struct { Point int `json:"point"` Room struct { Name string `json:"name"` ImageSquare string `json:"image_square"` RoomID int `json:"room_id"` Image string `json:"image"` } `json:"room"` Rank int `json:"rank"` } `json:"ranking"` TargetRoomRanking struct { Gap int `json:"gap"` Point int `json:"point"` Room struct { Name string `json:"name"` ImageSquare string `json:"image_square"` RoomID int `json:"room_id"` Image string `json:"image"` } `json:"room"` Rank int `json:"rank"` LowerGap int `json:"lower_gap"` } `json:"target_room_ranking"` Event struct { EndedAt int `json:"ended_at"` EventName string `json:"event_name"` StartedAt int `json:"started_at"` EventType string `json:"event_type"` EventURL string `json:"event_url"` Image string `json:"image"` ShowRanking int `json:"show_ranking"` } `json:"event"` }
func ApiEventsRanking ¶ added in v1.1.0
func ApiEventsRanking( client *http.Client, ieventid int, roomid int, blockid int, ) ( pranking *Eventranking, err error, )
フォローしているルームの一覧を指定した範囲で取得する。
type FollowRooms ¶ added in v0.6.0
type FollowRooms struct { Next_page int // 次ページのページ番号、null: 次ページなし Previous_page int // 前ページのページ番号、null: 前ページなし Total_Entries int // フォローしている配信者の数 First_page int // 最初のページのページ番号(常に1 ?) Current_page int // 現在のページのページ番号 Rooms []RoomFollowed }
func ApiFollowRooms ¶ added in v0.6.0
func ApiFollowRooms( client *http.Client, page int, count int, ) ( followrooms *FollowRooms, err error, )
フォローしているルームの一覧を指定した範囲で取得する。
type LiveCurrentUser ¶
type LiveCurrentUser struct { Is_login bool // ログインしているか? ログインしていればtrue User_id int // リスナーの識別子 Name string // リスナー名 Fan_level int // ファンレベル、Maxが56のやつ Add_free_gift int // ? Contribution_point int // おそらく貢献ポイントの累計 Gift_list struct { Normal []struct { Gift_id int // ギフトの種別 1であれば赤星、... Free_num int // Gift_idのギフトの個数 } } }
リスナー情報
func ApiLiveCurrentUser ¶
func ApiLiveCurrentUser( client *http.Client, roomid string, ) ( livecurrentuser LiveCurrentUser, err error, )
リスナーに関する情報を取得する
type LiveGiftingFree ¶ added in v0.2.0
type LiveGiftingFree struct { Ua int // ? Aft int // ? Num int // ? Remaining_num int // 星、種の残り個数 Gifting_bonus int // ? Ok bool // true: 正常終了? Notify_level_up bool // true: レベルアップ通知? Gift_id int // (Official) 1, 2, 1001, 1002, 1003, (Free) 1501, 1502, 1503, 1504. 1505 Add_point int // ボーナスを含んだ獲得ポイント Gift_name string // ギフト名 (Offiicial) "星A", "星B", "星C", "星D", "星E",(Free) "種A", "種B", "種C", "種D", "種E" Bonus_rate float64 // ボーナス率(num >= 10であれば0.2) Fan_Level struct { Contribution_point int // 累積貢献ポイント ? } }
func ApiLiveGiftingFree ¶ added in v0.2.0
func ApiLiveGiftingFree( client *http.Client, csrftoken string, liveid string, giftid string, num string, ) ( livegiftingfree *LiveGiftingFree, err error, )
星を投げる/種を投げる。
type LivePolling ¶ added in v0.4.0
type LivePolling struct { Is_login bool // ログインしているか? Show_login_dialog int Online_user_num int // 視聴者数 Active_fan struct { Can_boostable bool User struct { Before_level int Titile_id int Current_level int } Room struct { Total_user_count int // Fan_name string // ファンの名称 } } Live_watch_incentive struct { Ok int // 1:星・種をもらえた Is_amateur string // "1": フリー } Toast struct { Message string // 星・種集めのトーストの文面はここにある } }
func ApiLivePolling ¶ added in v0.4.0
func ApiLivePolling( client *http.Client, room_id int, ) ( livepolling *LivePolling, err error, )
星・種をもらえたことを確認する。 配信状況を確認し、room_url_key から room_id を取得する。
type RoomEvnetAndSupport ¶ added in v0.1.0
type RoomEvnetAndSupport struct { Event struct { Event_id int // イベント識別子 Event_url string // イベントのURLの末尾のフィールド Event_name string // イベント名 Ranking struct { Rank int // 順位 Point int // 獲得ポイント Gap int // 上位とのポイント差 } Quest struct { Support struct { Goal_point int // 目標ポイント Current_point int // 現在のポイント Support_users []struct { Point int // ポイント Order int // 順位 Name string // ユーザー名 User_id int // ユーザー識別子 } } Quest_list []struct { Number_of_items int // アイテム数 Color string // 色 Goal_point int // 目標ポイント Rest_time int // 残り時間? Title string // タイトル Quest_level int // クエストレベル Is_aquired bool // クエスト獲得フラグ? } } } }
イベントの順位と獲得ポイント JSONには他にもいろんなフィールドがあります。 ぜったい必要そうなものとフィールドの作りが面倒そうなところだけ構造体にしてあります。
func ApiRoomEventAndSupport ¶ added in v0.1.0
func ApiRoomEventAndSupport( client *http.Client, roomid string, ) ( res *RoomEvnetAndSupport, err error, )
イベントの順位と獲得ポイントを知るAPI(/api/room/event_and_suport)を実行する。
type RoomFollowed ¶ added in v0.6.0
type RoomFollowed struct { Is_official int // 0:Free, 1:Official Image_l string // 画像 Room_description string // ルーム概要 Room_url_key string // 配信ページのURLの最後のフィールド Next_live string // "未定"または"11/25 18:00"の形式 Image_m string // 未確認 Has_next_live int // null:配信予定なし, 1:配信予定あり Is_online int // 0: 配信中ではない, Room_id string // RoomIDを文字列にしたもの Room_name string // ルーム名 Open_fan_club int // null:ファンルームなし、1:ファンルームあり }
func GetFollowRoomsByApi ¶ added in v0.6.0
func GetFollowRoomsByApi( client *http.Client, ) ( roomsfollowed []RoomFollowed, err error, )
フォローしているすべてのルームの一覧を取得する。
type RoomInf ¶ added in v1.0.0
type RoomInf struct { Name string // ルーム名のリスト Longname string Shortname string Account string // アカウントのリスト、アカウントは配信のURLの最後の部分の英数字です。 ID string // IDのリスト、IDはプロフィールのURLの最後の部分で5~6桁の数字です。 Userno int // APIで取得できるデータ(1) Genre string Rank string Irank int Nrank int Prank int Followers int Sfollowers string Fans int Fans_lst int Level int Slevel string // APIで取得できるデータ(2) Order int Point int // イベント終了後12時間〜36時間はイベントページから取得できることもある Spoint string Istarget string Graph string Iscntrbpoint string Color string Colorvalue string // Colorinflist ColorInfList Formid string Eventid string Status string Statuscolor string }
type RoomListInf ¶ added in v0.5.0
type RoomListInf struct {
RoomList []Room
}
func GetRoominfFromEventByApi ¶ added in v0.5.0
func GetRoominfFromEventByApi( client *http.Client, eventid int, ib int, ie int, ) ( roomlistinf *RoomListInf, err error, )
イベント参加中のルーム情報の一覧を取得する。
type RoomNextlive ¶ added in v0.5.0
type RoomNextlive struct { Epoch int64 // 次回配信開始時刻(UnixTime) Text string // 次回配信開始時刻( "1/2 15:04" ) }
func ApiRoomNextlive ¶ added in v0.5.0
func ApiRoomNextlive( client *http.Client, room_id int, ) ( roomnextlive *RoomNextlive, err error, )
次回配信時刻を取得する
type RoomOnlives ¶
type RoomOnlives struct { // 配信中ルーム一覧 // Onlives []OnLive // ジャンルごとの配信中ルーム一覧 Onlives []struct { Genre_id int // 0: 人気、 200: フリー、 100(?)〜199(?): 公式、 700〜: 特定属性 Genre_name string // ジャンル名 Lives Lives // 配信中ルーム一覧 } Bcsvr_post int Bcsvr_host string }
func ApiLiveOnlives ¶
func ApiLiveOnlives( client *http.Client, ) ( roomonlives *RoomOnlives, err error, )
配信中のルームの一覧を取得する
type RoomStatus ¶ added in v0.3.0
type RoomStatus struct { Started_at int64 // 配信開始時刻(UnixTime) Is_live bool // 配信中か? Live_status int // 0|2 Is_enquete bool // アンケートが行われているか? Live_id int // 配信の識別子 Is_official bool // 公式か? Genre_id int // 配信ジャンル(Freeだったら200みたいなの) Room_id int // ルームの識別子 Room_name string // ルーム名 Room_url_key string // 配信時URLの最後のフィールド Is_owner bool Is_fav bool Youtube_id string // 非配信時Youtube動画( https://www.youtube.com/watch?v=4{Youtube_id}) Did_send_live_bad_report bool Can_comment bool Background_image_url string Video_type int Broadcast_host string Broadcast_port int Broadcast_key string Image_s string Nsta_owner bool Live_type int Live_user_key string Twitter struct { Text string Url string } } }
func ApiRoomStatus ¶ added in v0.3.0
func ApiRoomStatus( client *http.Client, room_url_key string, ) ( roomstatus *RoomStatus, err error, )
配信状況を確認し、room_url_key から room_id を取得する。
type UserDetail ¶
type UserDetail struct { User_id int // ユーザーID=リスナーの識別子、ログインしていない場合は 0 となる。 Name string // ユーザー名=リスナー名 Age int Regidence int Description string Image string Birthday string Is_ng_nick_name bool // ? // エラー情報 // ログインしている場合は空配列となる模様。 // ログインしていない場合は // Error_user_msg: "Error occured" // Message: "Not Found" // Code: 1002 Errors []struct { Error_user_msg string // エラーメッセージ Message string // エラー内容 Code int // エラーコード } }
リスナー情報
func ApiUserDetail ¶
func ApiUserDetail( client *http.Client, ) ( userdetail *UserDetail, err error, )
(ログインしている)リスナーの情報を取得する
Source Files ¶
- ApiActivefanNextlevel.go
- ApiCsrftoken.go
- ApiEventContribution_ranking.go
- ApiEventRoomList.go
- ApiEventSearch.go
- ApiEventsRanking.go
- ApiEvnetBlockRanking.go
- ApiFollowRooms.go
- ApiLiveBulkGiftingFree.go
- ApiLiveCurrentUser.go
- ApiLiveGiftingFree.go
- ApiLiveOnlives.go
- ApiLivePolling.go
- ApiRoomEventAndSupport.go
- ApiRoomNextlive.go
- ApiRoomProfile.go
- ApiRoomStatus.go
- ApiUserDetail.go
- ApiUserLogin.go