Skip to main content

Bunkrr uploader supporting parallel uploads

Project description

Bunkrr Uploader

PyPI - Python Version PyPI - Version

A python script to upload files or directories to Bunkrro Built using asyncio, aiohttp, and tqdm

Supports

  • Bunkrr accounts
  • TODO: Private and public directory uploads
  • Parallel uploads
  • Retries
  • Progress bars
  • TODO: Upload logging
  • TODO: Skipping duplicate uploads

Usage

  1. pip install BunkrrUploader
usage: bunkrr-upload [-h] [-t TOKEN] [-z {na,eu}] [-f FOLDER] [-d]
                     [--debug-save-js-locally | --no-debug-save-js-locally]
                     [-c CONNECTIONS] [--public | --no-public]
                     [--save | --no-save] [--use-config | --no-use-config]
                     [-r RETRIES]
                     file

Bunkrro Uploader supporting parallel uploads

positional arguments:
  file                  File or directory to look for files in to upload

options:
  -h, --help            show this help message and exit
  -t TOKEN, --token TOKEN
                        API token for your account so that you can upload to a
                        specific account/folder. You can also set the
                        GOFILE_TOKEN environment variable for this
  -z {na,eu}, --zone {na,eu}
                        Server zone to prefer uploading to
  -f FOLDER, --folder FOLDER
                        Folder to upload files to overriding the directory
                        name if used
  -d, --dry-run         Don't create folders or upload files
  --debug-save-js-locally, --no-debug-save-js-locally
                        Debug option to save the retrieved js file locally
  -c CONNECTIONS, --connections CONNECTIONS
                        Maximum parallel uploads to do at once
  --public, --no-public
                        Make all files uploaded public. By default they are
                        private and not unsharable
  --save, --no-save     Don't save uploaded file urls to a
                        "bunkrr_upload_<unixtime>.csv" file
  --use-config, --no-use-config
                        Whether to create and use a config file in
                        $HOME/.config/bunkrr_upload/config.json
  -r RETRIES, --retries RETRIES
                        How many times to retry a failed upload

Details

Duplicate Files

If you try to upload a file and it already exists then the upload will be skipped. This comparison is based on MD5 sums, This check is based on the account being used. You can upload the same file twice to an account if different directories were specified.

History

Configs are stored in $HOME/.config/bunkrr_upload/config.json and all successful uploads and md5 sum hashes will be saved in there. Each time you complete an upload a bunkrr_upload_<timestamp>.csv will be created with the items uploaded and the following metadata: filePath,filePathMD5,fileNameMD5,uploadSuccess,code,downloadPage,fileId,fileName,guestToken,md5,parentFolder

Examples

Given

directory/
├── sample2.mkv
└── sample.mkv

Upload single file anonymously

bunkrr-upload directory/sample.mkv

Upload single file to your account

bunkrr-upload --token 123 foo directory/sample.mkv

Upload single file to directory foo in your account

bunkrr-upload --token 123 --folder foo directory/sample.mkv

Upload directory to your account

bunkrr-upload --token 123 directory

Upload directory to directory foo in your account

bunkrr-upload --token 123 --folder foo directory

Development

Optional Prerequesites

pyenv install 3.9

Setup

pip install -r requirements-dev.txt
pre-commit install

Packaging

python3 -m build
python3 -m twine upload --skip-existing --repository pypi dist/*

Improvements Wishlist

  • Update README
  • Make it work
  • Add file zipping and cleanup
  • Add tests
  • Add github runners for tests
  • Recursive directory upload support

Thanks

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

bunkrruploader-0.10.7.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

BunkrrUploader-0.10.7-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file bunkrruploader-0.10.7.tar.gz.

File metadata

  • Download URL: bunkrruploader-0.10.7.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for bunkrruploader-0.10.7.tar.gz
Algorithm Hash digest
SHA256 3cdff53fcdfcbb9971030f1bcba697fdefa465831da609d646e0aaeeac43edb3
MD5 2cafccc74532b0bc6e5435ebb6388459
BLAKE2b-256 b6134467e99af4cdac7b8eaf4b2ba591f5a90f1744cc273b5e05d40db834d104

See more details on using hashes here.

File details

Details for the file BunkrrUploader-0.10.7-py3-none-any.whl.

File metadata

File hashes

Hashes for BunkrrUploader-0.10.7-py3-none-any.whl
Algorithm Hash digest
SHA256 0224c40c03c0e3adde1b135710808c70bc50d1d467346be93780a9f42618b615
MD5 fc5d25ee302c9f39246c043adc86ef1a
BLAKE2b-256 72bf66f8ea09231a0798c9884a15f66cf9464ae82cf46a280755a3293ba0b6b7

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