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 に変更する。
! 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.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 変更する
! 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.0.1 s.Find()のセレクタの冗長部分を削除する。 Ver. 0.0.2 s.Find()のセレクタの先頭に"#js-genre-section-all"を追加する。これがないと不要な要素が検出される。
Index ¶
- func ApiCsrftoken(client *http.Client) (csrftoken string, err error)
- func CrwlFollow(client *http.Client, maxnoroom int) (rooms *[]RoomFollowing, err error)
- func GetPointByApi(client *http.Client, roomid int) (point int, rank int, gap int, eventid int, eventurl string, eventname string, ...)
- type ActiveFanNextLevel
- type BulkGiftingFree
- type CsrfToken
- type Event
- type EventSearch
- type Live
- type LiveCurrentUser
- type LiveGiftingFree
- type LivePolling
- type Lives
- type RoomEvnetAndSupport
- type RoomFollowing
- type RoomOnlives
- type RoomStatus
- type UserDetail
- type UserLogin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApiCsrftoken ¶
csrf_tokenを取得する。
func CrwlFollow ¶
func CrwlFollow( client *http.Client, maxnoroom int, ) ( rooms *[]RoomFollowing, err error, )
フォローしているルームの一覧を取得する。
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 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 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 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, page int, ) ( es *EventSearch, 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 RoomFollowing ¶
type RoomFollowing struct {
Room_id string // ルームID 配信者を識別する
Room_url_key string // 配信のURLの最後のフィールド
Main_name string // ルーム名
Next_live string // 次の配信時刻
}
フォローしているルームのデータの構造体(必要とするものだけ、残りは取得していません)
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, )
(ログインしている)リスナーの情報を取得する