Args: url: The URL of the resource to be embedded width: The width of the embedded object (optional) height: The height of the embedded object (optional) name: A unique name for the block to reference when adding text or embedding (optional)
(self, url: str, width: int = 960, height: int = 540, name: BlockId = None, label: str = None)
| 181 | _tag = "Embed" |
| 182 | |
| 183 | def __init__(self, url: str, width: int = 960, height: int = 540, name: BlockId = None, label: str = None): |
| 184 | """ |
| 185 | Args: |
| 186 | url: The URL of the resource to be embedded |
| 187 | width: The width of the embedded object (optional) |
| 188 | height: The height of the embedded object (optional) |
| 189 | name: A unique name for the block to reference when adding text or embedding (optional) |
| 190 | label: A label used when displaying the block (optional) |
| 191 | """ |
| 192 | |
| 193 | result = get_embed_url(url, width=width, height=height) |
| 194 | |
| 195 | # if "html" not in result: |
| 196 | # raise DPClientError(f"Can't embed result from provider for URL '{url}'") |
| 197 | super().__init__( |
| 198 | content=result.html, name=name, label=label, url=url, title=result.title, provider_name=result.provider |
| 199 | ) |
nothing calls this directly
no test coverage detected