Skip to main content

PTPImg uploader, handles local files and URLs, from the commandline

Project description

PyPI version Build Status

Upload image file or image URL to the ptpimg.me image hosting.

Installation

Using pip:

pip install ptpimg_uploader

Using setup.py:

python setup.py install

Manually:

  • Install python3 package requests (usually apt-get install python3-requests or pip3 install requests).

  • If you want clipboard support, install pyperclip too.

API key

To find your PTPImg API key, login to https://ptpimg.me, open the page source (i.e. “View->Developer->View source” menu in Chrome), find the string api_key and copy the hexademical string from the value attribute. Your API key should look like 43fe0fee-f935-4084-8a38-3e632b0be68c.

You can export your ptpimg.me API key (usually in .bashrc or .zshenv) using:

export PTPIMG_API_KEY=<your hex key>

or use the -k / --api-key command-line switch.

How to use

Run

ptpimg_uploader -h

to get command-line help.

To upload an image file:

ptpimg_uploader ~/seed/mytorrent/folder.jpg

To rehost an imgur image:

ptpimg_uploader https://i.imgur.com/eaT6j3X.jpg

An uploaded URL will be printed to the console.

If --bbcode parameter is specified, URLS will be wrapped in BBCode [img] tags:

ptpimg_uploader --bbcode ~/seed/mytorrent/folder.jpg

If pyperclip python package is installed, the URL will be additionally copied to the clipboard. Additionally, you can upload an URL from the clipboard:

ptpimg_uploader --clip

If output is a terminal, a bell will be ringed on completion (can be disabled with a --nobell parameter).

You can specify multiple files and URLs on the command line:

ptpimg_uploader ~/seed/mytorrent/folder.jpg https://i.imgur.com/eaT6j3X.jpg

The resulting URLs are printed each on separate line, and copied to your clipboard with newlines in between.

License

BSD

Acknowledgments

  • mjpieters - a great refactoring and Python packaging

  • lukacoufyl - fixing image upload order

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

ptpimg_uploader-0.9.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

ptpimg_uploader-0.9-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file ptpimg_uploader-0.9.tar.gz.

File metadata

  • Download URL: ptpimg_uploader-0.9.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for ptpimg_uploader-0.9.tar.gz
Algorithm Hash digest
SHA256 2e7dbf55a2e68a2a0a1817a24a8ebf6ac0c500e575cb6b11a5fe27c03cee72b5
MD5 e034d260039f739945e229a79d86b949
BLAKE2b-256 77d7f236d2ad814579e713171b0f55a781df50530b53fcfb930296985c8a6bfe

See more details on using hashes here.

File details

Details for the file ptpimg_uploader-0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for ptpimg_uploader-0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 56044f206e8059bd18da0f0197c0e4735b2106964bd126cdf720cb74de849ac2
MD5 4723f20fbb4a6a655485eeea38f19027
BLAKE2b-256 c33e3e397707bc9dde2f6e405ce6064daa4e0e9ef6aa0de1c293195b3c8471ed

See more details on using hashes here.

Supported by

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