Import Instagram archive to a Bluesky account
9
fork

Configure Feed

Select the types of activity you want to include in your feed.

Lint fix

- found split functionality no longer made the instagram image prcoessor use the constant.

+21 -17
-1
src/bluesky/bluesky.test.ts
··· 1 1 import fs from 'fs'; 2 2 3 3 import { BlueskyClient } from './bluesky'; 4 - 5 4 import { ImagesEmbedImpl, VideoEmbedImpl } from './types/index'; 6 5 7 6 const TEST_VIDEO_PATH = './transfer/test_video/AQM8KYlOYHTF5GlP43eMroHUpmnFHJh5CnCJUdRUeqWxG4tNX7D43eM77F152vfi4znTzgkFTTzzM4nHa_v8ugmP4WPRJtjKPZX5pko_17845940218109367.mp4';
+5 -3
src/bluesky/types/PostRecord.ts
··· 2 2 3 3 import { EmbeddedMedia } from "./EmbeddedMedia"; 4 4 5 - export interface PostRecord extends Partial<AppBskyFeedPost.Record> {} 6 - 7 - export class PostRecordImpl implements PostRecord { 5 + /** 6 + * Bluesky post 7 + * @see AppBskyFeedPost.Record 8 + */ 9 + export class PostRecordImpl implements Partial<AppBskyFeedPost.Record> { 8 10 readonly $type = "app.bsky.feed.post"; 9 11 [k: string]: unknown; 10 12
+1 -3
src/image/image.test.ts
··· 1 1 import { getImageSize } from "./image"; 2 + import { logger } from "../logger/logger"; 2 3 3 4 // Mock the file system 4 5 jest.mock("fs", () => ({ ··· 70 71 }); 71 72 72 73 test("should log error when image processing fails", async () => { 73 - // Import the logger mock 74 - const { logger } = require("../logger/logger"); 75 - 76 74 // Call the function with a path that will trigger an error 77 75 const result = await getImageSize("/path/to/missing.jpg"); 78 76
+4 -3
src/instagram-to-bluesky.test.ts
··· 7 7 uploadMediaAndEmbed, 8 8 } from "../src/instagram-to-bluesky"; 9 9 import { BlueskyClient } from "./bluesky/bluesky"; 10 + import { ImagesEmbedImpl, VideoEmbedImpl } from "./bluesky/index"; 10 11 import { logger } from "./logger/logger"; 11 - import { InstagramMediaProcessor, ImageMediaProcessResultImpl, VideoMediaProcessResultImpl } from "./media"; 12 - import { ImagesEmbedImpl, VideoEmbedImpl } from "./bluesky/index"; 12 + import { InstagramMediaProcessor, ImageMediaProcessResultImpl } from "./media"; 13 + 13 14 import type { InstagramExportedPost } from "./media/InstagramExportedPost"; 14 15 15 16 // Mock all dependencies ··· 581 582 // Mock BlueskyClient for tracking uploads 582 583 const mockBlueskyClient = { 583 584 login: jest.fn().mockResolvedValue(undefined), 584 - uploadMedia: jest.fn().mockImplementation((_, __) => { 585 + uploadMedia: jest.fn().mockImplementation(() => { 585 586 return Promise.resolve({ 586 587 ref: `test-blob-ref-${mockBlueskyClient.uploadMedia.mock.calls.length}`, 587 588 mimeType: "image/jpeg",
+1
src/media/processors/Factory.test.ts
··· 1 1 import fs from "fs"; 2 + 2 3 import { InstagramMediaProcessor } from "../"; 3 4 import { 4 5 InstagramExportedPost,
+1 -5
src/media/processors/InstagramImageProcessor.ts
··· 5 5 import { MediaProcessResult, ImageMediaProcessResultImpl } from "../MediaProcessResult"; 6 6 import { getMediaBuffer } from "../utils"; 7 7 8 - /** 9 - * @link https://docs.bsky.app/docs/advanced-guides/posts#:~:text=Each%20post%20contains%20up%20to,alt%20text%20and%20aspect%20ratio. 10 - * "Each post contains up to four images, and each image can have its own alt text and aspect ratio." 11 - */ 12 - const MAX_IMAGES_PER_POST = 4; 8 + 13 9 const POST_TEXT_LIMIT = 300; 14 10 const POST_TEXT_TRUNCATE_SUFFIX = "..."; 15 11
+1
src/media/processors/InstagramMediaProcessor.test.ts
··· 1 1 import fs from "fs"; 2 + 2 3 import { InstagramMediaProcessor } from "./InstagramMediaProcessor"; 3 4 import { InstagramExportedPost, VideoMedia, ImageMedia } from "../InstagramExportedPost"; 4 5
+4
src/media/processors/InstagramMediaProcessor.ts
··· 5 5 import { MediaProcessorFactory } from "../interfaces/MediaProcessorFactory"; 6 6 import { ProcessedPost, ProcessedPostImpl } from "../ProcessedPost"; 7 7 8 + /** 9 + * @link https://docs.bsky.app/docs/advanced-guides/posts#:~:text=Each%20post%20contains%20up%20to,alt%20text%20and%20aspect%20ratio. 10 + * "Each post contains up to four images, and each image can have its own alt text and aspect ratio." 11 + */ 8 12 const MAX_IMAGES_PER_POST = 4; 9 13 const POST_TEXT_LIMIT = 300; 10 14 const POST_TEXT_TRUNCATE_SUFFIX = "...";
+2 -1
src/media/processors/InstagramVideoProcessor.test.ts
··· 1 1 import fs from "fs"; 2 + 3 + import { InstagramVideoProcessor } from ".."; 2 4 import { VideoMedia } from "../InstagramExportedPost"; 3 - import { InstagramVideoProcessor } from ".."; 4 5 5 6 // Mock the file system 6 7 jest.mock("fs", () => ({
+2 -1
src/video/video.test.ts
··· 1 + import ffmpeg from 'fluent-ffmpeg'; 2 + 1 3 import { validateVideo, getVideoDimensions } from './video'; 2 - import ffmpeg from 'fluent-ffmpeg'; 3 4 4 5 // Mock ffmpeg 5 6 jest.mock('fluent-ffmpeg', () => {