Skip to content

Add image downloading support for Instagram, Facebook, Twitter, and TikTok with album functionality #56

Description

@vo1dee

Description

The bot currently supports video downloads from multiple platforms but lacks image downloading capabilities. Users should be able to download images from social media posts, with support for multi-image posts sent as Telegram albums.

Current State

  • Video downloading works via VideoDownloader class in modules/video_downloader.py
  • Supported platforms defined in VideoPlatforms.SUPPORTED_PLATFORMS
  • URL processing handles domain modifications

Proposed Features

  1. Image Download Support:

    • Instagram posts and stories
    • Facebook posts
    • Twitter/X image posts
    • TikTok image posts (carousel posts)
  2. Album Functionality:

    • Detect multi-image posts
    • Send as Telegram media group/album
    • Preserve image order and quality
  3. Integration Points:

    • Extend existing VideoDownloader class or create ImageDownloader
    • Reuse URL extraction logic from extract_urls
    • Leverage existing error handling and cleanup mechanisms

Technical Implementation

  • Add image detection logic to platform identification
  • Implement image extraction using yt-dlp or platform-specific APIs
  • Create album grouping logic for multi-image posts
  • Add image format optimization (JPEG/PNG handling)
  • Extend file size limits and cleanup for images

Benefits

  • Complete media downloading solution
  • Better user experience for image-heavy social media
  • Consistent interface with existing video downloads

The implementation would build on the existing video download infrastructure, particularly the platform detection system and the message handling pipeline.

Notes

The bot already has URL processing capabilities for Meta platforms (Instagram/Facebook) and Twitter domain modifications, which could be leveraged for the image downloading feature.

Wiki pages you might want to explore:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions