Skip to main content

Free unlimited file hosting using Discord server

Project description

pyscord-storage

Free unlimited file hosting using Discord server


Installation

pip install pyscord-storage --upgrade

Example

Default
import pyscord_storage


filename = "ynm.jpg"
file = "https://raw.githubusercontent.com/animemoeus/pyscord-storage/master/sample.jpg"
# file = 'path/to/your/file'

data = pyscord_storage.upload(filename, file)
If you need to use custom http headers for get the file from URL, you can use the custom http headers like this:
import pyscord_storage

custom_headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
        "Referer": "pyscord-storage",
        "Custom-Header": "Lorem Ipsum Dolor Sit Amet",
    }

filename = "ynm.jpg"
file = "https://raw.githubusercontent.com/animemoeus/pyscord-storage/master/sample.jpg"
# file = 'path/to/your/file'

data = pyscord_storage.upload(filename, file, custom_headers)

Note: Try to change the User-Agent header if you get blocked by firewall rules when using the custom_headers.

Result

{
  "status": 200,
  "data": {
    "id": "860049950065819658",
    "filename": "ynm.jpg",
    "size": 130407,
    "url": "https://cdn.discordapp.com/attachments/858938620425404426/860049950065819658/ynm.jpg",
    "proxy_url": "https://media.discordapp.net/attachments/858938620425404426/860049950065819658/ynm.jpg",
    "width": 537,
    "height": 954,
    "content_type": "image/jpeg"
  }
}

API

About

Increase Upload Limit

Example Implementation

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

pyscord-storage-0.1.3.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

pyscord_storage-0.1.3-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

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