Code Monkey home page Code Monkey logo

qiniu_handler's Introduction

说明

上传文件或网络文件到七牛

安装依赖

pip install qiniu requests fake_headers

使用方法

可选择是否配置 config.txt

若配置 config.txt, 请按以下方式编写配置文件

[QINIU]
access_key = access_key
secret_key = secret_key
domain = domain
bucket_name = bucket_name
python qiniu_handler.py -l {local_file} -b {bucket} -a {access_key} -s {secret_key} -d {domain}
python qiniu_handler.py -u {file_url} -b {bucket} -a {access_key} -s {secret_key} -d {domain}

参数说明

usage: qiniu_handler.py [-h] [-l LOCAL_FILE] [-p LOCAL_PATH] [-u URL]
                        [-b BUCKET_NAME] [-k KEY_NAME] [-d DOMAIN]
                        [-a ACCESS_KEY] [-s SECRET_KEY] [-db DOWNLOAD_BUCKET]
                        [-sp SAVE_PATH]

A script that upload file to qiniu 上传方式分为本地文件和url链接

optional arguments:
  -h, --help            show this help message and exit
  -l LOCAL_FILE, --local_file LOCAL_FILE
                        需要上传的文件路径
  -p LOCAL_PATH, --local_path LOCAL_PATH
                        需要上传的文件夹路径
  -u URL, --url URL     需要上传的文件的url地址
  -b BUCKET_NAME, --bucket_name BUCKET_NAME
                        七牛存储空间名称
  -k KEY_NAME, --key_name KEY_NAME
                        上传后的名字, 为空的由程序生成
  -d DOMAIN, --domain DOMAIN
                        七牛存储空间域名,为空使用程序默认
  -a ACCESS_KEY, --access_key ACCESS_KEY
                        qiniu access_key, 为空使用程序默认
  -s SECRET_KEY, --secret_key SECRET_KEY
                        qiniu secret_key, 为空使用程序默认
  -db DOWNLOAD_BUCKET, --download_bucket DOWNLOAD_BUCKET
                        下载指定空间的所有文件
  -sp SAVE_PATH, --save_path SAVE_PATH
                        下载文件的指定路径, 默认为当前目录

qiniu_handler's People

Contributors

scarecrowfu avatar

Watchers

 avatar  avatar

Forkers

dddark007

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.