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.net

  • upload_token (str, optional) – The upload token that comes along with subdomain

  • file_sxcu (str,optional) –

    The sxcu file you have got. Parses only RequestURL and upload_token.

    Note

    The content in .scxu file has more priority than passed parameters.

Methods

__init__

This initialise the handler

collection_details

Get collection details and list of images (if any are uploaded) for a given collection

create_collection

Create a new collection on sxcu.net.

create_link

Creates a new link.

delete_image

Deletes images from sxcu.net

domain_list

This lists all the public domains available, sorted by upload count.

edit_collection

Edit an existing collection.

image_details

Get basic details about an image on sxcu.net or any of its subdomain

upload_image

This uploads image to sxcu

upload_text

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

Parameters

collection_id (str) – collection_id returned when creating a collection.

Returns

The returned JSON from the request.

Return type

dict or list

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
  • title (str) – The title of the collection.

  • private (bool, optional) – Whether the collection should be private or not.

  • unlisted (bool, optional) – Whether the collection should be unlisted or not.

  • desc (str, optional) – The description of the collection.

Returns

The returned JSON from the request.

Return type

dict or list

Creates a new link.

Parameters

link (str) – The link to which you want to redirect.

Returns

The returned JSON from the request.

Return type

dict or list

static delete_image(delete_url: str)bool

Deletes images from sxcu.net

Parameters

delete_url (str) – The delete URL returned from sxcu.net while uploading.

Returns

Deleted or not

Return type

bool

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.

  • 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

list

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) – If True the collection will be made unlisted.

  • regen_token (bool, optional) – If True, it will generate a new token for the collection and return it in the response.

  • empty_collection (bool, optional) – If True it will disassociate all of the images in the collection from it.

  • delete_collection (bool, optional) – If True 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

dict

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 then QNeo92 will be the image_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

dict or list

upload_image(file: str, collection: str = None, collection_token: str = None, noembed: bool = False, og_properties: sxcu.sxcu.OGProperties = None) → Union[dict, list]

This uploads image to sxcu

Parameters
  • file (str, optional) – The path of File to Upload

  • collection (str, optional) – The collection ID to which you want to upload to if you want to upload to a collection

  • collection_token (str, optional) – The collection upload token if one is required by the collection you’re uploading to.

  • noembed (bool, optional) – If True, the uploader will return a direct URL to the uploaded image, instead of a dedicated page.

  • og_properties (OGProperties, 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

dict or list

static upload_text(text: str) → Union[dict, list]

Uploads an text to sxcu.net (via cancer-co.de)

Parameters

text (str) – The text being uploaded.

Returns

The returned JSON from the request.

Return type

dict or list