Repository navigation
Hand Facebook photo posts to gallery-dl as post links - #17
Merged
Merged
Conversation
A shared post resolves to story.php, which gallery-dl took for a profile named "story.php" and failed on, after yt-dlp found no video in it. gallery-dl now gets story.php and permalink.php links as <id>/posts/<story_fbid> and downloads the post's own pictures; yt-dlp keeps the original link.
stefan-azentrius
added a commit
that referenced
this pull request
Oct 25, 2026
## Summary After #17, a Facebook post with an article picture came back as a pack with a short video (3 seconds of sound) instead of the picture. yt-dlp, which goes first for every Facebook link, took a video from the post's page; an hour earlier it had found no video there at all. The check on the server for #17 showed that gallery-dl finds exactly the post's one picture. - Facebook **posts** (`kind == "post"`, e.g. resolved `story.php`, `permalink.php` and `<id>/posts/<id>` links) now go to gallery-dl first, as Instagram does, with the post link from #17. yt-dlp only runs when gallery-dl finds nothing, e.g. for a post with a video only, and gets the original link. - Facebook **reels and videos** (`/reel/`, `/watch`, `/videos/`) still go to yt-dlp first. - CHANGELOG: an entry in "Unreleased". ## Test - `tests/test_fetch.py`: - A post goes to gallery-dl first, with the post link, and yt-dlp does not run. - A post where gallery-dl finds nothing falls back to yt-dlp with the original link. - Reel, watch and video links still go to yt-dlp first. - The two post tests failed with the old order. - Locally: ruff clean, pytest 167 passed and 3 skipped (no FFmpeg), node --test 33 of 33, `git diff --check` clean. - Not yet checked: preparing the post again after the update.
stefan-azentrius
added a commit
that referenced
this pull request
Oct 26, 2026
…#19) ## Summary Prepares the release 0.1.2 with everything on `main` since 0.1.1 (#7 to #18). - `__version__` in `app/__init__.py`: 0.1.1 to 0.1.2. The image label, the extension's manifest and the version on the page follow from it. - `CHANGELOG.md`: the section "Unreleased" becomes "0.1.2 – 2026-10-26", with a summary that now names the Facebook posts with pictures (#17, #18). The "Upgrading" note names the extension zip the release workflow attaches. After the merge, the `release` workflow builds the source archive, `sharewerk-extension-0.1.2.zip` and the image `ghcr.io/azentrius/sharewerk:0.1.2`, each with build provenance, and takes the notes from this section. ## Test - `tools/release-notes.sh 0.1.2` prints the section (54 lines). - Locally: ruff clean, pytest 167 passed and 3 skipped (no FFmpeg), node --test 35 of 35 (app, extension, PWA update), `git diff --check` clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Facebook posts with pictures failed with "unsupported". A shared
facebook.com/share/p/...link resolves tostory.php?story_fbid=...&id=....story.phpwith its profile extractor, as a user named "story.php", and stops withKeyError: 'set_id'.gallery-dl's set extractor handles posts, but only as
<id>/posts/<story_fbid>orpermalink.php?story_fbid=.... A check on the server with the two failing posts and the Facebook cookies (gallery-dl -g, nothing downloaded) gave:<id>/posts/<story_fbid>permalink.php?story_fbid=...&id=...gallery_dl_url()inapp/fetch.pyturnsstory.phpandpermalink.phplinks with astory_fbid(digits or apfbid...id) and a numericidintohttps://www.facebook.com/<id>/posts/<story_fbid>. Any other link stays as it is.www.facebook.comand is built from the two ids only.Test
tests/test_fetch.py: a photo post goes through yt-dlp ("No video formats found") to gallery-dl, which gets the posts link while yt-dlp got the original one (fake downloader as a real subprocess). The conversion is tested forstory.php,permalink.php,pfbidids and parameters in another order. Links stay unchanged withoutid, with path characters in an id, or as reels, photo links and Instagram links. All 11 new tests failed onmainbefore the change.git diff --checkclean.