import requests import json import time import datetime # Make list of searched groups (debug för att ma aldrig får några valid, varna för duplicate) # Kolla på de andra api för att hämta grupper # ----------------------------------------------------------------- # keyword = "aaaa" exactMatch = False groupCount = 100 # 10, 25, 50, 100 howManyCycles = 2 delayTime = 0 groupMaxMembers = 10 groupHasFunds = False publicGroup = True hasOwner = False saveInFile = True # ----------------------------------------------------------------- # url = "https://groups.rprxy.xyz/v1/groups/search?keyword=" + keyword + "&prioritizeExactMatch=" + str( exactMatch).lower() + "&limit=" + str(groupCount) # fundsUrl = "https://economy.roblox.com/v1/groups/GROUP/currency" foundGroups = [] groupIdList = [] lookedGroups = {} nextPageCursor = "yes" try: for cycle in range(0, howManyCycles): print("[WORKING] Cycle number: " + str(cycle)) print("[WORKING] Percentage: " + str(int((cycle / howManyCycles) * 1000) / 10) + "%") if not nextPageCursor: break elif nextPageCursor == "yes": nextPageCursor = "" requestData = requests.get(url + "&cursor=" + nextPageCursor) # Forgot to add nextPageCursor, ruined the program... # print(requestData.json()) dataTable = json.loads(requestData.content) try: nextPageCursor = dataTable["nextPageCursor"] except: nextPageCursor = "" for group in dataTable["data"]: if group["id"] in lookedGroups: print("[WARN] Duplicate Group: " + group["name"]) continue # else: # lookedGroups[group["id"]] = True valid = True # print(str(group["memberCount"])) if group["memberCount"] > groupMaxMembers: valid = False if publicGroup and not group["publicEntryAllowed"]: valid = False if groupHasFunds: fundsUrl = "https://economy.rprxy.xyz/v1/groups/" + str(group["id"]) + "/currency" economyData = requests.get(fundsUrl) economyJSON = json.loads(economyData.content) try: if economyJSON["robux"] == 0: valid = False except: valid = False if valid: print("[INFO] Found valid group " + str(group["id"])) # group["description"] = "" # group["name"] = "" foundGroups.append(group) groupIdList.append(group["id"]) # else: # print("Invalid group") time.sleep(delayTime) except: print("[ERROR] Error in loop") if foundGroups.__len__() > 0 and saveInFile: thisTime = datetime.datetime.today() fileTime = str(thisTime.year) + "-" + str(thisTime.month) + "-" + str(thisTime.day) + "_" + str( thisTime.hour) + "-" + str(thisTime.minute) + "-" + str(thisTime.second) with open("./run/foundGroups_" + fileTime + ".txt", "w", encoding='utf-8') as groupFile: for line in foundGroups: groupFile.write(line.__str__()) groupFile.write("\n") # groupFile.close() with open("./run/foundGroupIds" + fileTime + ".txt", "w", encoding='utf-8') as groupIdFile: for line in groupIdList: groupIdFile.write(str(line)) print(str(line)) groupIdFile.write("\n") # groupIdFile.close() groupIdItt = groupIdList if not hasOwner: for groupId in groupIdItt: time.sleep(2) ownerUrl = "https://groups.rprxy.xyz/v1/groups/" + str(groupId) print(ownerUrl) groupData = requests.get(ownerUrl) groupJSON = json.loads(groupData.content) try: if groupJSON["owner"]["userId"]: groupIdList.remove(groupId) foundGroups.remove(groupId) print("Has owner") print(groupJSON) else: print("No owner") print(groupJSON) except: print("No owner error") print(groupJSON) 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") print("Found groups: " + str(foundGroups.__len__())) print(foundGroups) print("\nFound group ids:") print(groupIdList)