Screencap¶
- class compuglobal.aio.AIOScreencap(api, json: dict)
- coroutine get_real_timestamp()¶
Gets a readable timestamp for the frame in format “mm:ss”
- Returns
A readable timestamp for the frame in format mm:ss.
- Return type
str
- coroutine get_image_url()¶
Returns the direct image url for the screencap without any caption.
- Returns
The image url for the screencap without any caption.
- Return type
str
- coroutine get_meme_url(caption=None)¶
Encodes the caption with base64 and then returns the meme url for the screencap with an embedded caption.
- Parameters
caption (str, optional) – The caption to embed in the image, if it is None, it will use the screencaps original caption.
- Returns
The meme url for the screencap with an embedded caption.
- Return type
str
- coroutine get_gif_url(caption=None, before=3000, after=4000)¶
Gets the timestamps of the frames before and after the timestamp of the screencap using the frames endpoint for the screencap’s API and returns the url for the gif with an embedded caption.
- Parameters
caption (str, optional) – The caption to embed in the gif, if it is None, it will use the screencaps original caption.
before (int, optional) – The number of milliseconds before the screencap’s timestamp to begin the gif, defaults to 3 seconds (3000ms).
after (int, optional) – The number of milliseconds after the screencap’s timestamp to begin the gif, defaults to 4 seconds (4000ms).
- Returns
The gif url for the screencap with an embedded caption.
- Return type
str
Note
Defaults gif duration to ~7 seconds (7000ms).
- coroutine get_mp4_url(caption=None, before=3000, after=4000)¶
Gets the timestamps of the frames before and after the timestamp of the screencap using the frames endpoint for the screencap’s API and returns the url for the mp4 with an embedded caption.
- Parameters
caption (str, optional) – The caption to embed in the mp4, if it is None, it will use the screencaps original caption.
before (int, optional) – The number of milliseconds before the screencap’s timestamp to begin the mp4, defaults to 3 seconds (3000ms).
after (int, optional) – The number of milliseconds after the screencap’s timestamp to begin the mp4, defaults to 4 seconds (4000ms).
- Returns
The mp4 url for the screencap with an embedded caption.
- Return type
str
Note
Defaults mp4 duration to ~7 seconds (7000ms).