示例#1
0
文件: urls.go 项目: if1live/haru
func FeedURL(p ListParams) string {
	language := p.Language
	if len(language) == 0 {
		language = "all"
	}

	if p.Category != "" {
		tpl := "https://hitomi.la/%s/%s-%s.atom"
		value := common.UrlEncode(p.Value)
		return fmt.Sprintf(tpl, p.Category, value, language)
	}

	return fmt.Sprintf("https://hitomi.la/index-%s.atom", language)
}
示例#2
0
文件: urls.go 项目: if1live/haru
func ListURL(params ListParams) string {
	language := params.Language
	if len(language) == 0 {
		language = "all"
	}

	page := params.PageNum()
	if params.Category != "" {
		tpl := "https://hitomi.la/%s/%s-%s-%d.html"
		value := common.UrlEncode(params.Value)
		return fmt.Sprintf(tpl, params.Category, value, language, page)
	}

	return fmt.Sprintf("https://hitomi.la/index-%s-%d.html", language, page)
}