├── query.txt ├── requirements.txt ├── README.md └── bot.py /query.txt: -------------------------------------------------------------------------------- 1 | query_id= 2 | user= -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | colorama 3 | pytz -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Coub BOT 2 | Coub BOT 3 | 4 | Register Here : [Coub](https://t.me/coub/app?startapp=coub__marker_18347663) 5 | 6 | ## Fitur 7 | 8 | - Auto Get Account Information 9 | - Auto Claim Daily Login 10 | - Auto Claim Refferal Reward 11 | - Auto Complete Task 12 | - Multi Account 13 | 14 | ## Prasyarat 15 | 16 | Pastikan Anda telah menginstal Python3.9 dan PIP. 17 | 18 | ## Instalasi 19 | 20 | 1. **Kloning repositori:** 21 | ```bash 22 | git clone https://github.com/vonssy/Coub-BOT.git 23 | ``` 24 | ```bash 25 | cd Coub-BOT 26 | ``` 27 | 28 | 2. **Instal Requirements:** 29 | ```bash 30 | pip install -r requirements.txt #or pip3 install -r requirements.txt 31 | ``` 32 | 33 | ## Konfigurasi 34 | 35 | - **query.txt:** Anda akan menemukan file `query.txt` di dalam direktori proyek. Pastikan `query.txt` berisi data yang sesuai dengan format yang diharapkan oleh skrip. Berikut adalah contoh format file: 36 | 37 | ```bash 38 | query_id= 39 | user= 40 | ``` 41 | 42 | ## Jalankan 43 | 44 | ```bash 45 | python bot.py #or python3 bot.py 46 | ``` 47 | 48 | ## Penutup 49 | 50 | Terima kasih telah mengunjungi repository ini, jangan lupa untuk memberikan kontribusi berupa follow dan stars. 51 | Jika Anda memiliki pertanyaan, menemukan masalah, atau memiliki saran untuk perbaikan, jangan ragu untuk menghubungi saya atau membuka *issue* di repositori GitHub ini. 52 | 53 | **vonssy** -------------------------------------------------------------------------------- /bot.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import aiohttp 3 | import asyncio 4 | import json 5 | import os 6 | import urllib.parse 7 | from colorama import * 8 | from datetime import datetime 9 | import pytz 10 | 11 | wib = pytz.timezone("Asia/Jakarta") 12 | 13 | class Coub: 14 | def __init__(self) -> None: 15 | self.headers = { 16 | "Accept": "application/json, text/plain, */*", 17 | "Accept-Language": "en-US,en;q=0.9", 18 | "Cache-Control": "no-cache", 19 | "Connection": "keep-alive", 20 | "Sec-Fetch-Dest": "empty", 21 | "Sec-Fetch-Mode": "cors", 22 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0" 23 | } 24 | 25 | def clear_terminal(self): 26 | os.system("cls" if os.name == "nt" else "clear") 27 | 28 | def log(self, message): 29 | print( 30 | f"{Fore.CYAN + Style.BRIGHT}[ {datetime.now().astimezone(wib).strftime('%x %X %Z')} ]{Style.RESET_ALL}" 31 | f"{Fore.WHITE + Style.BRIGHT} | {Style.RESET_ALL}{message}", 32 | flush=True 33 | ) 34 | 35 | def welcome(self): 36 | print( 37 | f""" 38 | {Fore.GREEN + Style.BRIGHT}Auto Claim {Fore.BLUE + Style.BRIGHT}Coub - BOT 39 | """ 40 | f""" 41 | {Fore.GREEN + Style.BRIGHT}Rey? {Fore.YELLOW + Style.BRIGHT} 42 | """ 43 | ) 44 | 45 | def format_seconds(self, seconds): 46 | hours, remainder = divmod(seconds, 3600) 47 | minutes, seconds = divmod(remainder, 60) 48 | return f"{int(hours):02}:{int(minutes):02}:{int(seconds):02}" 49 | 50 | def load_data(self, query: str): 51 | query_params = urllib.parse.parse_qs(query) 52 | query = query_params.get("user", [None])[0] 53 | 54 | if query: 55 | user_data_json = urllib.parse.unquote(query) 56 | user_data = json.loads(user_data_json) 57 | account = user_data.get("first_name", "unknown") 58 | return account 59 | else: 60 | raise ValueError("User data not found in query.") 61 | 62 | def load_task_list(self): 63 | url = "https://raw.githubusercontent.com/vonssy/Response.JSON/refs/heads/main/coub_tasks.json" 64 | try: 65 | response = requests.get(url) 66 | response.raise_for_status() 67 | data = response.json() 68 | return data.get('task_list', []) 69 | except requests.exceptions.RequestException as e: 70 | self.log(f"{Fore.RED + Style.BRIGHT}Error: Failed to fetch data from URL. {e}{Style.RESET_ALL}") 71 | return [] 72 | except json.JSONDecodeError: 73 | self.log(f"{Fore.RED + Style.BRIGHT}Error: Failed to parse JSON data.{Style.RESET_ALL}") 74 | return [] 75 | 76 | async def login(self, query: str, retries=5, delay=3): 77 | url = "https://coub.com/api/v2/sessions/login_mini_app" 78 | data = query 79 | headers = { 80 | **self.headers, 81 | "Content-Length": str(len(data)), 82 | "Content-Type": "application/x-www-form-urlencoded", 83 | "Host": "coub.com", 84 | "Origin": "https://coub.com", 85 | "Referer": "https://coub.com/tg-app", 86 | "Sec-Fetch-Site": "same-origin", 87 | } 88 | 89 | for attempt in range(retries): 90 | try: 91 | async with aiohttp.ClientSession() as session: 92 | async with session.post(url, headers=headers, data=data) as response: 93 | response.raise_for_status() 94 | result = await response.json() 95 | if response.status == 200: 96 | return result["api_token"] 97 | else: 98 | return None 99 | except (aiohttp.ClientError, aiohttp.ContentTypeError) as e: 100 | if attempt < retries - 1: 101 | print( 102 | f"{Fore.CYAN + Style.BRIGHT}[ {datetime.now().astimezone(wib).strftime('%x %X %Z')} ]{Style.RESET_ALL}" 103 | f"{Fore.WHITE + Style.BRIGHT} | {Style.RESET_ALL}" 104 | f"{Fore.RED + Style.BRIGHT}[ HTTP ERROR ]{Style.RESET_ALL}" 105 | f"{Fore.YELLOW + Style.BRIGHT} Retrying... {Style.RESET_ALL}" 106 | f"{Fore.WHITE + Style.BRIGHT}[{attempt + 1}/{retries}]{Style.RESET_ALL}", 107 | end="\r", 108 | flush=True 109 | ) 110 | await asyncio.sleep(delay) 111 | else: 112 | return None 113 | 114 | async def get_token(self, api_token: str, retries=5, delay=3): 115 | url = "https://coub.com/api/v2/torus/token" 116 | headers = { 117 | **self.headers, 118 | "Content-Length": "0", 119 | "X-Auth-Token": api_token, 120 | "Host": "coub.com", 121 | "Origin": "https://coub.com", 122 | "Referer": "https://coub.com/tg-app", 123 | "Sec-Fetch-Site": "same-origin", 124 | } 125 | 126 | for attempt in range(retries): 127 | try: 128 | async with aiohttp.ClientSession() as session: 129 | async with session.post(url, headers=headers) as response: 130 | response.raise_for_status() 131 | result = await response.json() 132 | if response.status == 200: 133 | return result["access_token"] 134 | else: 135 | return None 136 | except (aiohttp.ClientError, aiohttp.ContentTypeError) as e: 137 | if attempt < retries - 1: 138 | print( 139 | f"{Fore.CYAN + Style.BRIGHT}[ {datetime.now().astimezone(wib).strftime('%x %X %Z')} ]{Style.RESET_ALL}" 140 | f"{Fore.WHITE + Style.BRIGHT} | {Style.RESET_ALL}" 141 | f"{Fore.RED + Style.BRIGHT}[ HTTP ERROR ]{Style.RESET_ALL}" 142 | f"{Fore.YELLOW + Style.BRIGHT} Retrying... {Style.RESET_ALL}" 143 | f"{Fore.WHITE + Style.BRIGHT}[{attempt + 1}/{retries}]{Style.RESET_ALL}", 144 | end="\r", 145 | flush=True 146 | ) 147 | await asyncio.sleep(delay) 148 | else: 149 | return None 150 | 151 | async def user_balance(self, token: str, query: str, retries=5, delay=3): 152 | url = "https://rewards.coub.com/api/v2/get_user_balance" 153 | headers = { 154 | **self.headers, 155 | "Authorization": f"Bearer {token}", 156 | "X-Tg-Authorization": query, 157 | "Host": "rewards.coub.com", 158 | "Origin": "https://coub.com", 159 | "Referer": "https://coub.com/", 160 | "Sec-Fetch-Site": "same-site", 161 | } 162 | 163 | for attempt in range(retries): 164 | try: 165 | async with aiohttp.ClientSession() as session: 166 | async with session.get(url, headers=headers) as response: 167 | response.raise_for_status() 168 | if response.status == 200: 169 | return await response.json() 170 | else: 171 | return None 172 | except (aiohttp.ClientError, aiohttp.ContentTypeError) as e: 173 | if attempt < retries - 1: 174 | print( 175 | f"{Fore.CYAN + Style.BRIGHT}[ {datetime.now().astimezone(wib).strftime('%x %X %Z')} ]{Style.RESET_ALL}" 176 | f"{Fore.WHITE + Style.BRIGHT} | {Style.RESET_ALL}" 177 | f"{Fore.RED + Style.BRIGHT}[ HTTP ERROR ]{Style.RESET_ALL}" 178 | f"{Fore.YELLOW + Style.BRIGHT} Retrying... {Style.RESET_ALL}" 179 | f"{Fore.WHITE + Style.BRIGHT}[{attempt + 1}/{retries}]{Style.RESET_ALL}", 180 | end="\r", 181 | flush=True 182 | ) 183 | await asyncio.sleep(delay) 184 | else: 185 | return None 186 | 187 | async def refferal_rewards(self, token: str, query: str, retries=5, delay=3): 188 | url = "https://rewards.coub.com/api/v2/referal_rewards" 189 | headers = { 190 | **self.headers, 191 | "Authorization": f"Bearer {token}", 192 | "X-Tg-Authorization": query, 193 | "Host": "rewards.coub.com", 194 | "Origin": "https://coub.com", 195 | "Referer": "https://coub.com/", 196 | "Sec-Fetch-Site": "same-site", 197 | } 198 | 199 | for attempt in range(retries): 200 | try: 201 | async with aiohttp.ClientSession() as session: 202 | async with session.get(url, headers=headers) as response: 203 | response.raise_for_status() 204 | if response.status == 200: 205 | return await response.text() 206 | else: 207 | return None 208 | except (aiohttp.ClientError, aiohttp.ContentTypeError) as e: 209 | if attempt < retries - 1: 210 | print( 211 | f"{Fore.CYAN + Style.BRIGHT}[ {datetime.now().astimezone(wib).strftime('%x %X %Z')} ]{Style.RESET_ALL}" 212 | f"{Fore.WHITE + Style.BRIGHT} | {Style.RESET_ALL}" 213 | f"{Fore.RED + Style.BRIGHT}[ HTTP ERROR ]{Style.RESET_ALL}" 214 | f"{Fore.YELLOW + Style.BRIGHT} Retrying... {Style.RESET_ALL}" 215 | f"{Fore.WHITE + Style.BRIGHT}[{attempt + 1}/{retries}]{Style.RESET_ALL}", 216 | end="\r", 217 | flush=True 218 | ) 219 | await asyncio.sleep(delay) 220 | else: 221 | return None 222 | 223 | async def claim_refferal(self, token: str, query: str, retries=5, delay=3): 224 | url = "https://rewards.coub.com/api/v2/claim_referral_rewards" 225 | headers = { 226 | **self.headers, 227 | "Authorization": f"Bearer {token}", 228 | "X-Tg-Authorization": query, 229 | "Host": "rewards.coub.com", 230 | "Origin": "https://coub.com", 231 | "Referer": "https://coub.com/", 232 | "Sec-Fetch-Site": "same-site", 233 | } 234 | 235 | for attempt in range(retries): 236 | try: 237 | async with aiohttp.ClientSession() as session: 238 | async with session.get(url, headers=headers) as response: 239 | response.raise_for_status() 240 | if response.status == 200: 241 | return True 242 | else: 243 | return False 244 | except (aiohttp.ClientError, aiohttp.ContentTypeError) as e: 245 | if attempt < retries - 1: 246 | print( 247 | f"{Fore.CYAN + Style.BRIGHT}[ {datetime.now().astimezone(wib).strftime('%x %X %Z')} ]{Style.RESET_ALL}" 248 | f"{Fore.WHITE + Style.BRIGHT} | {Style.RESET_ALL}" 249 | f"{Fore.RED + Style.BRIGHT}[ HTTP ERROR ]{Style.RESET_ALL}" 250 | f"{Fore.YELLOW + Style.BRIGHT} Retrying... {Style.RESET_ALL}" 251 | f"{Fore.WHITE + Style.BRIGHT}[{attempt + 1}/{retries}]{Style.RESET_ALL}", 252 | end="\r", 253 | flush=True 254 | ) 255 | await asyncio.sleep(delay) 256 | else: 257 | return None 258 | 259 | async def complete_tasks(self, token: str, query: str, task_id, retries=5, delay=3): 260 | url = "https://rewards.coub.com/api/v2/complete_task" 261 | params = {"task_reward_id": task_id} 262 | headers = { 263 | **self.headers, 264 | "Authorization": f"Bearer {token}", 265 | "X-Tg-Authorization": query, 266 | "Host": "rewards.coub.com", 267 | "Origin": "https://coub.com", 268 | "Referer": "https://coub.com/", 269 | "Sec-Fetch-Site": "same-site", 270 | } 271 | 272 | for attempt in range(retries): 273 | try: 274 | async with aiohttp.ClientSession() as session: 275 | async with session.get(url, headers=headers, params=params) as response: 276 | response.raise_for_status() 277 | if response.status == 200: 278 | return await response.json() 279 | else: 280 | return None 281 | except (aiohttp.ClientError, aiohttp.ContentTypeError) as e: 282 | if attempt < retries - 1: 283 | print( 284 | f"{Fore.CYAN + Style.BRIGHT}[ {datetime.now().astimezone(wib).strftime('%x %X %Z')} ]{Style.RESET_ALL}" 285 | f"{Fore.WHITE + Style.BRIGHT} | {Style.RESET_ALL}" 286 | f"{Fore.RED + Style.BRIGHT}[ HTTP ERROR ]{Style.RESET_ALL}" 287 | f"{Fore.YELLOW + Style.BRIGHT} Retrying... {Style.RESET_ALL}" 288 | f"{Fore.WHITE + Style.BRIGHT}[{attempt + 1}/{retries}]{Style.RESET_ALL}", 289 | end="\r", 290 | flush=True 291 | ) 292 | await asyncio.sleep(delay) 293 | else: 294 | return None 295 | 296 | async def process_query(self, query: str): 297 | account = self.load_data(query) 298 | api_token = await self.login(query) 299 | if not api_token: 300 | self.log( 301 | f"{Fore.MAGENTA+Style.BRIGHT}[ Account{Style.RESET_ALL}" 302 | f"{Fore.WHITE+Style.BRIGHT} {account} {Style.RESET_ALL}" 303 | f"{Fore.MAGENTA+Style.BRIGHT}] [ Api Token{Style.RESET_ALL}" 304 | f"{Fore.RED+Style.BRIGHT} Is None {Style.RESET_ALL}" 305 | f"{Fore.MAGENTA+Style.BRIGHT}]{Style.RESET_ALL}" 306 | ) 307 | return 308 | 309 | await asyncio.sleep(2) 310 | 311 | token = await self.get_token(api_token) 312 | if not token: 313 | self.log( 314 | f"{Fore.MAGENTA+Style.BRIGHT}[ Account{Style.RESET_ALL}" 315 | f"{Fore.WHITE+Style.BRIGHT} {account} {Style.RESET_ALL}" 316 | f"{Fore.MAGENTA+Style.BRIGHT}] [ Access Token{Style.RESET_ALL}" 317 | f"{Fore.RED+Style.BRIGHT} Is None {Style.RESET_ALL}" 318 | f"{Fore.MAGENTA+Style.BRIGHT}]{Style.RESET_ALL}" 319 | ) 320 | return 321 | 322 | await asyncio.sleep(2) 323 | 324 | if token: 325 | user = await self.user_balance(token, query) 326 | if not user: 327 | self.log( 328 | f"{Fore.MAGENTA+Style.BRIGHT}[ Account{Style.RESET_ALL}" 329 | f"{Fore.WHITE+Style.BRIGHT} {account} {Style.RESET_ALL}" 330 | f"{Fore.RED+Style.BRIGHT}Reward Data Is None{Style.RESET_ALL}" 331 | f"{Fore.MAGENTA+Style.BRIGHT} ]{Style.RESET_ALL}" 332 | ) 333 | return 334 | 335 | if user: 336 | self.log( 337 | f"{Fore.MAGENTA+Style.BRIGHT}[ Account{Style.RESET_ALL}" 338 | f"{Fore.WHITE+Style.BRIGHT} {account} {Style.RESET_ALL}" 339 | f"{Fore.MAGENTA+Style.BRIGHT}] [ Balance{Style.RESET_ALL}" 340 | f"{Fore.WHITE+Style.BRIGHT} {user['balance']} $COUB {Style.RESET_ALL}" 341 | f"{Fore.MAGENTA+Style.BRIGHT}]{Style.RESET_ALL}" 342 | ) 343 | await asyncio.sleep(2) 344 | 345 | refferal = await self.refferal_rewards(token, query) 346 | if refferal: 347 | refferal_data = json.loads(refferal) 348 | rewards = refferal_data['referal_balance'] 349 | if rewards > 0: 350 | claim = await self.claim_refferal(token, query) 351 | if claim: 352 | self.log( 353 | f"{Fore.MAGENTA+Style.BRIGHT}[ Refferal{Style.RESET_ALL}" 354 | f"{Fore.WHITE+Style.BRIGHT} Is Claimed {Style.RESET_ALL}" 355 | f"{Fore.MAGENTA+Style.BRIGHT}] [ Reward{Style.RESET_ALL}" 356 | f"{Fore.WHITE+Style.BRIGHT} {rewards} $COUB {Style.RESET_ALL}" 357 | f"{Fore.MAGENTA+Style.BRIGHT}]{Style.RESET_ALL}" 358 | ) 359 | else: 360 | self.log( 361 | f"{Fore.MAGENTA+Style.BRIGHT}[ Refferal{Style.RESET_ALL}" 362 | f"{Fore.RED+Style.BRIGHT} Isn't Claimed {Style.RESET_ALL}" 363 | f"{Fore.MAGENTA+Style.BRIGHT}]{Style.RESET_ALL}" 364 | ) 365 | else: 366 | self.log( 367 | f"{Fore.MAGENTA+Style.BRIGHT}[ Refferal{Style.RESET_ALL}" 368 | f"{Fore.YELLOW+Style.BRIGHT} No Available Reward to Claim {Style.RESET_ALL}" 369 | f"{Fore.MAGENTA+Style.BRIGHT}]{Style.RESET_ALL}" 370 | ) 371 | else: 372 | self.log( 373 | f"{Fore.MAGENTA+Style.BRIGHT}[ Refferal{Style.RESET_ALL}" 374 | f"{Fore.RED+Style.BRIGHT} Data Is None {Style.RESET_ALL}" 375 | f"{Fore.MAGENTA+Style.BRIGHT}]{Style.RESET_ALL}" 376 | ) 377 | await asyncio.sleep(2) 378 | 379 | tasks = self.load_task_list() 380 | if tasks: 381 | for task in tasks: 382 | task_id = task["id"] 383 | title = task["title"] 384 | reward = task["reward"] 385 | status = task["status"] 386 | 387 | if status in ["ready-to-start", "ready-to-claim"]: 388 | self.log( 389 | f"{Fore.MAGENTA+Style.BRIGHT}[ Task{Style.RESET_ALL}" 390 | f"{Fore.WHITE+Style.BRIGHT} {task_id} {Style.RESET_ALL}" 391 | f"{Fore.MAGENTA+Style.BRIGHT}-{Style.RESET_ALL}" 392 | f"{Fore.WHITE+Style.BRIGHT} {title} {Style.RESET_ALL}" 393 | f"{Fore.MAGENTA+Style.BRIGHT}] [ Status{Style.RESET_ALL}" 394 | f"{Fore.WHITE+Style.BRIGHT} {status} {Style.RESET_ALL}" 395 | f"{Fore.MAGENTA+Style.BRIGHT}]{Style.RESET_ALL}" 396 | ) 397 | 398 | complete_task = await self.complete_tasks(token, query, task_id) 399 | if complete_task: 400 | self.log( 401 | f"{Fore.MAGENTA+Style.BRIGHT}[ Task{Style.RESET_ALL}" 402 | f"{Fore.WHITE+Style.BRIGHT} {title} {Style.RESET_ALL}" 403 | f"{Fore.GREEN+Style.BRIGHT}Is Completed{Style.RESET_ALL}" 404 | f"{Fore.MAGENTA+Style.BRIGHT} ] [ Reward{Style.RESET_ALL}" 405 | f"{Fore.WHITE+Style.BRIGHT} {reward} $COUB {Style.RESET_ALL}" 406 | f"{Fore.MAGENTA+Style.BRIGHT}]{Style.RESET_ALL}" 407 | ) 408 | else: 409 | self.log( 410 | f"{Fore.MAGENTA+Style.BRIGHT}[ Task{Style.RESET_ALL}" 411 | f"{Fore.WHITE+Style.BRIGHT} {title} {Style.RESET_ALL}" 412 | f"{Fore.RED+Style.BRIGHT}Isn't Completed{Style.RESET_ALL}" 413 | f"{Fore.MAGENTA+Style.BRIGHT} or {Style.RESET_ALL}" 414 | f"{Fore.YELLOW+Style.BRIGHT}Already Completed{Style.RESET_ALL}" 415 | f"{Fore.MAGENTA+Style.BRIGHT} ]{Style.RESET_ALL}" 416 | ) 417 | await asyncio.sleep(1) 418 | else: 419 | self.log( 420 | f"{Fore.MAGENTA+Style.BRIGHT}[ Task{Style.RESET_ALL}" 421 | f"{Fore.RED+Style.BRIGHT} Data Is None {Style.RESET_ALL}" 422 | f"{Fore.MAGENTA+Style.BRIGHT}]{Style.RESET_ALL}" 423 | ) 424 | 425 | async def main(self): 426 | try: 427 | with open("query.txt", "r") as file: 428 | queries = [line.strip() for line in file if line.strip()] 429 | 430 | while True: 431 | self.clear_terminal() 432 | self.welcome() 433 | self.log( 434 | f"{Fore.GREEN + Style.BRIGHT}Accoun's Total: {Style.RESET_ALL}" 435 | f"{Fore.WHITE + Style.BRIGHT}{len(queries)}{Style.RESET_ALL}" 436 | ) 437 | self.log(f"{Fore.CYAN + Style.BRIGHT}-{Style.RESET_ALL}"*75) 438 | 439 | for query in queries: 440 | query = query.strip() 441 | if query: 442 | await self.process_query(query) 443 | self.log(f"{Fore.CYAN + Style.BRIGHT}-{Style.RESET_ALL}"*75) 444 | seconds = 60 445 | while seconds > 0: 446 | formatted_time = self.format_seconds(seconds) 447 | print( 448 | f"{Fore.CYAN+Style.BRIGHT}[ Wait for{Style.RESET_ALL}" 449 | f"{Fore.WHITE+Style.BRIGHT} {formatted_time} {Style.RESET_ALL}" 450 | f"{Fore.CYAN+Style.BRIGHT}... ]{Style.RESET_ALL}", 451 | end="\r" 452 | ) 453 | await asyncio.sleep(1) 454 | seconds -= 1 455 | 456 | seconds = 60 457 | while seconds > 0: 458 | formatted_time = self.format_seconds(seconds) 459 | print( 460 | f"{Fore.CYAN+Style.BRIGHT}[ Wait for{Style.RESET_ALL}" 461 | f"{Fore.WHITE+Style.BRIGHT} {formatted_time} {Style.RESET_ALL}" 462 | f"{Fore.CYAN+Style.BRIGHT}... ]{Style.RESET_ALL}", 463 | end="\r" 464 | ) 465 | await asyncio.sleep(1) 466 | seconds -= 1 467 | 468 | except FileNotFoundError: 469 | self.log(f"{Fore.RED}File 'query.txt' tidak ditemukan.{Style.RESET_ALL}") 470 | return 471 | except Exception as e: 472 | self.log(f"{Fore.RED+Style.BRIGHT}Error: {e}{Style.RESET_ALL}") 473 | 474 | if __name__ == "__main__": 475 | try: 476 | bot = Coub() 477 | asyncio.run(bot.main()) 478 | except KeyboardInterrupt: 479 | print( 480 | f"{Fore.CYAN + Style.BRIGHT}[ {datetime.now().astimezone(wib).strftime('%x %X %Z')} ]{Style.RESET_ALL}" 481 | f"{Fore.WHITE + Style.BRIGHT} | {Style.RESET_ALL}" 482 | f"{Fore.RED + Style.BRIGHT}[ EXIT ] Coub - BOT{Style.RESET_ALL} " 483 | ) --------------------------------------------------------------------------------