diff options
author | halcy <halcy@ARARAGI-KUN> | 2022-11-13 13:35:38 +0200 |
---|---|---|
committer | halcy <halcy@ARARAGI-KUN> | 2022-11-13 13:35:38 +0200 |
commit | c670ed8ce26749442c180dbf8a0a60c153f5d5c4 (patch) | |
tree | 22bf23e6ff941d138d08b637f17be683d0f77990 /docs | |
parent | fdb6e2a140c4f103602e04d782dfbd849e2de788 (diff) | |
download | mastodon.py-c670ed8ce26749442c180dbf8a0a60c153f5d5c4.tar.gz |
Update information about dicts (media colors, card blurhash)
Diffstat (limited to 'docs')
-rw-r--r-- | docs/index.rst | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/docs/index.rst b/docs/index.rst index 650a497..667ab1c 100644 --- a/docs/index.rst +++ b/docs/index.rst | |||
@@ -571,12 +571,12 @@ Media dicts | |||
571 | 'remote_url': # The remote URL for the media (if the image is from a remote instance) | 571 | 'remote_url': # The remote URL for the media (if the image is from a remote instance) |
572 | 'preview_url': # The URL for the media preview | 572 | 'preview_url': # The URL for the media preview |
573 | 'text_url': # The display text for the media (what shows up in toots) | 573 | 'text_url': # The display text for the media (what shows up in toots) |
574 | 'meta': # Dictionary of two image metadata dicts (see below), | 574 | 'meta': # Dictionary of two metadata dicts (see below), |
575 | # 'original' and 'small' (preview). Either may be empty. | 575 | # 'original' and 'small' (preview). Either may be empty. |
576 | # May additionally contain an "fps" field giving a videos frames per second (possibly | 576 | # May additionally contain an "fps" field giving a videos frames per second (possibly |
577 | # rounded), and a "length" field giving a videos length in a human-readable format. | 577 | # rounded), and a "length" field giving a videos length in a human-readable format. |
578 | # Note that a video may have an image as preview. | 578 | # Note that a video may have an image as preview. |
579 | # May also contain a 'focus' dict. | 579 | # May also contain a 'focus' dict and a media 'colors' dict. |
580 | 'blurhash': # The blurhash for the image, used for preview / placeholder generation | 580 | 'blurhash': # The blurhash for the image, used for preview / placeholder generation |
581 | 'description': # If set, the user-provided description for this media. | 581 | 'description': # If set, the user-provided description for this media. |
582 | } | 582 | } |
@@ -598,6 +598,12 @@ Media dicts | |||
598 | 'duration': # Duration of the video in seconds | 598 | 'duration': # Duration of the video in seconds |
599 | 'bitrate': # Average bit-rate of the video in bytes per second | 599 | 'bitrate': # Average bit-rate of the video in bytes per second |
600 | } | 600 | } |
601 | |||
602 | # Metadata dicts (audio) - all fields are optional: | ||
603 | { | ||
604 | 'duration': # Duration of the audio file in seconds | ||
605 | 'bitrate': # Average bit-rate of the audio file in bytes per second | ||
606 | } | ||
601 | 607 | ||
602 | # Focus Metadata dict: | 608 | # Focus Metadata dict: |
603 | { | 609 | { |
@@ -605,6 +611,12 @@ Media dicts | |||
605 | 'y': Focus point x coordinate (between -1 and 1) | 611 | 'y': Focus point x coordinate (between -1 and 1) |
606 | } | 612 | } |
607 | 613 | ||
614 | # Media colors dict: | ||
615 | { | ||
616 | 'foreground': # Estimated foreground colour for the attachment thumbnail | ||
617 | 'background': # Estimated background colour for the attachment thumbnail | ||
618 | 'accent': # Estimated accent colour for the attachment thumbnail | ||
619 | |||
608 | Card dicts | 620 | Card dicts |
609 | ~~~~~~~~~~ | 621 | ~~~~~~~~~~ |
610 | .. _card dict: | 622 | .. _card dict: |
@@ -629,6 +641,7 @@ Card dicts | |||
629 | 'html': # HTML string of the embed | 641 | 'html': # HTML string of the embed |
630 | 'provider_name': # Name of the provider from which the embed originates | 642 | 'provider_name': # Name of the provider from which the embed originates |
631 | 'provider_url': # URL pointing to the embeds provider | 643 | 'provider_url': # URL pointing to the embeds provider |
644 | 'blurhash': # (optional) Blurhash of the preview image | ||
632 | } | 645 | } |
633 | 646 | ||
634 | Search result dicts | 647 | Search result dicts |