Skip to content

LeoYeAI/agent-master-skills / skills/1688-product-to-ozon

1688-Product-to-Ozon

Verified

将1688的商品铺货到俄罗斯电商平台Ozon(上架),通过Ozon官方API实现商品信息的上传和状态查询。适用于需要将单个1688的商品上架到Ozon的场景。

scripts/batch_translate.py

View on GitHub
#!/usr/bin/env python3
import sys, os, json, time
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from translate_images import translate_image

urls = [
    'https://cbu01.alicdn.com/img/ibank/O1CN0109gRVx1zPrBVAmA6p_!!1741586707-0-cib.jpg',
    'https://cbu01.alicdn.com/img/ibank/O1CN01K6soO11zPrSIDwxDA_!!1741586707-0-cib.jpg',
    'https://cbu01.alicdn.com/img/ibank/O1CN01FPl3Ww1zPrBZrq6Qt_!!1741586707-0-cib.jpg',
    'https://cbu01.alicdn.com/img/ibank/O1CN01Fo2kfn1zPrSDKGyfp_!!1741586707-0-cib.jpg',
    'https://cbu01.alicdn.com/img/ibank/O1CN01mn8R421zPrBZrpMgp_!!1741586707-0-cib.jpg',
    'https://cbu01.alicdn.com/img/ibank/O1CN0128EvSg1zPrBTQA6h4_!!1741586707-0-cib.jpg',
    'https://cbu01.alicdn.com/img/ibank/O1CN01rSlKS41zPrBOldjcv_!!1741586707-0-cib.jpg',
    'https://cbu01.alicdn.com/img/ibank/O1CN01NtcwD91zPrBXrFHQA_!!1741586707-0-cib.jpg',
    'https://cbu01.alicdn.com/img/ibank/O1CN01YDv2CS1zPrBR0gXFI_!!1741586707-0-cib.jpg',
    'https://cbu01.alicdn.com/img/ibank/O1CN01FXDAa91zPrBTIuEYo_!!1741586707-0-cib.jpg',
    'https://cbu01.alicdn.com/img/ibank/O1CN013hqQWq1zPrGIuflsk_!!1741586707-0-cib.jpg',
    'https://cbu01.alicdn.com/img/ibank/O1CN01UNFELq1zPrBbtYLSc_!!1741586707-0-cib.jpg',
    'https://cbu01.alicdn.com/img/ibank/O1CN01utZt1W1zPrRZQcrQH_!!1741586707-0-cib.jpg',
    'https://cbu01.alicdn.com/img/ibank/O1CN01XT6mBF1EPbJJqGnya_!!2208893230344-0-cib.jpg',
    'https://cbu01.alicdn.com/img/ibank/O1CN01yLeygD1EPbJOlW87Z_!!2208893230344-0-cib.jpg',
    'https://cbu01.alicdn.com/img/ibank/O1CN0127eQmd1EPbJQWO5e4_!!2208893230344-0-cib.jpg',
    'https://cbu01.alicdn.com/img/ibank/O1CN01pUTHHG1EPbJREDKSL_!!2208893230344-0-cib.jpg',
    'https://cbu01.alicdn.com/img/ibank/O1CN01tCd6TV1EPbJJqLu8a_!!2208893230344-0-cib.jpg',
    'https://cbu01.alicdn.com/img/ibank/O1CN01wEiMEP1EPbJPqhUSP_!!2208893230344-0-cib.jpg',
]

results = {}
for i, url in enumerate(urls):
    start = time.time()
    try:
        r = translate_image(url)
        elapsed = time.time() - start
        translated = url  # fallback
        if 'result' in r and 'result' in r['result']:
            t = r['result']['result'].get('translatedImageUrl', '')
            if t:
                translated = t
        results[url] = translated
        print(f'[{i+1}/{len(urls)}] {elapsed:.1f}s OK', flush=True)
    except Exception as e:
        results[url] = url
        print(f'[{i+1}/{len(urls)}] ERROR: {e}', flush=True)

# Save to file
with open('translated_urls.json', 'w') as f:
    json.dump(results, f, ensure_ascii=False, indent=2)
print('DONE - saved to translated_urls.json', flush=True)
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 implementationStars: 323kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 323kUpdated Claude CodeCodexVerifiedInstall
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 fallbackStars: 323kUpdated Claude CodeCodexVerifiedInstall
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 alwaysStars: 323kUpdated Claude CodeCodexVerifiedInstall