mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-24 23:41:10 +02:00
feat(walmart): add billing units and rate config
This commit is contained in:
parent
32bb099025
commit
0d2c8df5bd
3 changed files with 12 additions and 0 deletions
|
|
@ -41,6 +41,8 @@ _PLATFORM_RATE_KEYS: dict[BillingUnit, str] = {
|
|||
BillingUnit.TIKTOK_VIDEO: "TIKTOK_MICROS_PER_VIDEO",
|
||||
BillingUnit.TIKTOK_USER: "TIKTOK_MICROS_PER_USER",
|
||||
BillingUnit.TIKTOK_COMMENT: "TIKTOK_MICROS_PER_COMMENT",
|
||||
BillingUnit.WALMART_PRODUCT: "WALMART_MICROS_PER_PRODUCT",
|
||||
BillingUnit.WALMART_REVIEW: "WALMART_MICROS_PER_REVIEW",
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -63,6 +65,8 @@ _UNIT_NOUNS: dict[BillingUnit, str] = {
|
|||
BillingUnit.TIKTOK_VIDEO: "video",
|
||||
BillingUnit.TIKTOK_USER: "profile",
|
||||
BillingUnit.TIKTOK_COMMENT: "comment",
|
||||
BillingUnit.WALMART_PRODUCT: "product",
|
||||
BillingUnit.WALMART_REVIEW: "review",
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ class BillingUnit(StrEnum):
|
|||
TIKTOK_VIDEO = "tiktok_video"
|
||||
TIKTOK_USER = "tiktok_user"
|
||||
TIKTOK_COMMENT = "tiktok_comment"
|
||||
WALMART_PRODUCT = "walmart_product"
|
||||
WALMART_REVIEW = "walmart_review"
|
||||
|
||||
|
||||
class BillableInput(Protocol):
|
||||
|
|
|
|||
|
|
@ -736,6 +736,12 @@ class Config:
|
|||
# Comments are the cheapest per-item TikTok data, matching the per-comment
|
||||
# market (and YouTube's comment meter).
|
||||
TIKTOK_MICROS_PER_COMMENT = int(os.getenv("TIKTOK_MICROS_PER_COMMENT", "1500"))
|
||||
# Walmart products come from server-rendered JSON behind residential proxies,
|
||||
# priced alongside Amazon's per-product meter.
|
||||
WALMART_MICROS_PER_PRODUCT = int(os.getenv("WALMART_MICROS_PER_PRODUCT", "3500"))
|
||||
# Reviews are 10 per page (many light requests per product), priced on the
|
||||
# cheaper per-review market like the Google Maps review meter.
|
||||
WALMART_MICROS_PER_REVIEW = int(os.getenv("WALMART_MICROS_PER_REVIEW", "1500"))
|
||||
# Retry an empty listing draw on a fresh rotating IP. Set to 1 for a static
|
||||
# proxy, where every retry re-hits the same exit.
|
||||
TIKTOK_LISTING_MAX_ATTEMPTS = int(os.getenv("TIKTOK_LISTING_MAX_ATTEMPTS", "3"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue