SlyTwitter.twitter_upload#

Twitter API v1.1 for uploading media

Functions

get_upload_info(ext, is_dm)

Classes

Media(source)

TwitterUpload(auth)

SlyTwitter.twitter_upload.get_upload_info(ext, is_dm)[source]#
Parameters:
class SlyTwitter.twitter_upload.Media(source)[source]#

Bases: object

Parameters:

source (int | dict[str, int | float | bool | str | None | list['JsonType'] | dict[str, 'JsonType']]) –

id: int#
class SlyTwitter.twitter_upload.TwitterUpload(auth)[source]#

Bases: WebAPI

Parameters:

auth (OAuth1) –

base_url: str = 'https://upload.twitter.com/1.1/'#
get_full_url(path)[source]#

Convert a relative path to an absolute url for this API

Parameters:

path (str) –

Return type:

str

await add_alt_text(media, text)[source]#
Parameters:
await init_upload(type_, size, category)[source]#
Parameters:
  • type_ (str) –

  • size (int) –

  • category (str) –

await append_upload(media, index, chunk)[source]#
Parameters:
await finalize_upload(media)[source]#
Parameters:

media (Media) –

await check_upload_status(media)[source]#
Parameters:

media (Media) –

await upload(file_)[source]#
Parameters:

file_ (str | tuple[bytes, str]) –

Return type:

Media