mirror of
https://codeberg.org/VnPower/PixivFE
synced 2024-12-06 19:16:23 +01:00
61 lines
1.7 KiB
Go
61 lines
1.7 KiB
Go
package core
|
|
|
|
import "fmt"
|
|
|
|
func GetNewestArtworksURL(worktype, r18, lastID string) string {
|
|
base := "https://www.pixiv.net/ajax/illust/new?limit=30&type=%s&r18=%s&lastId=%s"
|
|
return fmt.Sprintf(base, worktype, r18, lastID)
|
|
}
|
|
|
|
func GetDiscoveryURL(mode string, limit int) string {
|
|
base := "https://www.pixiv.net/ajax/discovery/artworks?mode=%s&limit=%d"
|
|
return fmt.Sprintf(base, mode, limit)
|
|
}
|
|
|
|
func GetRankingURL(mode, content, date, page string) string {
|
|
base := "https://www.pixiv.net/ranking.php?format=json&mode=%s&content=%s&date=%s&p=%s"
|
|
baseNoDate := "https://www.pixiv.net/ranking.php?format=json&mode=%s&content=%s&p=%s"
|
|
|
|
if date != "" {
|
|
return fmt.Sprintf(base, mode, content, date, page)
|
|
}
|
|
|
|
return fmt.Sprintf(baseNoDate, mode, content, page)
|
|
}
|
|
|
|
func GetRankingCalendarURL(mode string, year, month int) string {
|
|
base := "https://www.pixiv.net/ranking_log.php?mode=%s&date=%d%02d"
|
|
|
|
return fmt.Sprintf(base, mode, year, month)
|
|
}
|
|
|
|
func GetUserInformationURL(id string) string {
|
|
base := "https://www.pixiv.net/ajax/user/%s?full=1"
|
|
|
|
return fmt.Sprintf(base, id)
|
|
}
|
|
|
|
func GetUserArtworksURL(id string) string {
|
|
base := "https://www.pixiv.net/ajax/user/%s/profile/all"
|
|
|
|
return fmt.Sprintf(base, id)
|
|
}
|
|
|
|
func GetUserFullArtworkURL(id, ids string) string {
|
|
base := "https://www.pixiv.net/ajax/user/%s/profile/illusts?work_category=illustManga&is_first_page=0&lang=en%s"
|
|
|
|
return fmt.Sprintf(base, id, ids)
|
|
}
|
|
|
|
func GetUserBookmarksURL(id, mode string, page int) string {
|
|
base := "https://www.pixiv.net/ajax/user/%s/illusts/bookmarks?tag=&offset=%d&limit=48&rest=%s"
|
|
|
|
return fmt.Sprintf(base, id, page*48, mode)
|
|
}
|
|
|
|
func GetFrequentTagsURL(ids string) string {
|
|
base := "https://www.pixiv.net/ajax/tags/frequent/illust?%s"
|
|
|
|
return fmt.Sprintf(base, ids)
|
|
}
|