52 lines
2.9 KiB
Markdown
52 lines
2.9 KiB
Markdown
# t5de-importer
|
|
|
|
Imports IMVU products into a T5DE catalog, with their creators' permission. Creators grant a catalog leave to import
|
|
their shop (or chosen products) on T5DE's hub; the hub queues the products, and this program, run beside the
|
|
catalog ([t5de-catalog](https://git.t5de.dev/t5de/t5de-catalog)), fetches each one from IMVU's CDN, converts it to a
|
|
T5 product and uploads it to the catalog. The design is t5de-hub's
|
|
[docs/imports.md](https://git.t5de.dev/t5de/t5de-hub/src/branch/main/docs/imports.md).
|
|
|
|
Unofficial: not made by or affiliated with IMVU.
|
|
|
|
## Running it
|
|
|
|
Turn imports on for the catalog on the hub's console (the catalog's Imports page): it shows the importer key once.
|
|
Then run the importer with:
|
|
|
|
| Variable | |
|
|
| --- | --- |
|
|
| `HUB_URL` | the hub's API, e.g. `https://api.t5de.dev` |
|
|
| `CATALOG_ID` | the catalog's ID on the hub |
|
|
| `IMPORTER_KEY` | the importer key |
|
|
| `IMPORTER_DATA` | its folder (default `./data`; `/data` in the image): its key pair and the IMVU accounts' passwords |
|
|
|
|
```
|
|
docker run -v importer-data:/data -e HUB_URL=https://api.t5de.dev -e CATALOG_ID=... -e IMPORTER_KEY=... \
|
|
git.t5de.dev/t5de/t5de-importer:latest
|
|
```
|
|
|
|
Everything else is set on the console: pausing, how many requests a second it makes to IMVU, how many products it
|
|
imports at once, and the IMVU accounts it may use. Keep `IMPORTER_DATA`: a new key pair (a new install) means the
|
|
accounts' passwords must be entered again.
|
|
|
|
## What it does
|
|
|
|
- Says hello to the hub with its version and public key (RSA 3072, made on first start). The catalog's team seals
|
|
IMVU account passwords for that key in their browser; the hub never holds them readable, and drops its copy once
|
|
the importer has it.
|
|
- Polls its config every minute and claims jobs (each an IMVU product to import or re-check).
|
|
- For each job, finds the product's newest revision on IMVU's CDN (probing revision numbers after the last one
|
|
imported), downloads its CFL, swaps the placeholder textures for the originals, drops `_contents.json`, sets
|
|
`ProductRating` from IMVU's rating, checks the result by t5de-api's `pack` rules, and uploads it to the catalog
|
|
with a one-off import token; the catalog registers it with the hub. The parent product stays on IMVU.
|
|
- Signs in to IMVU with the first of the console's accounts that IMVU takes (reporting each refusal, and whether
|
|
the account has Access Pass, which IMVU shows the account alone), and keeps the session in `IMPORTER_DATA` so a
|
|
restart doesn't sign in again; a refused account isn't tried again for an hour unless its password changes.
|
|
- With an Access Pass account, it imports Access Pass products, which IMVU hides from the signed out: it lists
|
|
whole shops signed in for the hub (`list` jobs), and looks up a job's product the hub can't see before importing
|
|
it.
|
|
|
|
## Development
|
|
|
|
`go test ./...` (tests fake the hub, the catalog and IMVU's CDN; product files are made in code, never IMVU's).
|