-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
230 additions
and
157 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package common | ||
|
||
type Cate struct { | ||
Land *int `json:"land,omitempty"` | ||
Circle *int `json:"circle,omitempty"` | ||
Ratio *float32 `json:"ratio,omitempty"` | ||
} |
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 |
---|---|---|
@@ -1,10 +1,16 @@ | ||
package common | ||
|
||
type Channel struct { | ||
Urls []string `json:"urls,omitempty"` | ||
Number string `json:"number,omitempty"` | ||
Logo string `json:"logo,omitempty"` | ||
Epg string `json:"epg,omitempty"` | ||
Name string `json:"name,omitempty"` | ||
Ua string `json:"ua,omitempty"` | ||
Urls []string `json:"urls,omitempty"` | ||
Number string `json:"number,omitempty"` | ||
Logo string `json:"logo,omitempty"` | ||
Epg string `json:"epg,omitempty"` | ||
Name string `json:"name,omitempty"` | ||
Ua string `json:"ua,omitempty"` | ||
Click string `json:"click,omitempty"` | ||
Referer string `json:"referer,omitempty"` | ||
Header interface{} `json:"header,omitempty"` | ||
PlayerType *int `json:"playerType,omitempty"` | ||
Parse *int `json:"parse,omitempty"` | ||
Drm *Drm `json:"drm,omitempty"` | ||
} |
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 |
---|---|---|
@@ -1,6 +1,11 @@ | ||
package common | ||
|
||
type Class struct { | ||
TypeId string `json:"type_id,omitempty"` | ||
TypeName string `json:"type_name,omitempty"` | ||
TypeId string `json:"type_id,omitempty"` | ||
TypeName string `json:"type_name,omitempty"` | ||
TypeFlag string `json:"type_flag,omitempty"` | ||
Filters []Filter `json:"filters,omitempty"` | ||
Land *int `json:"land,omitempty"` | ||
Circle *int `json:"circle,omitempty"` | ||
Ratio *float32 `json:"ratio,omitempty"` | ||
} |
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 |
---|---|---|
@@ -1,12 +1,13 @@ | ||
package common | ||
|
||
type Config struct { | ||
Ads []string `json:"ads,omitempty"` | ||
Flags []string `json:"flags,omitempty"` | ||
Parses []Parse `json:"parses,omitempty"` | ||
Sites []Site `json:"sites,omitempty"` | ||
Ijk interface{} `json:"ijk,omitempty"` | ||
Lives []Live `json:"lives,omitempty"` | ||
Spider string `json:"spider,omitempty"` | ||
Wallpaper string `json:"wallpaper,omitempty"` | ||
Doh []Doh `json:"doh,omitempty"` | ||
Rules []Rule `json:"rules,omitempty"` | ||
Sites []Site `json:"sites,omitempty"` | ||
Parses []Parse `json:"parses,omitempty"` | ||
Flags []string `json:"flags,omitempty"` | ||
Ads []string `json:"ads,omitempty"` | ||
Lives []Live `json:"lives,omitempty"` | ||
Spider string `json:"spider,omitempty"` | ||
Wallpaper string `json:"wallpaper,omitempty"` | ||
} |
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,7 @@ | ||
package common | ||
|
||
type Doh struct { | ||
Name string `json:"name,omitempty"` | ||
Url string `json:"url,omitempty"` | ||
Ips []string `json:"ips,omitempty"` | ||
} |
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,6 @@ | ||
package common | ||
|
||
type Drm struct { | ||
Key string `json:"key,omitempty"` | ||
Type string `json:"type,omitempty"` | ||
} |
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 |
---|---|---|
@@ -1,59 +1,54 @@ | ||
package common | ||
|
||
import ( | ||
"TVHelper/global" | ||
"encoding/json" | ||
"strconv" | ||
|
||
"go.uber.org/zap" | ||
|
||
"github.com/spf13/cast" | ||
) | ||
|
||
type Live struct { | ||
Type int `json:"type"` | ||
Boot bool `json:"boot,omitempty"` | ||
Name string `json:"name,omitempty"` | ||
Group string `json:"group,omitempty"` | ||
Url string `json:"url,omitempty"` | ||
Logo string `json:"logo,omitempty"` | ||
Epg string `json:"epg,omitempty"` | ||
Ua string `json:"ua,omitempty"` | ||
PlayerType int `json:"playerType,omitempty"` | ||
Channels []Channel `json:"channels,omitempty"` | ||
Groups []Group `json:"groups,omitempty"` | ||
Core Core `json:"core,omitempty"` | ||
Name string `json:"name,omitempty"` | ||
Type *int `json:"type"` | ||
Boot *bool `json:"boot,omitempty"` | ||
Pass *bool `json:"pass,omitempty"` | ||
Group string `json:"group,omitempty"` | ||
Url string `json:"url,omitempty"` | ||
Logo string `json:"logo,omitempty"` | ||
Epg string `json:"epg,omitempty"` | ||
Ua string `json:"ua,omitempty"` | ||
Click string `json:"click,omitempty"` | ||
Referer string `json:"referer,omitempty"` | ||
Timeout *int `json:"timeout,omitempty"` | ||
Header interface{} `json:"header,omitempty"` | ||
PlayerType *int `json:"playerType,omitempty"` | ||
Channels []Channel `json:"channels,omitempty"` | ||
Groups []Group `json:"groups,omitempty"` | ||
Core *Core `json:"core,omitempty"` | ||
} | ||
|
||
func (l *Live) UnmarshalJSON(data []byte) error { | ||
type TempLive Live | ||
lr := struct { | ||
*TempLive | ||
Type interface{} `json:"type"` | ||
PlayerType interface{} `json:"playerType,omitempty"` | ||
Boot interface{} `json:"boot,omitempty"` | ||
}{ | ||
TempLive: (*TempLive)(l), | ||
} | ||
if err := json.Unmarshal(data, &lr); err != nil { | ||
global.Logger.Error(string(data), zap.Error(err)) | ||
} | ||
l.Type = cast.ToInt(lr.Type) | ||
l.PlayerType = cast.ToInt(lr.PlayerType) | ||
switch lr.Boot.(type) { | ||
case bool: | ||
l.Boot = lr.Boot.(bool) | ||
case string: | ||
boolValue, err := strconv.ParseBool(lr.Boot.(string)) | ||
if err != nil { | ||
global.Logger.Error(lr.Boot.(string), zap.Error(err)) | ||
} | ||
l.Boot = boolValue | ||
default: | ||
l.Boot = false | ||
if cast.ToInt(lr.Boot) > 0 { | ||
l.Boot = true | ||
} | ||
} | ||
return nil | ||
} | ||
//func (l *Live) UnmarshalJSON(data []byte) error { | ||
// type TempLive Live | ||
// lr := struct { | ||
// *TempLive | ||
// Type interface{} `json:"type"` | ||
// PlayerType interface{} `json:"playerType,omitempty"` | ||
// Boot interface{} `json:"boot,omitempty"` | ||
// }{ | ||
// TempLive: (*TempLive)(l), | ||
// } | ||
// if err := json.Unmarshal(data, &lr); err != nil { | ||
// global.Logger.Error(string(data), zap.Error(err)) | ||
// } | ||
// l.Type = cast.ToInt(lr.Type) | ||
// l.PlayerType = cast.ToInt(lr.PlayerType) | ||
// switch lr.Boot.(type) { | ||
// case bool: | ||
// l.Boot = lr.Boot.(bool) | ||
// case string: | ||
// boolValue, err := strconv.ParseBool(lr.Boot.(string)) | ||
// if err != nil { | ||
// global.Logger.Error(lr.Boot.(string), zap.Error(err)) | ||
// } | ||
// l.Boot = boolValue | ||
// default: | ||
// l.Boot = false | ||
// if cast.ToInt(lr.Boot) > 0 { | ||
// l.Boot = true | ||
// } | ||
// } | ||
// return nil | ||
//} |
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 |
---|---|---|
@@ -1,36 +1,28 @@ | ||
package common | ||
|
||
import ( | ||
"TVHelper/global" | ||
"encoding/json" | ||
|
||
"github.com/spf13/cast" | ||
"go.uber.org/zap" | ||
) | ||
|
||
type Parse struct { | ||
Name string `json:"name,omitempty"` | ||
Type int `json:"type,omitempty"` | ||
Type *int `json:"type,omitempty"` | ||
Url string `json:"url,omitempty"` | ||
Ext Ext `json:"ext,omitempty"` | ||
Ext *Ext `json:"ext,omitempty"` | ||
} | ||
|
||
type Ext struct { | ||
Flag []string `json:"flag,omitempty"` | ||
Header interface{} `json:"header,omitempty"` | ||
} | ||
|
||
func (p *Parse) UnmarshalJSON(data []byte) error { | ||
type TempParse Parse | ||
pr := struct { | ||
*TempParse | ||
Type interface{} `json:"type,omitempty"` | ||
}{ | ||
TempParse: (*TempParse)(p), | ||
} | ||
if err := json.Unmarshal(data, &pr); err != nil { | ||
global.Logger.Error(string(data), zap.Error(err)) | ||
} | ||
p.Type = cast.ToInt(pr.Type) | ||
return nil | ||
} | ||
//func (p *Parse) UnmarshalJSON(data []byte) error { | ||
// type TempParse Parse | ||
// pr := struct { | ||
// *TempParse | ||
// Type interface{} `json:"type,omitempty"` | ||
// }{ | ||
// TempParse: (*TempParse)(p), | ||
// } | ||
// if err := json.Unmarshal(data, &pr); err != nil { | ||
// global.Logger.Error(string(data), zap.Error(err)) | ||
// } | ||
// p.Type = cast.ToInt(pr.Type) | ||
// return nil | ||
//} |
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,8 @@ | ||
package common | ||
|
||
type Rule struct { | ||
Name string `json:"name,omitempty"` | ||
Hosts []string `json:"hosts,omitempty"` | ||
Regex []string `json:"regex,omitempty"` | ||
Script []string `json:"script,omitempty"` | ||
} |
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 |
---|---|---|
@@ -1,47 +1,46 @@ | ||
package common | ||
|
||
import ( | ||
"TVHelper/global" | ||
"encoding/json" | ||
|
||
"github.com/spf13/cast" | ||
"go.uber.org/zap" | ||
) | ||
|
||
type Site struct { | ||
Key string `json:"key,omitempty"` | ||
Name string `json:"name,omitempty"` | ||
Type int `json:"type,omitempty"` | ||
Api string `json:"api,omitempty"` | ||
PlayUrl string `json:"playUrl,omitempty"` | ||
PlayerType int `json:"playerType,omitempty"` | ||
Searchable int `json:"searchable,omitempty"` | ||
Filterable int `json:"filterable,omitempty"` | ||
Changeable int `json:"changeable,omitempty"` | ||
Ext string `json:"ext,omitempty"` | ||
Jar string `json:"jar,omitempty"` | ||
Categories []string `json:"categories,omitempty"` | ||
Key string `json:"key,omitempty"` | ||
Name string `json:"name,omitempty"` | ||
Api string `json:"api,omitempty"` | ||
Ext interface{} `json:"ext,omitempty"` | ||
Jar string `json:"jar,omitempty"` | ||
Click string `json:"click,omitempty"` | ||
PlayUrl string `json:"playUrl,omitempty"` | ||
Type *int `json:"type,omitempty"` | ||
Timeout *int `json:"timeout,omitempty"` | ||
PlayerType *int `json:"playerType,omitempty"` | ||
Searchable *int `json:"searchable,omitempty"` | ||
Changeable *int `json:"changeable,omitempty"` | ||
Recordable *int `json:"recordable,omitempty"` | ||
Categories []string `json:"categories,omitempty"` | ||
Header interface{} `json:"header,omitempty"` | ||
Style *Style `json:"style,omitempty"` | ||
ViewType interface{} `json:"viewType,omitempty"` | ||
} | ||
|
||
func (s *Site) UnmarshalJSON(data []byte) error { | ||
type TempSite Site | ||
sr := struct { | ||
*TempSite | ||
Type interface{} `json:"type,omitempty"` | ||
PlayerType interface{} `json:"playerType,omitempty"` | ||
Searchable interface{} `json:"searchable,omitempty"` | ||
Filterable interface{} `json:"filterable,omitempty"` | ||
Changeable interface{} `json:"changeable,omitempty"` | ||
}{ | ||
TempSite: (*TempSite)(s), | ||
} | ||
if err := json.Unmarshal(data, &sr); err != nil { | ||
global.Logger.Error(string(data), zap.Error(err)) | ||
} | ||
s.Type = cast.ToInt(sr.Type) | ||
s.PlayerType = cast.ToInt(sr.PlayerType) | ||
s.Searchable = cast.ToInt(sr.Searchable) | ||
s.Filterable = cast.ToInt(sr.Filterable) | ||
s.Changeable = cast.ToInt(sr.Changeable) | ||
return nil | ||
} | ||
//func (s *Site) UnmarshalJSON(data []byte) error { | ||
// type TempSite Site | ||
// sr := struct { | ||
// *TempSite | ||
// Type interface{} `json:"type,omitempty"` | ||
// Timeout interface{} `json:"timeout,omitempty"` | ||
// PlayerType interface{} `json:"playerType,omitempty"` | ||
// Searchable interface{} `json:"searchable,omitempty"` | ||
// Changeable interface{} `json:"changeable,omitempty"` | ||
// Recordable interface{} `json:"recordable,omitempty"` | ||
// }{ | ||
// TempSite: (*TempSite)(s), | ||
// } | ||
// if err := json.Unmarshal(data, &sr); err != nil { | ||
// global.Logger.Error(string(data), zap.Error(err)) | ||
// } | ||
// s.Type = cast.ToInt(sr.Type) | ||
// s.Timeout = cast.ToInt(sr.Timeout) | ||
// s.PlayerType = cast.ToInt(sr.PlayerType) | ||
// s.Searchable = cast.ToInt(sr.Searchable) | ||
// s.Changeable = cast.ToInt(sr.Changeable) | ||
// s.Recordable = cast.ToInt(sr.Recordable) | ||
// return nil | ||
//} |
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,6 @@ | ||
package common | ||
|
||
type Style struct { | ||
Type string `json:"type,omitempty"` | ||
Ratio *float32 `json:"ratio,omitempty"` | ||
} |
Oops, something went wrong.