Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

a solution to dictionary key missed problem due to the vmess provider. #17

@liuliping0315

Description

@liuliping0315

"message node" are provided by some airports.
like
add: "127.0.0.1" with some alias like "Remaining Traffic", "Avai Date".

vmess2json will complain due to the dict "_vinfo" lacking one of the keys in {"ps", "add", "port", "net"}

Temp Solution:
I change the code at line 651 in vmess2json.py
from

    if _vinfo is not None:
         vmesses.append({ "ps": "[{ps}] {add}:{port}/{net}".format(**_vinfo), "vm": _v })

to

        if _vinfo is not None:
            #if _vinfo["add"] == "127.0.0.1":
            #    continue
            needed_keys = {"ps", "add", "port", "net"}
            if needed_keys.issubset(_vinfo.keys()):
                vmesses.append({ "ps": "[{ps}] {add}:{port}/{net}".format(**_vinfo), "vm": _v })

However, I'm not sure other keys should be considered, and I'm too busy to understand vmess and this convert code. I cannot provide a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions