Skip to main content

A CLI for downloading posts in bulk from Bluesky from specified a account

Project description

mass-downloader-for-bluesky

mass-downloader-for-bluesky (mdfb) is a Python cli application that can download large amounts of posts from bluesky from any given account.

Installation

You will need Python to be installed to use this CLI.

You can install via pip by:

pip install mdfb

Manual

Have Poetry installed.

Then clone the project, open a poetry shell and then install all dependencies.

git clone git@github.com:IbrahimHajiAbdi/mass-downloader-for-bluesky.git
cd mdfb
poetry shell
poetry install

Usage

mdfb works by using the public API offered by bluesky to retrieve posts liked, reposted or posted by the desired account.

mdfb will download the information for a post and the accompanying media, video or image(s). If there is no image(s) or video, it will just download the information of the post. The information of the post will be a JSON file and have lots of accompanying data, such as the text in the post, creation time of the post and author details. Currently, the retrieved posts start from the latest post to the oldest.

You will need to be inside a poetry shell to use mdfb if installed manually

Examples

Some example commands would be:

Linux

mdfb --handle bsky.app -l 10 --like ./media/

Windows

mdfb --handle bsky.app -l 100 --like --repost --post ./media/

Naming Convention

mdfb's naming convention is: "{rkey}_{handle}_{text}", if it is downloading a post with multiple images then the naming will be: "{rkey}_{handle}_{text}_{i}", where "i" represents the order of the images in the post ranging from 1 - 4. In addition, the filenames are limited to 256 bytes and will be truncated down to that size.

Download Amount

When specifying the limit, this will be true for all types of post downloaded. For example:

mdfb --handle bsky.app -l 100 --like --repost --post ./media/

This would download 100 likes, reposts and post, totalling 300 posts downloaded.

Note

The maximum number of threads is currently 3, that can be changed in the mdfb/utils/constants.py file. Furthermore, there are more constants that can be changed in that file, such as delay between each request and the number of retires before marking that post as a failure and continuing.

Options

  • --handle
    • The handle of the target account.
  • --did, -d
    • The DID of the target account.
  • --limit, -l
    • The amount of posts that want to be downloaded.
  • --archive
    • Downloads all posts from the selected post type.
  • directory
    • Positional argument, where all the downloaded files are to be located. Required.
  • --threads
    • The amount of threads wanted to download posts more efficiently, maximum number of threads is 3.
  • --like
    • To retrieved liked posts
  • --repost
    • To retrieved reposts
  • --post
    • To retrieved posts

Note

At least one of the flags: --like, --repost, --post is required.

Both (--did, -d and --handle) and (--archive and --limit, -l) are mutually exclusive, and at least one of them is required as well.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdfb-1.1.1.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mdfb-1.1.1-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file mdfb-1.1.1.tar.gz.

File metadata

  • Download URL: mdfb-1.1.1.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for mdfb-1.1.1.tar.gz
Algorithm Hash digest
SHA256 def94eb3b7d85d842ba4639a82e55471742db79d10461c8044b37785967529f6
MD5 d01f8f7d9daad0be92dfce9b65255806
BLAKE2b-256 87920472bb2b233c94eea798d696e3160117121f8e042cafff2f74804538c548

See more details on using hashes here.

File details

Details for the file mdfb-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: mdfb-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for mdfb-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 58ff0df23d41e2a68b10630f8a63c37258a247d7bf0467067757540aa9bb0573
MD5 e0eba7a48ee39390cea9b441dc842d8e
BLAKE2b-256 97fe2714a32849ba3d29162489c6d85de26dcde5c9ea9f9e694244366b984065

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page