Skip to content

Comments

Fix migrating media in Bluesky#560

Merged
redshiftzero merged 4 commits intomainfrom
migrate-bluesky-media
Aug 16, 2025
Merged

Fix migrating media in Bluesky#560
redshiftzero merged 4 commits intomainfrom
migrate-bluesky-media

Conversation

@micahflee
Copy link
Member

@micahflee micahflee commented Aug 14, 2025

This fixes a few issues:

  • There were some typescript warnings related to atproto types which are fixed.
  • There was an error using the image-size module to get aspect ratios when migrating images. I've removed that dependency (yay one less dependency) and replaced it with a simple function that looks like dimensions for PNGs and JPGs.
  • There was an error migrating videos. I'm not sure when this changed, but for some reason, mp4 video mime types were being reported as "application/mp4" but atproto requires the mime type to be "video/mp4". So I just made it use "video/mp4" if the mime type was "application/mp4", and that fixes it.
  • When migrating a tweet with multiple animated gifs in it, this now only migrates the first animated gif. It's because 1) animated gifs in X are technically mp4 videos, not gifs, and 2) atproto only supports one video per post.

Test plan

  • In a test X account, make several posts that includes photos, videos, and animated gifs, including one post with multiple animated gifs.
  • Try migrating them to Bluesky. It should all work without errors.

Copy link
Contributor

@redshiftzero redshiftzero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM:

  • In a test X account, make several posts that includes photos, videos, and animated gifs, including one post with multiple animated gifs.
  • Try migrating them to Bluesky. It should all work without errors.

Noting that the multiple animated gif post become a single animated gif on Bluesky as expected

@redshiftzero redshiftzero merged commit a552067 into main Aug 16, 2025
1 check passed
@redshiftzero redshiftzero deleted the migrate-bluesky-media branch August 16, 2025 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants