from pyrogram import Client from pyrogram.raw.functions.contacts import Search from pyrogram.errors import FloodWait, PeerIdInvalid, UsernameNotOccupied import time # Укажи свой api_id и api_hash api_id = АПИ ИД api_hash = "АПИХЕШ" def main(): chats = set() # Загрузка поисковых запросов with open('queries.txt', encoding='utf-8') as file: queries = [q.strip() for q in file if q.strip()] with Client("session", api_id, api_hash) as client: for query in queries: try: result = client.invoke(Search(q=query, limit=100)) except FloodWait as e: print(f"FloodWait: спим {e.value} секунд") time.sleep(e.value) continue except Exception as e: print(f"Ошибка при поиске {query}: {e}") continue for chat in result.chats: username = chat.username # Если это канал без username, попробуем взять его у привязанного чата if not username and not chat.megagroup and not chat.gigagroup: try: full_chat = client.get_chat(chat.id) linked_chat = getattr(full_chat, "linked_chat", None) if linked_chat and linked_chat.username: username = linked_chat.username except (PeerIdInvalid, UsernameNotOccupied, Exception): continue if username: print(f"[{query}] — @{username}") chats.add(username) # Чтение уже сохранённых чатов try: with open('result_chats.txt', 'r', encoding='utf-8') as file: existing = set(line.strip() for line in file if line.strip()) except FileNotFoundError: existing = set() # Запись новых new_chats = chats - existing if new_chats: with open('result_chats.txt', 'a', encoding='utf-8') as file: for chat in sorted(new_chats): file.write(f"{chat}\n") if name == "main": try: main() except (KeyboardInterrupt, SystemExit): print("Прервано пользователем.") Python from pyrogram import Client from pyrogram.raw.functions.contacts import Search from pyrogram.errors import FloodWait, PeerIdInvalid, UsernameNotOccupied import time # Укажи свой api_id и api_hash api_id = АПИ ИД api_hash = "АПИХЕШ" def main(): chats = set() # Загрузка поисковых запросов with open('queries.txt', encoding='utf-8') as file: queries = [q.strip() for q in file if q.strip()] with Client("session", api_id, api_hash) as client: for query in queries: try: result = client.invoke(Search(q=query, limit=100)) except FloodWait as e: print(f"FloodWait: спим {e.value} секунд") time.sleep(e.value) continue except Exception as e: print(f"Ошибка при поиске {query}: {e}") continue for chat in result.chats: username = chat.username # Если это канал без username, попробуем взять его у привязанного чата if not username and not chat.megagroup and not chat.gigagroup: try: full_chat = client.get_chat(chat.id) linked_chat = getattr(full_chat, "linked_chat", None) if linked_chat and linked_chat.username: username = linked_chat.username except (PeerIdInvalid, UsernameNotOccupied, Exception): continue if username: print(f"[{query}] — @{username}") chats.add(username) # Чтение уже сохранённых чатов try: with open('result_chats.txt', 'r', encoding='utf-8') as file: existing = set(line.strip() for line in file if line.strip()) except FileNotFoundError: existing = set() # Запись новых new_chats = chats - existing if new_chats: with open('result_chats.txt', 'a', encoding='utf-8') as file: for chat in sorted(new_chats): file.write(f"{chat}\n") if name == "main": try: main() except (KeyboardInterrupt, SystemExit): print("Прервано пользователем.") вписываю, не реагирует, раньше просило скачать pyrogram и tgcrypto, скачал и перестал работать
from pyrogram import Client from pyrogram.raw.functions.contacts import Search from pyrogram.errors import FloodWait, PeerIdInvalid, UsernameNotOccupied import time # Укажи свой api_id и api_hash api_id = YOUR_API_ID api_hash = "YOUR_API_HASH" async def main(): chats = set() # Загрузка поисковых запросов with open('queries.txt', encoding='utf-8') as file: queries = [q.strip() for q in file if q.strip()] async with Client("session", api_id, api_hash) as client: for query in queries: try: result = await client.invoke(Search(q=query, limit=100)) except FloodWait as e: print(f"FloodWait: спим {e.value} секунд") time.sleep(e.value) continue except Exception as e: print(f"Ошибка при поиске {query}: {e}") continue for chat in result.chats: username = chat.username # Если это канал без username, попробуем взять его у привязанного чата if not username and not chat.megagroup and not chat.gigagroup: try: full_chat = await client.get_chat(chat.id) linked_chat = getattr(full_chat, "linked_chat", None) if linked_chat and linked_chat.username: username = linked_chat.username except (PeerIdInvalid, UsernameNotOccupied, Exception): continue if username: print(f"[{query}] — @{username}") chats.add(username) # Чтение уже сохранённых чатов try: with open('result_chats.txt', 'r', encoding='utf-8') as file: existing = set(line.strip() for line in file if line.strip()) except FileNotFoundError: existing = set() # Запись новых new_chats = chats - existing if new_chats: with open('result_chats.txt', 'a', encoding='utf-8') as file: for chat in sorted(new_chats): file.write(f"{chat}\n") if __name__ == "__main__": import asyncio try: asyncio.run(main()) except (KeyboardInterrupt, SystemExit): print("Прервано пользователем.") Python from pyrogram import Client from pyrogram.raw.functions.contacts import Search from pyrogram.errors import FloodWait, PeerIdInvalid, UsernameNotOccupied import time # Укажи свой api_id и api_hash api_id = YOUR_API_ID api_hash = "YOUR_API_HASH" async def main(): chats = set() # Загрузка поисковых запросов with open('queries.txt', encoding='utf-8') as file: queries = [q.strip() for q in file if q.strip()] async with Client("session", api_id, api_hash) as client: for query in queries: try: result = await client.invoke(Search(q=query, limit=100)) except FloodWait as e: print(f"FloodWait: спим {e.value} секунд") time.sleep(e.value) continue except Exception as e: print(f"Ошибка при поиске {query}: {e}") continue for chat in result.chats: username = chat.username # Если это канал без username, попробуем взять его у привязанного чата if not username and not chat.megagroup and not chat.gigagroup: try: full_chat = await client.get_chat(chat.id) linked_chat = getattr(full_chat, "linked_chat", None) if linked_chat and linked_chat.username: username = linked_chat.username except (PeerIdInvalid, UsernameNotOccupied, Exception): continue if username: print(f"[{query}] — @{username}") chats.add(username) # Чтение уже сохранённых чатов try: with open('result_chats.txt', 'r', encoding='utf-8') as file: existing = set(line.strip() for line in file if line.strip()) except FileNotFoundError: existing = set() # Запись новых new_chats = chats - existing if new_chats: with open('result_chats.txt', 'a', encoding='utf-8') as file: for chat in sorted(new_chats): file.write(f"{chat}\n") if __name__ == "__main__": import asyncio try: asyncio.run(main()) except (KeyboardInterrupt, SystemExit): print("Прервано пользователем.") Попробуй
Trump, hiddify - создает локальный ******-сервер и ставит его в систему. кроме браузеров, его никакие приложения не учитывают. amnezia*** скачай и добавь свой ключ туда.
MALWARE, Unable to connect due to network issues: [WinError 10055] Невозможно выполнить операцию на сокете, т.к. буфер слишком мал или очередь переполнена Unable to connect due to network issues: [WinError 10055] Невозможно выполнить операцию на сокете, т.к. буфер слишком мал или очередь переполнена Unable to connect due to network issues: [WinError 10055] Невозможно выполнить операцию на сокете, т.к. буфер слишком мал или очередь переполнена