Skip to content
This repository has been archived by the owner on Dec 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #122 from TeamKillerX/dev
Browse files Browse the repository at this point in the history
_
  • Loading branch information
xtsea authored Oct 4, 2024
2 parents e98e82d + 407d757 commit f924d5a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 34 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
> RyuzakiLib is used to help your account activities on Telegram<br>We are not responsible for what you misuse in this repository!<br>Be careful when using this repository!<br>If one of the members misuses this repository, we are forced to ban you<br>Never ever abuse this repository
# Installing
* `pip3 install -U RyuzakiLib`
- example: `RyuzakiLib[porno]`, `RyuzakiLib[standard]`, `RyuzakiLib[all]`

* `pip3 install -U RyuzakiLib[all]`
* windows or linux
```
pip3 install git+https://github.com/TeamKillerX/RyuzakiLib
pip3 install git+https://github.com/TeamKillerX/RyuzakiLib.git#egg=RyuzakiLib[all]
```

* Only Developed by
Expand Down
2 changes: 1 addition & 1 deletion RyuzakiLib/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.3.4"
__version__ = "1.3.5"
33 changes: 2 additions & 31 deletions RyuzakiLib/hackertools/alldownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import httpx
import requests
import wget
from fastapi import HTTPException


class DictToObj:
Expand All @@ -25,40 +24,12 @@ class AkenoPlus:
def __init__(
self,
key: str = None,
api_endpoint: str = "https://private-akeno.randydev.my.id",
issue: bool = False,
ip_unban=None
api_endpoint: str = "https://private-akeno.randydev.my.id"
):
self.issue = issue

self.api_endpoint = api_endpoint
self.headers = {"x-akeno-key": key}

if isinstance(ip_unban, str):
self.ip_unban = [ip_unban]
elif isinstance(ip_unban, list):
self.ip_unban = ip_unban
else:
self.ip_unban = []

async def all_blacklist(self):
async with httpx.AsyncClient() as client:
try:
response = await client.get(f"{self.api_endpoint}/blacklist/list-ip/", headers=self.headers)
response.raise_for_status()
return response.json()["blacklisted_ips"]
except httpx.HTTPStatusError:
return []
except Exception:
return []

async def call_next(self, request, call_next):
banned_ips = await self.all_blacklist()
client_ip = request.headers.get("X-Real-IP") or request.client.host
if self.issue and client_ip in banned_ips and client_ip not in self.ip_unban:
raise HTTPException(status_code=403, detail="Your IP is banned.")
response = await call_next(request)
return response

async def download_now(self, data):
return wget.download(data)

Expand Down
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ def read(fname, version=False):
"aiohttp",
"wget",
"requests",
"httpx[http2]",
],
"standard": [
"g4f",
"httpx[http2]",
"typing",
"aiohttp",
"bs4",
Expand All @@ -53,6 +55,11 @@ def read(fname, version=False):
"motor",
"typing-extensions",
"huggingface-hub>=0.23.2",
"authlib",
"gpytranslate",
"fastapi[all]",
"uvicorn[standard]",
"pyrogram",
],
"all": [
"aiohttp",
Expand Down

0 comments on commit f924d5a

Please sign in to comment.