[
  {
    "path": ".gitignore",
    "content": "# Python bytecode files\n*.pyc\n*.pyo\n*.pyd\n__pycache__/\n*.so\n\n# Distribution / packaging\n.Python\nbuild/\ndist/\n*.egg-info/\n*.eggs/\nMANIFEST\n\n# Virtual environment\nvenv/\nenv/\n.venv/\nENV/\nenv.bak/\nvenv.bak/\n\n# Jupyter Notebook checkpoints\n.ipynb_checkpoints/\n\n# pyenv\n.python-version\n\n# pytest\n.cache\nnosetests.xml\ncoverage.xml\n*.cover\n*.hypothesis/\n\n# mypy\n.mypy_cache/\n.dmypy.json\ndmypy.json\n\n# Ruff\n.ruff_cache/\n\n# VSCode\n.vscode/\n\n# JetBrains (PyCharm, IntelliJ, etc.)\n.idea/\n\n# macOS\n.DS_Store\n\n# Windows\nThumbs.db\nDesktop.ini\n\n# Flask instance folder\ninstance/\n\n# dotenv\n.env\n.env.*\n\n# Python tool caches\n.cache/\n\n# Program Logs\nerror.txt"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2025 VWH\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
  },
  {
    "path": "README.md",
    "content": "# Telegram Views\n\n![Gif](https://media4.giphy.com/media/v1.Y2lkPTc5MGI3NjExOGFkOTRiMTdjMTc3OTJhZmU0MDRmZGFlNGJiMjA3NGYxOGQwM2Y2ZSZlcD12MV9pbnRlcm5hbF9naWZzX2dpZklkJmN0PWc/jStbo9qVAJsObKKr5a/giphy.gif)\n\n## Features\n\n- **Asynchronous**: Optimized for performance with async tasks.\n- **Proxy Support**: Compatible with all proxy types (HTTP/S, SOCKS4, SOCKS5).\n- **Auto Proxy Scraping**: Automatically scrapes proxies from various sources.\n- **Proxy Rotation**: Supports rotating proxies for added anonymity.\n- **Custom Proxy Lists**: Load proxies from files and use them in different modes.\n\n---\n\n## Arguments Overview\n\n### Command-Line Arguments:\n\n- `--channel`: **Required** – Telegram channel to send views to (e.g., `@channel_name`).\n- `--post`: **Required** – Post number in the Telegram channel (e.g., `4` for `https://t.me/channel_name/4`).\n- `--type`: **Optional** – Proxy type (`http`, `socks4`, `socks5`).\n- `--mode`: **Required** – Mode of operation (options: `auto`, `list`, `rotate`).\n- `--proxy`: **Optional** – Path to a text file containing a list of proxies or a single proxy in `user:password@host:port` format.\n- `--concurrency`: **Optional** – Maximum number of concurrent requests (default: `200`).\n\n---\n\n## Modes\n\n### 1. **Auto Scraping Mode** (No Proxies Required)\n\nIn this mode, proxies are automatically scraped from various online sources. You don’t need to provide a list of proxies.\n\n- **Usage**: This mode runs indefinitely and auto-rescrapes proxies after each loop.\n\n```bash\nmain.py --mode auto --channel tviews --post 4\n```\n\n#### Notes:\n\n- Proxies will be scraped from the `auto` directory. You can update the sources in the `auto` directory.\n- This mode does not require a proxy list.\n\n### 2. **List Mode** (Load Proxies From File)\n\nThis mode allows you to provide a text file containing a list of proxies. Each proxy should be on a new line. It supports multiple proxy types: `http`, `socks4`, and `socks5`.\n\n- **Usage**:\n\n```bash\nmain.py --mode list --type http --proxy http.txt --channel tviews --post 4\n```\n\n#### Notes:\n\n- You need to provide a path to a text file with proxies (`http.txt`, `socks4.txt`, etc.).\n- This mode uses the proxies from the file for continuous requests.\n\n### 3. **Rotating Proxy Mode**\n\nIn this mode, a single proxy (with rotation) is used for requests. You need to provide a proxy in the `user:password@ip:port` format.\n\n- **Usage**:\n\n```bash\nmain.py --mode rotate --type http --proxy user:password@ip:port --channel tviews --post 4\n```\n\n#### Notes:\n\n- This mode rotates a single proxy across multiple requests.\n\n---\n\n## Example Usage\n\n### **1. Auto Scraping Mode** (No Proxy)\n\nThis mode continuously scrapes proxies and sends views to the given post on the Telegram channel.\n\n```bash\npython main.py --mode auto --channel tviews --post 4\n```\n\n### **2. Load Proxies From File** (Custom Proxies)\n\nIf you have a list of proxies (e.g., in a text file `http.txt`), use this mode to send views using those proxies.\n\n```bash\npython main.py --mode list --type http --proxy http.txt --channel tviews --post 4\n```\n\n### **3. Rotating Proxy Mode** (Single Proxy with Rotation)\n\nThis mode allows you to send views using a single rotating proxy. Provide the proxy in `user:password@ip:port` format.\n\n```bash\npython main.py --mode rotate --type http --proxy user:password@ip:port --channel tviews --post 4\n```\n\n---\n\n## Requirements\n\nMake sure to install the required dependencies before running the script:\n\n```bash\npip install -r requirements.txt\n```\n\n---\n"
  },
  {
    "path": "auto/http.txt",
    "content": "https://raw.githubusercontent.com/proxifly/free-proxy-list/main/proxies/protocols/http/data.txt\nhttps://raw.githubusercontent.com/zloi-user/hideip.me/main/http.txt\nhttps://openproxylist.xyz/http.txt\nhttps://api.proxyscrape.com/v2/?request=getproxies&protocol=http\nhttps://openproxy.space/list/http\nhttps://proxyspace.pro/http.txt\nhttps://proxyspace.pro/https.txt\nhttps://proxyhub.me/en/all-http-proxy-list.html\nhttps://proxyhub.me/en/all-https-proxy-list.html\nhttps://proxy-tools.com/proxy/http\nhttps://proxy-tools.com/proxy/https\nhttps://www.proxy-list.download/api/v1/get?type=http\nhttps://www.proxy-list.download/api/v1/get?type=https\nhttps://www.proxyscan.io/download?type=http\nhttps://rootjazz.com/proxies/proxies.txt\nhttps://sheesh.rip/http.txt\nhttps://spys.me/proxy.txt\nhttps://proxysearcher.sourceforge.net/Proxy%20List.php?type=http\nhttps://proxylist.geonode.com/api/proxy-list?limit=500&page=1&sort_by=lastChecked&sort_type=desc&protocols=http\nhttps://proxylist.geonode.com/api/proxy-list?limit=500&page=1&sort_by=lastChecked&sort_type=desc&protocols=https\nhttps://cdn.jsdelivr.net/gh/aslisk/proxyhttps/https.txt\nhttps://cdn.jsdelivr.net/gh/clarketm/proxy-list/proxy-list-raw.txt\nhttps://cdn.jsdelivr.net/gh/hendrikbgr/Free-Proxy-Repo/proxy_list.txt\nhttps://cdn.jsdelivr.net/gh/jetkai/proxy-list/online-proxies/txt/proxies-http.txt\nhttps://cdn.jsdelivr.net/gh/mertguvencli/http-proxy-list/proxy-list/data.txt\nhttps://cdn.jsdelivr.net/gh/mmpx12/proxy-list/https.txt\nhttps://cdn.jsdelivr.net/gh/roosterkid/openproxylist/HTTPS_RAW.txt\nhttps://cdn.jsdelivr.net/gh/saschazesiger/Free-Proxies/proxies/http.txt\nhttps://cdn.jsdelivr.net/gh/ShiftyTR/Proxy-List/https.txt\nhttps://cdn.jsdelivr.net/gh/sunny9577/proxy-scraper/proxies.txt\nhttps://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/http.txt\nhttps://raw.githubusercontent.com/themiralay/Proxy-List-World/master/data.txt\nhttps://raw.githubusercontent.com/elliottophellia/yakumo/master/results/http/global/http_checked.txt\nhttps://raw.githubusercontent.com/zloi-user/hideip.me/main/http.txt\nhttps://raw.githubusercontent.com/zloi-user/hideip.me/main/https.txt\nhttps://raw.githubusercontent.com/fahimscirex/proxybd/master/proxylist/http.txt\nhttps://raw.githubusercontent.com/prxchk/proxy-list/main/http.txt\nhttps://raw.githubusercontent.com/yemixzy/proxy-list/main/proxies/http.txt\nhttps://raw.githubusercontent.com/ErcinDedeoglu/proxies/main/proxies/http.txt\nhttps://raw.githubusercontent.com/ErcinDedeoglu/proxies/main/proxies/https.txt\nhttps://raw.githubusercontent.com/im-razvan/proxy_list/main/http.txt\nhttps://raw.githubusercontent.com/monosans/proxy-list/main/proxies/http.txt\nhttps://raw.githubusercontent.com/sunny9577/proxy-scraper/master/generated/http_proxies.txt\nhttps://raw.githubusercontent.com/SevenworksDev/proxy-list/main/proxies/http.txt\nhttps://raw.githubusercontent.com/SevenworksDev/proxy-list/main/proxies/https.txt\nhttps://raw.githubusercontent.com/MrMarble/proxy-list/main/all.txt\nhttps://raw.githubusercontent.com/tuanminpay/live-proxy/master/http.txt\nhttps://raw.githubusercontent.com/officialputuid/KangProxy/KangProxy/http/http.txt\nhttps://raw.githubusercontent.com/officialputuid/KangProxy/KangProxy/https/https.txt\nhttps://raw.githubusercontent.com/Tsprnay/Proxy-lists/master/proxies/http.txt\nhttps://raw.githubusercontent.com/Tsprnay/Proxy-lists/master/proxies/https.txt\nhttps://raw.githubusercontent.com/mmpx12/proxy-list/master/http.txt\nhttps://raw.githubusercontent.com/mmpx12/proxy-list/master/https.txt\nhttps://raw.githubusercontent.com/MuRongPIG/Proxy-Master/main/http.txt\nhttps://raw.githubusercontent.com/ALIILAPRO/Proxy/main/http.txt\n"
  },
  {
    "path": "auto/socks4.txt",
    "content": "https://raw.githubusercontent.com/proxifly/free-proxy-list/main/proxies/protocols/socks4/data.txt\nhttps://openproxy.space/list/socks4\nhttps://openproxylist.xyz/socks4.txt\nhttps://api.proxyscrape.com/v2/?request=getproxies&protocol=socks4\nhttps://proxysearcher.sourceforge.net/Proxy%20List.php?type=socks\nhttps://proxyspace.pro/socks4.txt\nhttps://www.proxy-list.download/api/v1/get?type=socks4\nhttps://www.proxyscan.io/download?type=socks4\nhttps://proxyhub.me/en/all-socks4-proxy-list.html\nhttps://proxy-tools.com/proxy/socks4\nhttps://proxylist.geonode.com/api/proxy-list?limit=500&page=1&sort_by=lastChecked&sort_type=desc&protocols=socks4\nhttps://spys.me/socks.txt\nhttps://www.socks-proxy.net/\nhttps://www.my-proxy.com/free-socks-4-proxy.html\nhttps://cdn.jsdelivr.net/gh/B4RC0DE-TM/proxy-list/SOCKS4.txt\nhttps://cdn.jsdelivr.net/gh/jetkai/proxy-list/online-proxies/txt/proxies-socks4.txt\nhttps://cdn.jsdelivr.net/gh/roosterkid/openproxylist/SOCKS4_RAW.txt\nhttps://cdn.jsdelivr.net/gh/saschazesiger/Free-Proxies/proxies/socks4.txt\nhttps://cdn.jsdelivr.net/gh/TheSpeedX/PROXY-List/socks4.txt\nhttps://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/socks4.txt\nhttps://raw.githubusercontent.com/elliottophellia/yakumo/master/results/socks4/global/socks4_checked.txt\nhttps://raw.githubusercontent.com/zloi-user/hideip.me/main/socks4.txt\nhttps://raw.githubusercontent.com/fahimscirex/proxybd/master/proxylist/socks4.txt\nhttps://raw.githubusercontent.com/prxchk/proxy-list/main/socks4.txt\nhttps://raw.githubusercontent.com/yemixzy/proxy-list/main/proxies/socks4.txt\nhttps://raw.githubusercontent.com/ErcinDedeoglu/proxies/main/proxies/socks4.txt\nhttps://raw.githubusercontent.com/monosans/proxy-list/main/proxies/socks4.txt\nhttps://raw.githubusercontent.com/sunny9577/proxy-scraper/master/generated/socks4_proxies.txt\nhttps://raw.githubusercontent.com/SevenworksDev/proxy-list/main/proxies/socks4.txt\nhttps://raw.githubusercontent.com/tuanminpay/live-proxy/master/socks4.txt\nhttps://raw.githubusercontent.com/officialputuid/KangProxy/KangProxy/socks4/socks4.txt\nhttps://raw.githubusercontent.com/Tsprnay/Proxy-lists/master/proxies/socks4.txt\nhttps://raw.githubusercontent.com/mmpx12/proxy-list/master/socks4.txt\nhttps://raw.githubusercontent.com/MuRongPIG/Proxy-Master/main/socks4.txt\nhttps://raw.githubusercontent.com/ALIILAPRO/Proxy/main/socks4.txt\n"
  },
  {
    "path": "auto/socks5.txt",
    "content": "https://raw.githubusercontent.com/proxifly/free-proxy-list/main/proxies/protocols/socks5/data.txt\nhttps://openproxy.space/list/socks5\nhttps://openproxylist.xyz/socks5.txt\nhttps://api.proxyscrape.com/v2/?request=getproxies&protocol=socks5\nhttp://proxysearcher.sourceforge.net/Proxy%20List.php?type=socks\nhttps://proxyspace.pro/socks5.txt\nhttps://spys.me/socks.txt\nhttps://www.proxy-list.download/api/v1/get?type=socks5\nhttps://www.proxyscan.io/download?type=socks5\nhttps://proxy-tools.com/proxy/socks5\nhttps://proxyhub.me/en/all-sock5-proxy-list.html\nhttps://www.my-proxy.com/free-socks-5-proxy.html\nhttps://proxylist.geonode.com/api/proxy-list?limit=500&page=1&sort_by=lastChecked&sort_type=desc&protocols=socks5\nhttps://cdn.jsdelivr.net/gh/HyperBeats/proxy-list/socks5.txt\nhttps://cdn.jsdelivr.net/gh/jetkai/proxy-list/online-proxies/txt/proxies-socks5.txt\nhttps://cdn.jsdelivr.net/gh/mmpx12/proxy-list/socks5.txt\nhttps://cdn.jsdelivr.net/gh/roosterkid/openproxylist/SOCKS5_RAW.txt\nhttps://cdn.jsdelivr.net/gh/saschazesiger/Free-Proxies/proxies/socks5.txt\nhttps://cdn.jsdelivr.net/gh/TheSpeedX/PROXY-List/socks5.txt\nhttps://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/socks5.txt\nhttps://raw.githubusercontent.com/elliottophellia/yakumo/master/results/socks5/global/socks5_checked.txt\nhttps://raw.githubusercontent.com/zloi-user/hideip.me/main/socks5.txt\nhttps://raw.githubusercontent.com/fahimscirex/proxybd/master/proxylist/socks5.txt\nhttps://raw.githubusercontent.com/prxchk/proxy-list/main/socks5.txt\nhttps://raw.githubusercontent.com/yemixzy/proxy-list/main/proxies/socks5.txt\nhttps://raw.githubusercontent.com/hookzof/socks5_list/master/proxy.txt\nhttps://raw.githubusercontent.com/ErcinDedeoglu/proxies/main/proxies/socks5.txt\nhttps://raw.githubusercontent.com/im-razvan/proxy_list/main/socks5.txt\nhttps://raw.githubusercontent.com/monosans/proxy-list/main/proxies/socks5.txt\nhttps://raw.githubusercontent.com/sunny9577/proxy-scraper/master/generated/socks5_proxies.txt\nhttps://raw.githubusercontent.com/SevenworksDev/proxy-list/main/proxies/socks5.txt\nhttps://raw.githubusercontent.com/tuanminpay/live-proxy/master/socks5.txt\nhttps://raw.githubusercontent.com/officialputuid/KangProxy/KangProxy/socks5/socks5.txt\nhttps://raw.githubusercontent.com/Tsprnay/Proxy-lists/master/proxies/socks5.txt\nhttps://raw.githubusercontent.com/mmpx12/proxy-list/master/socks5.txt\nhttps://raw.githubusercontent.com/MuRongPIG/Proxy-Master/main/socks5.txt\nhttps://raw.githubusercontent.com/ALIILAPRO/Proxy/main/socks5.txt\nhttps://raw.githubusercontent.com/AGDDoS/AGProxy/master/proxies/socks5.txt\n"
  },
  {
    "path": "main.py",
    "content": "import aiohttp\nimport asyncio\nfrom re import search, compile\nfrom argparse import ArgumentParser\nfrom datetime import datetime\nfrom fake_useragent import UserAgent\nfrom aiohttp_socks import ProxyConnector\n\n# Regular expression for matching proxy patterns\nREGEX = compile(\n    r\"(?:^|\\D)?((\"+ r\"(?:[1-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\"\n    + r\"\\.\" + r\"(?:\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\"\n    + r\"\\.\" + r\"(?:\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\"\n    + r\"\\.\" + r\"(?:\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\"\n    + r\"):\" + (r\"(?:\\d|[1-9]\\d{1,3}|[1-5]\\d{4}|6[0-4]\\d{3}\"\n    + r\"|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])\")\n    + r\")(?:\\D|$)\"\n)\n\ndef log(message):\n    timestamp = datetime.now().strftime(\"%H:%M:%S\")\n    print(f\"[{timestamp}] {message}\")\n\nclass Telegram:\n    def __init__(self, channel: str, post: int, concurrency: int = 100) -> None:\n        self.channel = channel\n        self.post = post\n        self.concurrency = concurrency\n        self.semaphore = asyncio.Semaphore(concurrency)\n        log(f\"Initialized with channel: @{channel}, post: {post}, concurrency: {concurrency}\")\n\n    async def request(self, proxy: str, proxy_type: str):\n        proxy_url = f\"{proxy_type}://{proxy}\"\n        try:\n            async with self.semaphore:\n                connector = ProxyConnector.from_url(proxy_url)\n                jar = aiohttp.CookieJar(unsafe=True)\n                async with aiohttp.ClientSession(cookie_jar=jar, connector=connector) as session:\n                    user_agent = UserAgent().random\n                    headers = {\n                        \"referer\": f\"https://t.me/{self.channel}/{self.post}\",\n                        \"user-agent\": user_agent,\n                    }\n                    async with session.get(\n                        f\"https://t.me/{self.channel}/{self.post}?embed=1&mode=tme\",\n                        headers=headers,\n                        timeout=aiohttp.ClientTimeout(total=5),\n                    ) as embed_response:\n\n                        if not jar.filter_cookies(embed_response.url).get(\"stel_ssid\"):\n                            log(\"ERROR: No cookies received\")\n                            return\n\n                        views_token = search(\n                            'data-view=\"([^\"]+)\"', await embed_response.text()\n                        )\n\n                        if not views_token:\n                            log(\"ERROR: No view token found\")\n                            return\n\n                        views_response = await session.post(\n                            \"https://t.me/v/?views=\" + views_token.group(1),\n                            headers={\n                                \"referer\": f\"https://t.me/{self.channel}/{self.post}?embed=1&mode=tme\",\n                                \"user-agent\": user_agent,\n                                \"x-requested-with\": \"XMLHttpRequest\",\n                            },\n                            timeout=aiohttp.ClientTimeout(total=5),\n                        )\n\n                        if (\n                            await views_response.text() == \"true\"\n                            and views_response.status == 200\n                        ):\n                            log(\"SUCCESS: View sent\")\n                        else:\n                            log(\"FAILED: View not registered\")\n\n        except Exception as e:\n            log(f\"ERROR: Proxy connection failed - {proxy_type}://{proxy} - {str(e)[:50]}...\")\n\n        finally:\n            if 'jar' in locals():\n                jar.clear()\n\n    async def run_proxies_continuous(self, lines: list, proxy_type: str):\n        log(f\"Starting continuous mode with {len(lines)} proxies of type {proxy_type}\")\n        \n        tasks = [\n            asyncio.create_task(\n                self.request(proxy, proxy_type)\n            ) for proxy in lines\n        ]\n        \n        await asyncio.gather(*tasks)\n\n    async def continuous_request(self, proxy: str, proxy_type: str):\n        \n        while True:\n            await self.request(proxy, proxy_type)\n\n    async def run_auto_continuous(self):\n        log(\"Starting continuous auto mode\")\n        while True:\n            auto = Auto()\n            await auto.init()\n            \n            if not auto.proxies:\n                log(\"No proxies found, retrying in 60 seconds...\")\n                await asyncio.sleep(60)\n                continue\n                \n            log(f\"Auto scraping complete. Found {len(auto.proxies)} proxies\")\n            \n            tasks = [\n                asyncio.create_task(\n                    self.continuous_request(proxy, proxy_type)\n                ) for proxy_type, proxy in auto.proxies\n            ]\n            \n            try:\n                await asyncio.gather(*tasks)\n            except Exception as e:\n                log(f\"Error in auto mode: {str(e)}\")\n                log(\"All proxy tasks failed, rescanning...\")\n\n    async def run_rotated_continuous(self, proxy: str, proxy_type: str):\n        log(f\"Starting continuous rotated mode with proxy {proxy_type}://{proxy}\")\n        \n        tasks = [\n            asyncio.create_task(\n                self.continuous_request(proxy, proxy_type)\n            ) for _ in range(self.concurrency * 5)\n        ]\n        \n        await asyncio.gather(*tasks)\n\nclass Auto:\n    def __init__(self):\n        self.proxies = []\n        try:\n            with open(\"auto/http.txt\", \"r\") as file:\n                self.http_sources = file.read().splitlines()\n                log(f\"Loaded {len(self.http_sources)} HTTP proxy sources\")\n                \n            with open(\"auto/socks4.txt\", \"r\") as file:\n                self.socks4_sources = file.read().splitlines()\n                log(f\"Loaded {len(self.socks4_sources)} SOCKS4 proxy sources\")\n                \n            with open(\"auto/socks5.txt\", \"r\") as file:\n                self.socks5_sources = file.read().splitlines()\n                log(f\"Loaded {len(self.socks5_sources)} SOCKS5 proxy sources\")\n                \n        except FileNotFoundError as e:\n            log(f\"ERROR: Auto file not found - {str(e)}\")\n            exit(0)\n        \n        log(\"Starting proxy scraping from sources...\")\n\n    async def scrap(self, source_url, proxy_type):\n        try:\n            async with aiohttp.ClientSession() as session:\n                headers = {\"user-agent\": UserAgent().random}\n                log(f\"Scraping {proxy_type} proxies from {source_url}\")\n                async with session.get(\n                    source_url, headers=headers, timeout=aiohttp.ClientTimeout(total=15)\n                ) as response:\n                    html = await response.text()\n                    matches = REGEX.finditer(html)\n                    found_proxies = [(proxy_type, match.group(1)) for match in matches]\n                    self.proxies.extend(found_proxies)\n                    log(f\"Found {len(found_proxies)} {proxy_type} proxies from {source_url}\")\n\n        except Exception as e:\n            log(f\"ERROR: Failed to scrape from {source_url} - {str(e)[:100]}\")\n            with open(\"error.txt\", \"a\", encoding=\"utf-8\", errors=\"ignore\") as f:\n                f.write(f\"{source_url} -> {e}\\n\")\n\n    async def init(self):\n        tasks = []\n        self.proxies.clear()\n        sources_list = [\n            (self.http_sources, \"http\"),\n            (self.socks4_sources, \"socks4\"),\n            (self.socks5_sources, \"socks5\"),\n        ]\n\n        for sources, proxy_type in sources_list:\n            tasks.extend([self.scrap(source_url, proxy_type) for source_url in sources])\n\n        await asyncio.gather(*tasks)\n        log(f\"Proxy scraping complete. Total proxies found: {len(self.proxies)}\")\n\nasync def main():\n    parser = ArgumentParser()\n    parser.add_argument(\"-c\", \"--channel\", dest=\"channel\", help=\"Channel user Without @ (e.g: MyChannel1234)\", type=str, required=True)\n    parser.add_argument(\"-pt\", \"--post\", dest=\"post\", help=\"Post number (ID) (e.g: 1921)\", type=int, required=True)\n    parser.add_argument(\"-t\", \"--type\", dest=\"type\", help=\"Proxy type (e.g: http)\", type=str, required=False)\n    parser.add_argument(\"-m\", \"--mode\", dest=\"mode\", help=\"Proxy mode (list | auto | rotate)\", type=str, required=True)\n    parser.add_argument(\"-p\", \"--proxy\", dest=\"proxy\", help=\"Proxy file path or user:password@host:port\", type=str, required=False)\n    parser.add_argument(\"-cc\", \"--concurrency\", dest=\"concurrency\", help=\"Maximum concurrent requests\", type=int, default=200)\n    args = parser.parse_args()\n    \n    log(f\"Telegram Auto Views started with mode: {args.mode}\")\n    api = Telegram(args.channel, args.post, args.concurrency)\n    \n    if args.mode[0] == \"l\":\n        with open(args.proxy, \"r\") as file:\n            lines = file.read().splitlines()\n        log(f\"Loaded {len(lines)} proxies from file {args.proxy}\")\n        await api.run_proxies_continuous(lines, args.type)\n\n    elif args.mode[0] == \"r\":\n        log(f\"Starting rotated mode with single proxy: {args.proxy}\")\n        await api.run_rotated_continuous(args.proxy, args.type)\n\n    else:\n        await api.run_auto_continuous()\n\nif __name__ == \"__main__\":\n    log(\"Program started\")\n    try:\n        asyncio.run(main())\n    except KeyboardInterrupt:\n        log(\"Program terminated by user\")\n    except Exception as e:\n        log(f\"Unhandled exception: {str(e)}\")"
  },
  {
    "path": "requirements.txt",
    "content": "aiohttp==3.11.16\r\naiohttp_socks==0.10.1\r\nfake-useragent==2.1.0"
  }
]