Frame

class compuglobal.Frame(api, frame_json)

Represents a single frame of a TVShow/Movie/Skit generated using an instance of CompuGlobalAPI.

Parameters
  • api (CompuGlobalAPI) – The CompuGlobalAPI object that was used to generate the screencap.

  • frame_json (dict) – The json response from the API for the screencap.

Variables
  • json (dict) – The json response used to create the frame.

  • id (int) – The ID of the frame.

  • key (str) – The episode key (S01E01) of the frame.

  • timestamp (int) – The timestamp of the frame.

  • image_url (str) – The direct url for the frame image.

get_meme_url(caption=None)

Encodes the caption with base64 and then returns the meme url for the frame with an embedded caption.

Parameters

caption (str) – The caption to embed in the image.

Returns

The meme url for the frame with an embedded caption.

Return type

str

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