Skip to main content

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

Project description

Latest release on the ptpimg-uploader (PyPI)

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.

Run the script from the command line with python3 ptimg_uploader.py

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 pyperclip python package is installed, the URL will be additionally copied to the clipboard.

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

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.2.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

ptpimg_uploader-0.2-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ptpimg_uploader-0.2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.6

File hashes

Hashes for ptpimg_uploader-0.2.tar.gz
Algorithm Hash digest
SHA256 a44ee8c53e7f4bed16abac0b99f0f9a802f00d1b5a62d1704a9380dd2c53ff29
MD5 a1b99f64bf7e9e90b46a30948b8436bf
BLAKE2b-256 95a17f6246ab042a9e41729c62f559f1837e085b9145dea2fafe9e80237e475e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ptpimg_uploader-0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.6

File hashes

Hashes for ptpimg_uploader-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9aef6ee3084420ca9314133fe426c365747a61e73fe6adecf4ceaee0617417ce
MD5 7f708ea1558fb308766e4818043e6028
BLAKE2b-256 cd9b15edce19a1b02746e9fb3c4a9cfedbcf232576cfaeaf33c5c4a35b90660b

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