feat: sign in to IMVU for Access Pass products
CI / build (pull_request) Successful in 21s
CI / image (pull_request) Skipped
Pull request / title (pull_request) Successful in 1s

The importer signs in with the first of the console's accounts that IMVU takes, reports refusals and whether the
account has Access Pass, and keeps the session so restarts don't sign in again. With it, it lists whole shops
signed in for the hub ("list" jobs) and looks up products the hub can't see before importing them, so Access Pass
products import too. IMVU's sign-in works only with a desktop browser's User-Agent, which signed-in requests send.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
dhkatzandClaude Opus 5.5 committed 2026-11-08 07:39:02 -08:00
1 parent dd8205602c
commit 7dfbeb5ba3
11 files changed
+1001 -24

No files matched your search

+46 -2
View File
@@ -70,15 +70,59 @@ type Config struct {
Accounts []Account `json:"accounts"`
}
// Job is a claimed import job. Rating is IMVU's ("general", "adult"), or "" when the hub couldn't see it.
// Job is a claimed job. Rating is IMVU's ("general", "adult"), or "" when IMVU hides the product from the hub.
type Job struct {
ID string `json:"id"`
Kind string `json:"kind"` // "import" or "recheck"
Kind string `json:"kind"` // "import", "recheck", or "list" (a whole shop, signed in)
IMVUProduct int64 `json:"imvuProduct"`
IMVUCreator int64 `json:"imvuCreator"` // a "list" job's shop
LastRevision int `json:"lastRevision"` // the newest IMVU revision imported already, or 0
Rating string `json:"rating"`
}
// Seen is a product as the importer's IMVU account sees it.
type Seen struct {
ID int64 `json:"id"`
Name string `json:"name"`
Rating string `json:"rating"`
CreatorID int64 `json:"creatorId"`
CreatorName string `json:"creatorName"`
Purchasable bool `json:"purchasable"`
}
// Listing reports a "list" job's shop, as the importer's account lists it; the hub keeps and queues its products.
func (c *Client) Listing(ctx context.Context, job string, products []Seen) (listed, queued int, err error) {
if products == nil {
products = []Seen{}
}
var r struct {
Listed int `json:"listed"`
Queued int `json:"queued"`
}
err = c.do(ctx, http.MethodPost, "/api/v1/importer/jobs/"+url.PathEscape(job)+"/listing", map[string]any{"products": products}, &r)
return r.Listed, r.Queued, err
}
// Info reports a job's product as the importer's account sees it (nil: not at all). The hub answers its rating
// (now known, "" if not) and whether the job's grant covers it.
func (c *Client) Info(ctx context.Context, job string, p *Seen) (rating string, covered bool, err error) {
body := map[string]any{"found": false}
if p != nil {
body = map[string]any{"found": true, "name": p.Name, "rating": p.Rating, "creatorId": p.CreatorID, "creatorName": p.CreatorName, "purchasable": p.Purchasable}
}
var r struct {
Rating *string `json:"rating"`
Covered bool `json:"covered"`
}
if err := c.do(ctx, http.MethodPost, "/api/v1/importer/jobs/"+url.PathEscape(job)+"/info", body, &r); err != nil {
return "", false, err
}
if r.Rating != nil {
rating = *r.Rating
}
return rating, r.Covered, nil
}
// Hello sends the importer's version and public key (base64 SPKI) and returns its config.
func (c *Client) Hello(ctx context.Context, version, publicKey string) (*Config, error) {
var cfg Config