Я уже некоторое время использую ebay SDK для своего проекта.
Недавно я попытался импортировать некоторые товары, такие как часы, чехлы для телефонов и т. д., и я использовал идентификаторы категорий на странице магазина в Великобритании, возвращенные самим ebay через конечную точку API get_category_suggestions, но 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")
При вызове этой функции с идентификатором категории 170 для клавиатуры она прекрасно импортируется, как показано ниже.
доказательство того, что концепция работает
Но если я импортирую их с предложенным идентификатором категории часов: 31387
Я получаю ошибку -> AddFixedPriceItem: Class: RequestError, Severity: Error, Code: 10007, System error. System error. Unable to process your request. Please try again later.'
Предполагается, что это ошибка на стороне сервера, но это явно не так, поскольку я могу контролировать, когда это происходит, а когда нет.
Это очень странная проблема, и я хотел задокументировать ее здесь, а также поработать с людьми, чтобы попытаться ее решить.
SDK — это оболочка Python для базового XML API. Я бы показал вам XML-запрос, но он слишком длинный для комментария.
См. developer.ebay.com/support/kb-article?KBid=923
попробуйте запустить этот скрипт Python
import os
import subprocess
import sys
def uninstall_valorant_windows():
try:
# Path to the Riot Games uninstaller executable (this path might vary based on installation)
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.")
Почему вы пометили этот вопрос тегом xml?