Giter Site home page Giter Site logo

marzpy's Introduction

Typing SVG

Top Langs

marzpy's People

Contributors

erfantech avatar erfjab avatar mewhrzad avatar ntenoughsleep avatar urbnywrt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

marzpy's Issues

Add Log

Hi, the next stage of your project development can be logged, it's a good idea and efficient. The ability to set up like the panel would be great.

error create user

panel = Marzban('user'pass'.', 'https://....')
mytoken = await panel.get_token()
print(mytoken)
try:
new_user = User(
username="Mewhrzad",
proxies={
"vmess": {"id": "35e7e39c-7d5c-1f4b-8b71-508e4f37ff53"},
},
inbounds={"vmess": ["VMess TCP"]},
expire=0,
data_limit=0,
data_limit_reset_strategy="no_reset",
)
result = await panel.add_user(user=new_user, token=mytoken) # return new User object
print(result.username)
except Exception as ex:
print(ex)

return :
module aiohttp has no attribute exceptions

خطای عدم وجود `usage_coefficient` در کلاس نود

سلام صفت usage_coefficient که در آپدیت جدید مرزبان به نود ها اضافه شده در کتابخانه وجود نداره.
خطای گرفته شده:

  File ".venv/lib/python3.11/site-packages/marzpy/api/node.py", line 106, in get_all_nodes
    node_list.append(Node(**node))
                     ^^^^^^^^^^^^
TypeError: Node.__init__() got an unexpected keyword argument 'usage_coefficient'

من این مشکل رو با اضافه کردن این اتریبیوت به کلاس Node برای خودم حل کردم:

class Node:
    def __init__(
        self,
        name="",
        address="",
        port=0,
        api_port=0,
        certificate="",
        id=0,
        xray_version="",
        status="",
        message="",
        usage_coefficient=0 # new
    ):
        self.name = name
        self.address = address
        self.port = port
        self.api_port = api_port
        self.certificate = certificate
        self.id = id
        self.xray_version = xray_version
        self.status = status
        self.message = message
        self.usage_coefficient = usage_coefficient # new

Error when add user

TypeError: User.init() got an unexpected keyword argument 'note'

It looks like Marzban has been updated and returns a new 'note' property in the response
https://api.marzban.dev/#tag/User/operation/add_user
{
"proxies": { },
"expire": 0,
"data_limit": 0,
"data_limit_reset_strategy": "no_reset",
"inbounds": { },
"note": "string",
"sub_updated_at": "2019-08-24T14:15:22Z",
"sub_last_user_agent": "string",
"online_at": "2019-08-24T14:15:22Z",
"on_hold_expire_duration": 0,
"on_hold_timeout": "2019-08-24T14:15:22Z",
"username": "string",
"status": "active",
"used_traffic": 0,
"lifetime_used_traffic": 0,
"created_at": "2019-08-24T14:15:22Z",
"links": [ ],
"subscription_url": "",
"excluded_inbounds": { }
}

New properties also:

    sub_updated_at="",
    sub_last_user_agent="",
    online_at="",
    on_hold_expire_duration="",
    on_hold_timeout="",

Easy enabling/disabling user

Hello, community!
Tell me, please, can i enable user in Marzban by Marzpy without sending all required parameters?
I need to send method 'modify_user' with all proxies and inbounds, but enabling or disabling user is elementary action and can i do it by sending request only with username?
If i sending 'modify_user' without proxies and inbounds i get:
TypeError: User.__init__() missing 2 required positional arguments: 'proxies' and 'inbounds'

note در آپدیت جدید

سلام.
اکثر فانکشن های پکیج این ارور رو دریافت میکنند.
TypeError: init() got an unexpected keyword argument 'note'
فکر میکنم بخاطر آپدیت جدید پنل مرزبان باشه.

add_node raise error

when i use :

token = await panel.get_token()
result = await panel.add_node(
        token,
        Node('france', 'fr.example.net')
    )

i get this error :

TypeError: Node.__init__() got an unexpected keyword argument 'usage_coefficient'

but the node is created in the panel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.