Add check if there are any Products for given productId.
This commit is contained in:
parent
4b8d80aafa
commit
4521e085c4
1 changed files with 7 additions and 2 deletions
5
run.py
5
run.py
|
@ -15,9 +15,13 @@ def get_game_name(pid: str) -> str:
|
|||
|
||||
if req.status_code == 200:
|
||||
j = req.json()
|
||||
|
||||
if j['Products']:
|
||||
return j['Products'][0]['LocalizedProperties'][0]['ProductTitle']
|
||||
else:
|
||||
return 'Unknown Title'
|
||||
else:
|
||||
return 'Error'
|
||||
|
||||
|
||||
def main():
|
||||
|
@ -31,6 +35,7 @@ def main():
|
|||
game = get_game_name(product_id)
|
||||
|
||||
print(f'\033[91m{clip}\033[97m is for product: \033[91m{game}\033[97m ContentID: \033[91m{content_id}\033[99m')
|
||||
break
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Add table
Reference in a new issue