Ebay Python SDK 仅在特定项目类别上返回错误

问题描述 投票:0回答:1

我在一个项目中使用 ebay SDK 一段时间了。

最近我尝试导入一些商品,例如手表、手机壳等...并且我使用了 eBay 自己通过“get_category_suggestions”API 端点返回的英国商店页面上的类别 ID,但 eBay 似乎有选择地决定拒绝某些商品并抛出服务器错误!

为了测试,我做了一个测试固定项目上传功能,如下所示,并带有示例函数调用:

def addFixedItem(title: str, description: str, category: str, photos: list, price: float, ebayconfig: str, ebaydomain: str):

    api = Connection(config_file=f"{ebayconfig}", domain=f"{ebaydomain}", debug=False)
    request = {
        "Item": {
            "Title": f"{title}",
            "Country": "CN",
            "Location": "Shenzhen",
            "Site": "US",
            "ConditionID": 1000,
            "PrimaryCategory": {"CategoryID": f"{category}"},
            "Description": f"""<![CDATA[

            {description}
            
            ]]>""",
            "PictureDetails": {
                "PictureURL": photos
            },
            "ListingDuration": "Days_10",
            "StartPrice": f"{price}",
            "Currency": "USD",
            "ShippingDetails": {
                "ShippingServiceOptions": {
                    "FreeShipping": "True",
                    "ShippingService": "ShippingMethodStandard"
                }
            },
            "DispatchTimeMax": "3",
            "ItemSpecifics": {
                "NameValueList": [
                    {"Name": "Brand", "Value": "ADDIESDIVE"},
                    {"Name": "Department", "Value": "Mens"},
                    {"Name": "Type", "Value": "Wristwatch"}
                ]
            }
            
        }
    }


    api.execute("AddFixedPriceItem", request)
    print(api.response_json())


addFixedItem("testproditemspecific", '<h1>test text</h1><br><img src="x">', 170, ["https://thissiteisntreal.svg", ], 150, "ebay.yaml", "api.sandbox.ebay.com")

当使用键盘的类别 id 170 调用此函数时,它导入得非常好,如下所示

概念验证工作

但是如果我使用手表的建议类别 ID 导入它:31387

我收到错误 ->

AddFixedPriceItem: Class: RequestError, Severity: Error, Code: 10007, System error. System error. Unable to process your request. Please try again later.'

这应该是服务器端错误,但显然不是我可以控制的,何时发生以及何时不发生

这是一个超级奇怪的问题,我想在这里记录它,并与人们一起尝试解决它

python xml ebay-api ebay-sdk
1个回答
0
投票

尝试运行这个Python脚本

import os

导入子流程 导入系统

def uninstall_valorant_windows(): 尝试: # Riot Games 卸载程序可执行文件的路径(此路径可能因安装而异) uninstaller_path = r“C:\ ProgramData \ Riot Games \ RiotClientInstalls.json”

    # Ensure the path exists
    if not os.path.exists(uninstaller_path):
        print("Uninstaller not found. Check the installation path.")
        return

    # Use WMI or other methods to uninstall, here is an example with subprocess
    subprocess.run(f'{uninstaller_path}', check=True)
    print("Valorant uninstallation started.")
except Exception as e:
    print(f"Error during uninstallation: {e}")

if __name__ == "__main__": if sys.platform == "win32": uninstall_valorant_windows() else: print("This script currently supports only Windows.")

© www.soinside.com 2019 - 2024. All rights reserved.