Main.py 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. import requests
  2. import json
  3. import time
  4. import datetime
  5. # ----------------------------------------------------------------- #
  6. keyword = "aaaa"
  7. exactMatch = False
  8. groupCount = 100 # 10, 25, 50, 100
  9. howManyCycles = 100
  10. delayTime = 5
  11. groupMaxMembers = 30
  12. groupHasFunds = False
  13. publicGroup = True
  14. saveInFile = True
  15. # ----------------------------------------------------------------- #
  16. url = "https://groups.rprxy.xyz/v1/groups/search?keyword=" + keyword + "&prioritizeExactMatch=" + str(
  17. exactMatch).lower() + "&limit=" + str(groupCount)
  18. # fundsUrl = "https://economy.roblox.com/v1/groups/GROUP/currency"
  19. foundGroups = []
  20. groupIdList = []
  21. nextPageCursor = ""
  22. for cycle in range(0, howManyCycles):
  23. print("Cycle number: " + str(cycle))
  24. print("Percentage: " + str(int((cycle / howManyCycles) * 1000) / 10) + "%")
  25. requestData = requests.get(url + "&cursor=")
  26. # print(requestData.json())
  27. dataTable = json.loads(requestData.content)
  28. if nextPageCursor == "end":
  29. break
  30. try:
  31. nextPageCursor = dataTable["nextPageCursor"]
  32. except:
  33. nextPageCursor = "end"
  34. for group in dataTable["data"]:
  35. valid = True
  36. if group["memberCount"] > groupMaxMembers:
  37. valid = False
  38. if publicGroup and not group["publicEntryAllowed"]:
  39. valid = False
  40. if groupHasFunds:
  41. fundsUrl = "https://economy.rprxy.xyz/v1/groups/" + str(group["id"]) + "/currency"
  42. economyData = requests.get(fundsUrl)
  43. economyJSON = json.loads(economyData.content)
  44. try:
  45. if economyJSON["robux"] == 0:
  46. valid = False
  47. except:
  48. valid = False
  49. if valid:
  50. print("Found valid group " + str(group["id"]))
  51. # group["description"] = ""
  52. # group["name"] = ""
  53. foundGroups.append(group)
  54. groupIdList.append(group["id"])
  55. # else:
  56. # print("Invalid group")
  57. time.sleep(delayTime)
  58. if foundGroups.__len__() > 0 and saveInFile:
  59. thisTime = datetime.datetime.today()
  60. fileTime = str(thisTime.year) + "-" + str(thisTime.month) + "-" + str(thisTime.day) + "_" + str(
  61. thisTime.hour) + "-" + str(thisTime.minute) + "-" + str(thisTime.second)
  62. with open("./run/foundGroups_" + fileTime + ".txt", "w", encoding='utf-8') as groupFile:
  63. for line in foundGroups:
  64. groupFile.write(line.__str__())
  65. groupFile.write("\n")
  66. # groupFile.close()
  67. with open("./run/foundGroupIds" + fileTime + ".txt", "w", encoding='utf-8') as groupIdFile:
  68. for line in groupIdList:
  69. groupIdFile.write(str(line))
  70. print(str(line))
  71. groupIdFile.write("\n")
  72. # groupIdFile.close()
  73. print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nSEARCH COMPLETE")
  74. print("Found groups: " + str(foundGroups.__len__()))
  75. print(foundGroups)
  76. print("\nFound group ids:")
  77. print(groupIdList)