sxcu.SXCU¶
-
class
sxcu.
SXCU
(subdomain: str = None, upload_token: str = None, file_sxcu: str = None)¶ The Main class for sxcu.net request
-
__init__
(subdomain: str = None, upload_token: str = None, file_sxcu: str = None) → None¶ This initialise the handler
- Parameters
subdomain (
str
, optional) – The subdomain you get from sxcu.netupload_token (
str
, optional) – The upload token that comes along with subdomainfile_sxcu (
str
,optional) –The sxcu file you have got. Parses only
RequestURL
andupload_token
.Note
The content in
.scxu
file has more priority than passed parameters.
Methods
This initialise the handler
Get collection details and list of images (if any are uploaded) for a given collection
Create a new collection on sxcu.net.
Creates a new link.
Deletes images from sxcu.net
This lists all the public domains available, sorted by upload count.
Edit an existing collection.
Get basic details about an image on sxcu.net or any of its subdomain
This uploads image to sxcu
Uploads an text to sxcu.net (via cancer-co.de)
-
static
collection_details
(collection_id: str) → Union[dict, list]¶ Get collection details and list of images (if any are uploaded) for a given collection
-
static
create_collection
(title: str, private: bool = False, unlisted: bool = False, desc: str = None) → Union[dict, list]¶ Create a new collection on sxcu.net.
Note
If you are creating one time / bot collections you must make them unlisted!
- Parameters
- Returns
The returned JSON from the request.
- Return type
-
static
domain_list
(count: int = - 1) → list¶ This lists all the public domains available, sorted by upload count.
- Parameters
count (
int
, optional) – Number of domains to return. If count=``-1`` it lists all.
- :param .. warning::: The returned list contains bytes. Using
str.encode()
. Please use bytes.decode()
for decoding it.
- Returns
The returned JSON from the request.
- Return type
-
static
edit_collection
(collection_id: str, collection_token: str, title: str = None, desc: str = None, unlisted: bool = False, regen_token: bool = False, empty_collection: bool = False, delete_collection: bool = False) → dict¶ Edit an existing collection.
- Parameters
collection_id (
str
) – The ID of the collection to be edited.collection_token (
str
) – The current token of that collection.title (
str
, optional) – The new title of the collection.desc (
str
, optional) – The new description of the collection.unlisted (
bool
, optional) – IfTrue
the collection will be made unlisted.regen_token (
bool
, optional) – IfTrue
, it will generate a new token for the collection and return it in the response.empty_collection (
bool
, optional) – IfTrue
it will disassociate all of the images in the collection from it.delete_collection (
bool
, optional) – IfTrue
it will disassociate all of the images in the collection from it and delete the collection.
- Returns
The returned JSON from the request.
- Return type
-
static
image_details
(image_id: str = None, image_url: str = None) → Union[dict, list]¶ Get basic details about an image on sxcu.net or any of its subdomain
- Parameters
image_id (
str
) –The id of the image. For example, if
https://sxcu.net/QNeo92
is the image URL thenQNeo92
will be theimage_id
.Note
The
image_id
can be from any subdomain also as alway the id would be same.imageUrl (
str
) – The image URL returned of sucessful upload.For example,https://sxcu.net/QNeo92
.
- Returns
The returned JSON from the request.
- Return type
-
upload_image
(file: str, collection: str = None, collection_token: str = None, noembed: bool = False, og_properties: sxcu.sxcu.og_properties = None) → Union[dict, list]¶ This uploads image to sxcu
- Parameters
file (
str
, optional) – The path of File to Uploadcollection (
str
, optional) – The collection ID to which you want to upload to if you want to upload to a collectioncollection_token (
str
, optional) – The collection upload token if one is required by the collection you’re uploading to.noembed (
bool
, optional) – IfTrue
, the uploader will return a direct URL to the uploaded image, instead of a dedicated page.og_properties (
og_properties
, optional) – This will configure the OpenGraph properties of the file’s page, effectively changing the way it embeds in various websites and apps.
- Returns
The returned JSON from the request.
- Return type
-