This is documentation for YAL's social media downloader.
Click on sections to expand/collapse them.
Quick display controls: Categories · Sections · Everything ·

Input/output
Input/output
--dir <path>

This is where the downloaded media files will be placed.

By default, it is the working directory.

--prefix <snip>

--out <path>

Places links/text/markdown in a file instead of printing it to output.

If the file extension is md, enables Markdown output mode.

--in <path>

Takes inputs from a text file instead of command-line parameters.

Lines with links will be replaced by file(s) from that link.
Other lines will be preserved.

So, for example, if you had links.txt with the following

tiny beast
https://bsky.app/profile/yellowafterlife.bsky.social/post/3lxcwsgrras27

piglet
https://bsky.app/profile/yellowafterlife.bsky.social/post/3lwe7nxugks2w
https://bsky.app/profile/yellowafterlife.bsky.social/post/3lwh6s7axvc2o

and did node yal-dl.js --in links.txt, the output would be

tiny beast
bsky=yellowafterlife.bsky.social=3lxcwsgrras27.jpg

piglet
bsky=yellowafterlife.bsky.social=3lwe7nxugks2w.jpg
bsky=yellowafterlife.bsky.social=3lwh6s7axvc2o.jpg
bsky=yellowafterlife.bsky.social=3lwh6s7axvc2o=1.jpg

In Markdown output mode, a line of text immediately before a link will be turned into a header, so the output would rather be

## [tiny beast](https://bsky.app/profile/yellowafterlife.bsky.social/post/3lxcwsgrras27)
![](bsky=yellowafterlife.bsky.social=3lxcwsgrras27.jpg)

## [piglet](https://bsky.app/profile/yellowafterlife.bsky.social/post/3lwe7nxugks2w)
![](bsky=yellowafterlife.bsky.social=3lwe7nxugks2w.jpg)
<!-- https://bsky.app/profile/yellowafterlife.bsky.social/post/3lwh6s7axvc2o -->
![](bsky=yellowafterlife.bsky.social=3lwh6s7axvc2o.jpg)
![](bsky=yellowafterlife.bsky.social=3lwh6s7axvc2o=1.jpg)

and that's pretty good for organizing related images.

Markdown mode
Markdown mode
--markdown

Or --md

Outputs markdown instead of plain text.

--thumb <width x height>

Generates thumbnails in specified dimensions (_at most_) to use in markdown.

This is desirable if you have a lot of potentially large images in one document and this is starting to take toll at document load speed.

That is, if you're doing --thumb 320x240 and an image is 2000x200, it'll be resized to 240x240.

Markdown output will change from

![](cool.jpg)

to

[![](cool=th.jpg)](cool.jpg)

If you use this option without targeting Markdown, this will generate thumbnail images but will not change the outputs;

Thumbnails are in JPEG format by default, or WEBP if you use --webp.

Or --md-image-links

Makes images link to original files even when not using the thumbnails, so instead of

![](cool.jpg)

you would have

[![](cool.jpg)](cool.jpg)
--md-img-dims

Or --md-image-dimensions

Uses <img/> elements instead of ![]() and specifies width/height.

Thus instead of

![](cool.jpg)

you would have

<img src="cool.jpg" width="640" height="360"/>
Image-specific
Image-specific
--max-dims <width x height>

Or --max-dimensions

Resizes images if they exceed this size.

For example, --max-dims 2000x2000.

--max-width <width>, --max-height <height>

Like above, but for one side.

--max-size <size>

Specifies maximum desired size per image.

For example, --max-size 150KB or --max-size 1.5MB.

Figuring out how to fit an image under the given file size is kind of complicated so the tool will try re-encoding it to a lossy format in 75% size, or 56.25% (75%²) if that doesn't work out, and so on (up to 7 attempts total).

--quality <number>

Specifies quality for JPEG/WEBP when re-encoding images for above or --thumb.

Default is --quality 80.

--webp

Converts images to WEBP when the need arises and prefers downloading WEBPs from BlueSky.

--lossless

Or --png.

Prefers downloading the (mysteriously, slightly lossy) PNGs from BlueSky.

Not used for anything else at the moment because surely you wouldn't want your thumbnails to be PNGs?

--image-ext <ext>

Uses the specified file extension for images regardless of what the actual file format is. For example, --image-ext jpg.

Note that file extensions may occasionally not match the contents even without this parameter if OpenGraph says that the image is JPEG but the downloaded image is a WEBP, for example.

Networking
Networking
--user-agent <snip>

Situationally useful if a website returns different OpenGraph fields depending on who's asking.

--delay <ms>

Waits this much between HTTP requests. Such as --delay 250 to wait a quarter-second.

If you are downloading a lot of media files at once, you might want to set this to some value so that you don't get rate-limited.

Debug/development
Debug/development
--verbose

Shows detailed information about what's happening at each step of the way.

--run-tests

Makes sure that the application's basic features are all functional by requesting a handful of my postings from different social networks.

--cache

Caches pages and resources in the cache/ directory.

This is used when running tests so that resources aren't re-requested every time.