coollsd commited on
Commit
2aa4e5a
·
verified ·
1 Parent(s): ef0ddb6

Update ccc.py

Browse files
Files changed (1) hide show
  1. ccc.py +156 -0
ccc.py CHANGED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import aiohttp
2
+ import time
3
+ import asyncio
4
+ import random
5
+ import multiprocessing
6
+ from dateutil import parser
7
+ import os
8
+
9
+ discord_webhook_url = os.environ['webhook']
10
+ api_batch_url = "https://epic-alligator-77.deno.dev/post"
11
+ asset_info_url = "https://economy.roproxy.com/v2/assets/"
12
+
13
+ assets_checked = multiprocessing.Value('i', 0)
14
+ valid_assets_found = multiprocessing.Value('i', 0)
15
+
16
+ last_used_ids = {}
17
+ base_ids = {}
18
+
19
+ async def send_to_discord(session, asset_id, name, creator_id, creator_name, creator_type, asset_type, created_date):
20
+ embed = {
21
+ "embeds": [
22
+ {
23
+ "url": f"https://www.roblox.com/library/{asset_id}",
24
+ "title": name or "Unknown Asset",
25
+ "thumbnail": {
26
+ "url": f"https://rbxgleaks.pythonanywhere.com/asset/{asset_id}",
27
+ },
28
+ "fields": [
29
+ {
30
+ "name": "Creator Type",
31
+ "value": creator_type or "Unknown",
32
+ "inline": True
33
+ },
34
+ {
35
+ "name": "Creator ID",
36
+ "value": creator_id or "Unknown",
37
+ "inline": True
38
+ }
39
+ ],
40
+ "description": f"**Asset Type:** {asset_type}\n**ID:** ||{asset_id}||\n**Creator:** [{creator_name}](https://www.roblox.com/users/{creator_id}/profile)\n**Created:** {created_date}"
41
+ }
42
+ ],
43
+ "content": "",
44
+ }
45
+
46
+ try:
47
+ async with session.post(discord_webhook_url, json=embed) as response:
48
+ if response.status != 204:
49
+ print(f"Failed to send to Discord: {response.status}")
50
+ except Exception as e:
51
+ print(f"Failed to send to Discord: {e}")
52
+
53
+ async def check_asset_batch(session, asset_ids):
54
+ global assets_checked, valid_assets_found
55
+ payload = [{"assetId": asset_id} for asset_id in asset_ids]
56
+
57
+ try:
58
+ async with session.post(api_batch_url, json=payload, headers={
59
+ 'Content-Type': 'application/json',
60
+ 'Requester': 'Client',
61
+ 'User-Agent': 'Roblox/WinInetRobloxApp'
62
+ }) as response:
63
+
64
+ if response.status == 200:
65
+ results = await response.json()
66
+
67
+ if not results or (isinstance(results, list) and all("errors" in result for result in results)):
68
+ return
69
+
70
+ tasks = []
71
+ for asset_id in asset_ids:
72
+ if any(result.get("assetId") == asset_id and not result.get("IsCopyrightProtected", True) for result in results):
73
+ tasks.append(fetch_asset_info(session, asset_id))
74
+
75
+ await asyncio.gather(*tasks)
76
+
77
+ except Exception as e:
78
+ print(f"Failed to check asset batch: {e}")
79
+
80
+ async def fetch_asset_info(session, asset_id):
81
+ global assets_checked, valid_assets_found
82
+ with assets_checked.get_lock():
83
+ assets_checked.value += 1
84
+
85
+ async with session.get(f"{asset_info_url}{asset_id}/details") as asset_info_response:
86
+ if asset_info_response.status == 200:
87
+ asset_info = await asset_info_response.json()
88
+
89
+ name = asset_info.get("Name", "Unknown")
90
+ asset_type = asset_info.get("AssetTypeId", "Unknown")
91
+ creator = asset_info.get("Creator", {})
92
+ creator_id = creator.get("Id", "Unknown")
93
+ creator_name = creator.get("Name", "Unknown")
94
+ creator_type = creator.get("CreatorType", "Unknown")
95
+ created_date_str = asset_info.get("Created", "Unknown")
96
+ created_date = parse_iso8601(created_date_str)
97
+ if created_date:
98
+ created_date_formatted = created_date.strftime("%Y-%m-%d %H:%M:%S")
99
+ else:
100
+ created_date_formatted = "Unknown"
101
+
102
+ with valid_assets_found.get_lock():
103
+ valid_assets_found.value += 1
104
+ await send_to_discord(session, asset_id, name, creator_id, creator_name, creator_type, asset_type, created_date_formatted)
105
+
106
+ def parse_iso8601(date_str):
107
+ try:
108
+ return parser.isoparse(date_str)
109
+ except ValueError as e:
110
+ return None
111
+
112
+ def generate_base_id():
113
+ base = random.randint(70000000000000, 140000000000000)
114
+ return str(base)
115
+
116
+ def initialize_base_ids():
117
+ for digit in range(7, 15):
118
+ base_ids[digit] = generate_base_id()
119
+ last_used_ids[digit] = int(base_ids[digit])
120
+
121
+ def generate_ids_batch(digit, batch_size=10000):
122
+ last_used_id = last_used_ids[digit]
123
+ offset = random.randint(-1000000, 1000000)
124
+ ids_batch = [str(last_used_id + offset + i) for i in range(batch_size)]
125
+ last_used_ids[digit] += batch_size
126
+ print(f"Generated batch for digit {digit} (first 4 IDs): {ids_batch[:4]} with offset {offset}")
127
+ return ids_batch
128
+
129
+ async def run_scanner_instance(digit):
130
+ async with aiohttp.ClientSession() as session:
131
+ while True:
132
+ batch = generate_ids_batch(digit)
133
+ await check_asset_batch(session, batch)
134
+
135
+ async def print_status_periodically():
136
+ while True:
137
+ return
138
+
139
+ def run_scanner_in_process(digit):
140
+ asyncio.run(run_scanner_instance(digit))
141
+
142
+ if __name__ == "__main__":
143
+ initialize_base_ids()
144
+ processes = []
145
+ instances_per_digit = 20000
146
+
147
+ for i in range(instances_per_digit):
148
+ digit = 7 + (i % 8)
149
+ process = multiprocessing.Process(target=run_scanner_in_process, args=(digit,))
150
+ processes.append(process)
151
+ process.start()
152
+
153
+ asyncio.run(print_status_periodically())
154
+
155
+ for process in processes:
156
+ process.join()