[facebook:set] fix/improve 'user_id' extraction (#7848)

https://github.com/mikf/gallery-dl/issues/7848#issuecomment-3181428631
This commit is contained in:
Mike Fährmann
2025-08-13 07:40:37 +02:00
parent 06f37e1d8c
commit bce1678fd4
2 changed files with 18 additions and 0 deletions

View File

@@ -80,6 +80,8 @@ class FacebookExtractor(Extractor):
directory["user_id"] = (
text.extr(
set_page, '"actors":[{"__typename":"User","id":"', '"') or
text.extr(
set_page, '"userID":"', '"') or
directory["set_id"].split(".")[1])
return directory

View File

@@ -143,6 +143,22 @@ __tests__ = (
"#count" : 4,
},
{
"#url" : "https://www.facebook.com/media/set/?set=a.127331797422780&type=3",
"#comment" : "pfbid user ID; 'This content isn't available right now' profile",
"#class" : facebook.FacebookSetExtractor,
"#metadata": "post",
"#range" : 0,
"caption" : "Amarte es mi hábito favorito",
"date" : "dt:2025-05-03 03:42:52",
"set_id" : "a.127331797422780",
"title" : "Profile pictures",
"user_id" : "100004378810826",
"user_pfbid": r"re:pfbid\w{64}",
"username" : "Angel Nava Santiago",
},
{
"#url" : "https://www.facebook.com/photo.php?fbid=10165113568399554&set=t.100064860875397&type=3",
"#class" : facebook.FacebookPhotoExtractor,