feat: read gallery-dl sidecars for reel type and post dates

The .json sidecars published with the ARTMS fetch were inert: the scanner
fed them through the Instaloader path, where `node.edge_media_to_caption`
and `checkIsStory`'s `product_type` are both absent, so nothing happened.

They are now recognised structurally -- flat, with post_shortcode and
type, and none of the markers the other two JSON shapes carry -- and used
for three things:

- `type` sets post.isReel, which post-tabs prefers over every fallback.
  This is Instagram's own classification and it disagrees with ours a
  lot: of 781 items in "official_artms - reels", the sidecars say only
  360 are reels. The other 421 are feed videos the clips endpoint returns
  via include_feed_video, and the directory-based rule counted them all.
- `description` fills the caption where no .txt exists.
- `date` dates a post whose filename could not.

Also fixes date precedence. Only JDownloader highlights lack a date in
the filename, so parseArchiveFilename now marks those as mtime-derived
and the scanner lets any real date replace them -- previously the date
depended on which file the scan reached first.

Verified against real published files: a directory of three type=post and
three type=reel renders 6 in the grid and exactly the 3 reels in the
Reels tab.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-17 12:42:54 -04:00
co-authored by Claude Opus 5
parent 3e29976866
commit e14dbf6ec8
11 changed files with 320 additions and 6 deletions
+12 -1
View File
@@ -276,10 +276,21 @@ def build_config(rate: str, sleep_request: list[float],
Naming for surfaces whose unit is an item inside a reel (stories,
highlights). `{shortcode}` is per item; `{post_shortcode}` is the
reel's id and is shared by every item in it.
The media filename uses the per-item shortcode, but the sidecar cannot:
it runs at `event: post`, where the kwdict describes the *reel* and has
no `shortcode` at all -- which silently formatted as the literal
"None", producing one "<date>_<user> - None.json" per reel. It is keyed
by `post_shortcode` instead, and is genuinely reel-level data (the
reel's own date and item count); per-item dates live in the media
filenames, which is the more precise source anyway.
"""
return {
"filename": stem + ".{extension}",
"postprocessors": [{**meta_pp, "filename": stem + ".json"}],
"postprocessors": [
{**meta_pp,
"filename": DATE_FMT + "_{username} - {post_shortcode}.json"},
],
}
return {