Skip to main content

OpenFrpLib

based on OpenFrp OPENAPI
presented by LxHTT

这是一个封装了OpenFrp OPENAPI的Python库。

安装


pip install OpenFrpLib

开始使用


导入

import OpenFrpLib

设置是否绕过系统代理

from OpenFrpLib import BYPASS_SYSTEM_PROXY

BYPASS_SYSTEM_PROXY(True) # True为开启绕过, False不绕过

登录

现在会打开浏览器提示授权,授权后会返回SessionID和Authorization

from OpenFrpLib import login

# 用一个列表存取,方便记录SessionID和Authorization
LoginInfo = login()

获取用户信息

from OpenFrpLib import getUserInfo

getUserInfo(Authorization="Authorization内容", session="Session ID")

获取用户隧道列表

from OpenFrpLib import getUserProxies

getUserProxies(Authorization="Authorization内容", session="Session ID")

新建隧道

from OpenFrpLib import newProxy
# 含有Optional为可选
newProxy(Authorization: str,
         session: str,
         node_id: int,
         type: str,
         remote_port: int,
         local_addr: Optional[str] = "127.0.0.1",
         local_port: Optional[int] = 25565,
         domain_bind: Optional[str] = "",
         host_rewrite: Optional[str] = "",
         request_from: Optional[str] = "",
         custom: Optional[str] = "",
         dataGzip: Optional[bool] = False,
         dataEncrypt: Optional[bool] = False,
         url_route: Optional[str] = "",
         name: Optional[str] = f"OfApp_{randint(30000, 99999)}",
         request_pass: Optional[str] = ""
        )

删除隧道

from OpenFrpLib import removeProxy
# 含有Optional为可选
removeProxy(Authorization="Authorization内容", session="Session ID", proxy_id="隧道ID")

获取节点列表

from OpenFrpLib import getNodeList
# 含有Optional为可选
getNodeList(Authorization="Authorization内容", session="Session ID")

编辑隧道

from OpenFrpLib import editProxy
# 含有Optional为可选
editProxy(Authorization: str,
          session: str,
          node_id: int,
          type: str,
          remote_port: int,
          proxy_id: int,
          local_addr: Optional[str] = "127.0.0.1",
          local_port: Optional[int] = 25565,
          domain_bind: Optional[str] = "",
          custom: Optional[str] = "",
          dataGzip: Optional[bool] = False,
          dataEncrypt: Optional[bool] = False,
          name: Optional[str] = f"OfApp_{randint(30000, 99999)}"
         )

签到

from OpenFrpLib import userSign

userSign(Authorization="Authorization内容", session="Session ID")
警告

请勿设计任何有关自动签到的相关功能,因为这是违反服务条款的行为,自动签到为滥用行为行为之一。

Metadata

Release files for OpenFrpLib 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for OpenFrpLib 1.4.0
File Size Uploaded
OpenFrpLib-1.4.0.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for OpenFrpLib 1.4.0
File Interpreter ABI Platform
OpenFrpLib-1.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.9 kB

Release files / OpenFrpLib-1.4.0.tar.gz

Download URL OpenFrpLib-1.4.0.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b930a113786cd2201195f5ac982d5119875dc332d2cccc02e29cbccb4535e285
BLAKE2b-256 checksum
How to use checksums
41f52c2dc7211951629f35adcdc36354051955ecaf9a97b91ab5e8ab67516302
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 1, 2025.

Transparency log

Release files / OpenFrpLib-1.4.0-py3-none-any.whl

Download URL OpenFrpLib-1.4.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
135ad4669f720fc4b40bc33a54caab2c1dde48649087c72aca0700dfb277761a
BLAKE2b-256 checksum
How to use checksums
72a27d3fbe217979bf68c815b14dc47406de040563e496e6a07935c3162a0735
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 1, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files

1.3.0

2 release files

1.2.4

1 release file

1.2.3

4 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page