A simple Baraag media downloader, made to be a simple way of downloading all images/videos in posts made by accounts you follow.
Inspired by PixivUtil and FantiaDL.
Many thanks to the folks at Mastodon.py for making this implementation much easier than expected.
Create an environment with:
python3 -m venv baraag_dl
Activate the environment:
source baraag_dl/bin/activate
Download requirements.txt and baraag_dl.py to your current folder.
Install dependencies:
python3 -m pip install -r requirements.txt
Alternatively, install the following packages using python3 -m pip install
:
colorama
Mastodon.py
requests
Run Baraag_DL:
python3 baraag_dl.py
After done running, either close the terminal or deactivate the environment with: deactivate
For added convenience, I recommend either creating a shell script to execute baraag_dl.py
using the Python interpreter from the environment you created above, or modifying baraag_dl.py
to point to the environment's Python interpreter when executing.
For the former, if we suppose you created the baraag_dl
environment in your home folder, create a file containing the following lines in the same folder as baraag_dl.py
:
#!/bin/bash
~/baraag_dl/bin/python3 baraag_dl.py
Save the file with a name of your choice (let's call it run.sh
for this example), and grant it execution permissions with chmod +x run.sh
.
From this point on, you should be able to execute Baraag DL by running run.sh
, without the need to activate or deactivate environments.
For the latter, modify the first line in baraag_dl.py
to #!~/baraag_dl/bin/python3
From this point on, you should be able to execute baraag_dl.py
directly, without the need for activating or deactivating an environment.
Please be aware that if you choose the latter, you will need to redo this modification whenever you update Baraag DL.
pip install
to install the required packages listed above.baraag_dl.py
from within the environment.Download and install Python if not already installed.
Create an environment with:
py -m venv baraag_dl
Activate the environment:
baraag_dlScriptsactivate
Download requirements.txt and baraag_dl.py to your current folder.
Install dependencies:
py -m pip install -r requirements.txt
Alternatively, install the following packages using py -m pip install
:
colorama
Mastodon.py
requests
Run Baraag_DL:
py baraag_dl.py
After done running, either close the terminal or deactivate the environment with: deactivate
client_credentials
in the same folder baraag_dl.py is run from.user_credentials
in the same folder baraag_dl.py is run from.client_credentials
and user_credentials
are still valid, authentication will happen without user input.{Date posted}_{Post ID}_{Attachment_ID}.extension
in a folder for each account, named in the format {Account name}_{Account ID}
. Keep in mind that Account name
is not the same as Display name
, so an account's public name and Baraag registration name may differ.