Skip to main content

bash curl transfer to requests

Project description

curl2req

把浏览器请求转换为 requests 请求的工具

用法

1 打开浏览器F12,右键 Copy -> Copy as cURL (bash) 2 把请求保存到文件,例如 .curl 3 运行命令

from curl2req import curl_to_req

curl_to_req('./.curl', "", ".res", output_file_prefix="samples-res-")

4 查看结果 vim .res/samples-res-xxx.json

5 查看 json 结构

from curl2req import get_json_paths
keys = get_json_paths(host, show=False)
for k in keys:
    k2 = k.replace('[]', '[0]')
    print(k, json_get_data(host, k2)[0])

上传

pip install build
rm -rf dist/* && python -m build
twine upload dist/*

pip install -e .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

curl2req-0.1.8.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

curl2req-0.1.8-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file curl2req-0.1.8.tar.gz.

File metadata

  • Download URL: curl2req-0.1.8.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for curl2req-0.1.8.tar.gz
Algorithm Hash digest
SHA256 f38b8231539af75a379ef6edc0d05c6f71b5e264240e808a6ebd2401b0fb4fe1
MD5 64a47242d11819517c95e807284ba193
BLAKE2b-256 86b469848603949ce0eb961eceb39b7c38128dcec3a8c77708e29672f70574a4

See more details on using hashes here.

File details

Details for the file curl2req-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: curl2req-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for curl2req-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 a87fbe47b24fcd5b11e2b0a9eefc9616989dfa3a80b08bea3df89a60d1e000ae
MD5 b88cdafcc47634cdb62d6510b3ce1886
BLAKE2b-256 a3319728618547e6db6f2299dfb35b3d8d7368fba72895cf01e402565c1a508b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page