Skip to content

Uploading an image as a blob to be used as a card image doesn't work ! #212

Answered by MarshalX
digfish asked this question in Questions
Discussion options

You must be logged in to vote

Works for me. Post: https://bsky.app/profile/test.marshal.dev/post/3kgtmkuqnnj2s

Code:

client = Client()
client.login(os.environ['USERNAME'], os.environ['PASSWORD'])

with open('cat2.jpg', 'rb') as f:
    cat_data = f.read()

upload = client.upload_blob(cat_data)
embed_external = models.AppBskyEmbedExternal.Main(
    external=models.AppBskyEmbedExternal.External(
        title='Test title',
        description='Test description',
        uri='https://atproto.blue',
        thumb=upload.blob,
    )
)

client.send_post('test external with thumb', embed=embed_external)
test image cat2.jpg

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@MarshalX
Comment options

Answer selected by digfish
@digfish
Comment options

@neilstottler
Comment options

@MarshalX
Comment options

@neilstottler
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #211 on December 18, 2023 17:42.