更新的代码:
import requests
from time import sleep
import webbrowser
from termcolor import colored
import locale
locale.setlocale(locale.LC_NUMERIC, '')
print(colored('Lowest Priced Limited\n---------------------\n', 'green'))
count = 0
while True:
lowestprice = 1234567890
for limited in requests.get('https://search.roblox.com/catalog/json?CatalogContext=1&Keyword=&SortType=0&SortAggregation=3&SortCurrency=0&LegendExpanded=true&Category=2&pageNumber=1').json():
price = locale.atof(limited['BestPrice'])
if price < lowestprice:
limitedname = limited['Name']
limitedurl = limited['AbsoluteUrl']
lowestprice = price
print(colored(f"{limitedname}: {lowestprice}\n{limitedurl}\n"))
sleep(1)
if lowestprice <= 220 and count == 0:
webbrowser.open(limitedurl, new=2)
count += 1
jeck猫
HUX布斯
相关分类