fix(downloads): a shared or feed-opened Facebook group post downloads its own video

A Facebook share link (/share/v/…) redirects to a group post, but only the
permalink form went through the post-page read, so yt-dlp followed the
share link itself and downloaded an ad from the signed-in group feed
(prod job 471). The link of a post opened from the group's feed
(/groups/<g>/?multi_permalinks=<id>) was not recognised at all, and yt-dlp
answers it with "Unsupported URL" (prod job 472).

With a cookie, a share link is now followed in the same request that reads
the post page, and a feed link is read as the post it names. Without one,
the feed link goes to yt-dlp in the permalink form it knows. A post page's
"no single video" verdict now names the post for a share link too.
This commit is contained in:
2026-11-14 00:29:59 +01:00
parent 4f78877201
commit fb3aca4c9c
4 changed files with 140 additions and 7 deletions
+6
View File
@@ -218,6 +218,12 @@ def test_our_post_without_a_video_verdict_names_the_group_link():
"format_unavailable",
"facebook.group_post_video",
)
# The share link a post was reached by (prod job 471's kind) names the post too.
share = "https://www.facebook.com/share/v/19bCAHKyrd/"
assert dlerrors.diagnose(msg, url=share, cookie_attached=True) == (
"format_unavailable",
"facebook.group_post_video",
)
assert dlerrors.diagnose(msg, url=_REEL, cookie_attached=True) == ("format_unavailable", None)