Documentation
¶
Index ¶
- Constants
- Variables
- func BuildApiHeaders(t time.Time) map[string]string
- func BuildCoverUrl(comicId int) string
- func BuildImageHeaders() map[string]string
- func BuildImageUrl(chapterId int, imageName string) string
- func CalcNumParts(chapterId int, imageName string) (numParts int)
- func DescrambleImage(imgData []byte, num int) (_ []byte, err error)
- func DoApi(req *http.Request, t time.Time) ([]byte, error)
- func DownloadComicIter(ctx context.Context, chapter *Chapter) iter.Seq2[Image, error]
- func DownloadCover(ctx context.Context, comicId int) ([]byte, error)
- func DownloadCoversIter(ctx context.Context, search *SearchResp) iter.Seq2[Image, error]
- func Get(ctx context.Context, url string) (_ []byte, _ *http.Response, err error)
- func GetApi(ctx context.Context, url string) ([]byte, error)
- func PostApi(ctx context.Context, url string, data io.Reader) ([]byte, error)
- func SetThreads(n int)
- func SetUseEnvProxy(b bool)
- type Album
- type ApiResponse
- type Chapter
- type ComicBasic
- type ComicBasicCategory
- type Error
- type Image
- type ImageType
- type SearchResp
- type Serie
- type Server
- type Setting
- type SettingAppShunt
Constants ¶
View Source
const ( DEFAULT_IMAGE_URL = "https://cdn-msp.jmapinodeudzn.net" DEFAULT_USER_AGENTS = "" /* 127-byte string literal not displayed */ VERSION = "2.0.1" )
View Source
const ( API_SETTING = "/setting" API_SEARCH = "/search" API_ALBUM = "/album" API_CHAPTER = "/chapter" )
View Source
const ( API_SECRET_REQ = "18comicAPPContent" // combine with timestamp API_SECRET_RESP = "185Hcomic3PAPP7R" // combine with timestamp SVR_SECRET = "diosfjckwpqpdfjkvnqQjsik" )
View Source
const DOWNLOAD_TYPE_COVER = "<COVER>"
View Source
const NEW_SERVER_URL = "https://rup4a04-c02.tos-cn-hongkong.bytepluses.com/newsvr-2025.txt"
Variables ¶
View Source
var ( ImageUrl = DEFAULT_IMAGE_URL UserAgent = DEFAULT_USER_AGENTS ApiHost = constant.ApiHosts[0] // TODO: 轮换 )
Functions ¶
func BuildCoverUrl ¶
func BuildImageHeaders ¶
func BuildImageUrl ¶
func CalcNumParts ¶
CalcNumParts 计算混淆分块数
func DescrambleImage ¶
DescrambleImage 反混淆图片
func DownloadComicIter ¶
func DownloadCoversIter ¶
Types ¶
type Album ¶
type Album struct {
Id int `json:"id"`
Name string `json:"name"`
Images []string `json:"images"` // empty
Addtime string `json:"addtime"` // timestamp (second)
Description string `json:"description"` // ""
TotalViews int `json:"total_views"`
Likes int `json:"likes"`
Series []Serie `json:"series"` // empty when single
SeriesId string `json:"series_id"` // single: "0" || multi: == .Id
CommentTotal int `json:"comment_total"`
Author []string `json:"author"`
Tags []string `json:"tags"`
Works []string `json:"works"` // 作品 // "公主连结"
Actors []string `json:"actors"` // 人物 // "贪吃佩可"
RelatedList []struct {
Id string `json:"id"`
Author string `json:"author"`
Name string `json:"name"`
Images []string `json:"images"` // ""
} `json:"related_list"`
Liked bool `json:"liked"`
IsFavorite bool `json:"is_favorite"`
IsAids bool `json:"is_aids"`
Price string `json:"price"` // ""
Purchased string `json:"purchased"` // ""
}
type ApiResponse ¶
type Chapter ¶
type Chapter struct {
Id int `json:"id"`
Series []Serie `json:"series"`
Tags string `json:"tags"` // space separated list, empty after series[0]
Name string `json:"name"`
Images []string `json:"images"` // "00001.webp"
Addtime string `json:"addtime"` // timestamp (second)
SeriesId int `json:"series_id"`
IsFavorite bool `json:"is_favorite"`
Liked bool `json:"liked"`
}
type ComicBasic ¶
type ComicBasic struct {
Id string `json:"id"`
Author string `json:"author"`
Description string `json:"description"` // null
Name string `json:"name"`
Image string `json:"image"` // ""
Category ComicBasicCategory `json:"category"`
CategorySub ComicBasicCategory `json:"category_sub"`
Liked bool `json:"liked"`
IsFavorite bool `json:"is_favorite"`
}
type ComicBasicCategory ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error 附带了更详细的信息
jmErr := JmComic.UnwarpErr(err) isXxx := jmErr.Is(JmComic.ErrXXX)
-
type Image ¶
type SearchResp ¶
type SearchResp struct {
SearchQuery string `json:"search_query"`
Total int `json:"total"`
Content []ComicBasic `json:"content"`
}
type Server ¶
type Setting ¶
type Setting struct {
Version string `json:"version"` // "1.8.2"
TestVersion string `json:"test_version"` // "1.8.2"
StoreLink string `json:"store_link"`
IosVersion string `json:"ios_version"` // "1.8.2"
IosTestVersion string `json:"ios_test_version"` // "1.8.2"
IosStoreLink string `json:"ios_store_link"`
Jm3Version string `json:"jm3_version"` // "2.0.12"
Jm3TestVersion string `json:"jm3_test_version"` // "2.0.12"
Jm3StoreLink string `json:"jm3_store_link"`
Jm3IOSVersion string `json:"jm3_ios_version"` // "1.0.0"
Jm3IOSTestVersion string `json:"jm3_ios_test_version"` // "1.0.0"
Jm3DownloadUrl string `json:"jm3_download_url"`
IpCountry string `json:"ipcountry"` // "CA"
NewYearEvent bool `json:"newYearEvent"`
AdCacheVersion int `json:"ad_cache_version"`
BundleUrl string `json:"bundle_url"`
DownloadUrl string `json:"download_url"`
AppLandingPage string `json:"app_landing_page"`
VersionInfo string `json:"version_info"`
Jm3IsHotUpdate bool `json:"jm3_is_hot_update"`
Jm3VersionInfo string `json:"jm3_version_info"`
IsHotUpdate bool `json:"is_hot_update"`
BaseUrl string `json:"base_url"` // "https://www.cdnaspa.vip"
DonateUrl string `json:"donate_url"`
MainWebHost string `json:"main_web_host"`
// "https://tencent.jmdanjonproxy.xyz" | "https://cdn-msp.jmdanjonproxy.xyz"
ImgHost string `json:"img_host"`
// "https://tencent.jmdanjonproxy.xyz/media/logo/channel_log.png?v=" | "cdn-msp"
ApiBannerPath string `json:"api_banner_path"`
// "https://tencent.jmdanjonproxy.xyz/media/logo/new_logo.png" | "cdn-msp"
LogoPath string `json:"logo_path"`
FloatAd bool `json:"float_ad"`
IsCn int `json:"is_cn"`
CnBaseURL string `json:"cn_base_url"` // "https://www.cdnaspa.vip"
AppShunts []SettingAppShunt `json:"app_shunts"`
FoolsDayEvent bool `json:"foolsDayEvent"`
}
type SettingAppShunt ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.