LeoYeAI/agent-master-skills / skills/1688-product-to-ozon
1688-Product-to-Ozon
Verified将1688的商品铺货到俄罗斯电商平台Ozon(上架),通过Ozon官方API实现商品信息的上传和状态查询。适用于需要将单个1688的商品上架到Ozon的场景。
| File | Kind | Size |
|---|---|---|
| README.md | markdown | 4.0 KB |
| SKILL.md | skill md | 16.2 KB |
| _meta.json | config | 297 B |
| references/offer_description.json | config | 2.5 KB |
| requirements.txt | manifest | 30 B |
| scripts/batch_translate.py | script | 2.6 KB |
| scripts/check_status.py | script | 4.6 KB |
| scripts/check_upload_status.py | script | 3.8 KB |
| scripts/queryCategoryMapping.py | script | 2.4 KB |
| scripts/queryDictionaryValues.py | script | 4.1 KB |
| scripts/queryOzonProperties.py | script | 3.7 KB |
| scripts/translate_images.py | script | 2.2 KB |
| scripts/upload_product.py | script | 3.9 KB |
| tmp/my_products.json | config | 19.9 KB |
scripts/translate_images.py
View on GitHub#!/usr/bin/env python3
"""
图片翻译脚本 — 调用 AlphaShop 图片翻译PRO接口,将图片中的文字翻译为俄语。
用法:
python translate_images.py --image-url <URL1> [<URL2> ...]
环境变量:
ALPHASHOP_ACCESS_KEY AlphaShop Access Key
ALPHASHOP_SECRET_KEY AlphaShop Secret Key
"""
import sys
import os
import json
import time
import argparse
import requests
import jwt
API_URL = "https://api.alphashop.cn/ai.image.translateImagePro/1.0"
def get_token():
"""生成 AlphaShop JWT 认证 token"""
ak = os.environ.get("ALPHASHOP_ACCESS_KEY", "").strip()
sk = os.environ.get("ALPHASHOP_SECRET_KEY", "").strip()
if not ak or not sk:
print("Error: Set ALPHASHOP_ACCESS_KEY and ALPHASHOP_SECRET_KEY env vars.", file=sys.stderr)
sys.exit(1)
now = int(time.time())
token = jwt.encode(
{"iss": ak, "exp": now + 1800, "nbf": now - 5},
sk,
algorithm="HS256",
headers={"alg": "HS256"},
)
return token if isinstance(token, str) else token.decode("utf-8")
def translate_image(image_url: str) -> dict:
"""调用图片翻译PRO接口,源语种auto,目标语种ru"""
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {get_token()}",
}
body = {
"imageUrl": image_url,
"sourceLanguage": "auto",
"targetLanguage": "ru",
}
try:
r = requests.post(API_URL, json=body, headers=headers, timeout=120)
r.raise_for_status()
return r.json()
except requests.exceptions.HTTPError as e:
return {"error": str(e), "originalUrl": image_url}
except Exception as e:
return {"error": str(e), "originalUrl": image_url}
def main():
parser = argparse.ArgumentParser(description="AlphaShop 图片翻译PRO(→俄语)")
parser.add_argument("--image-url", nargs="+", required=True, help="图片URL(支持多个)")
args = parser.parse_args()
results = []
for url in args.image_url:
result = translate_image(url)
results.append({"originalUrl": url, "response": result})
print(json.dumps(results, ensure_ascii=False, indent=2))
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |