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
- Max upload size limit is 8MB. Click here for detail.
- media.discordapp.net & cdn.discordapp.com. Click here for detail.
- proxy_url. Click here for detail.
- How long my Discord file link will work? Click here for detail.
Increase Upload Limit
- I don't know if this will work, but I think if the server gets a boost, we can increase the upload limit up to 50 MB or 100MB.
- https://support.discord.com/hc/en-us/articles/360028038352-Server-Boosting-FAQ-
- Discord Server https://discord.gg/kZuWeKzgkq
Example Implementation
Project details
Release history Release notifications | RSS feed
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-1.0.0.tar.gz
(3.6 kB
view hashes)
Built Distribution
Close
Hashes for pyscord_storage-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfb03c23da2647165f1115cf733d8bb823a2ea7385fe93de059f1ae5697729f0 |
|
MD5 | 48cf92babf5d1fdfce2af1438477b8e4 |
|
BLAKE2b-256 | ec93f3164cba3c4f9cbd53f1c3e62fed12d50845db3292c3c1be2a467d203baa |