gallery-dl icon indicating copy to clipboard operation
gallery-dl copied to clipboard

[Facebook] Failed to download some reels or videos.

Open 0xvd opened this issue 2 weeks ago • 5 comments

it wil works for reels, videos, but it failed for some videos the video link is accessible in browser without login.

verbose:

C:\data\yt-dlp-testing> gallery-dl 'https://www.facebook.com/permalink.php?story_fbid=pfbid034C2PVBhr311C2jo91sBMNwfvcBeLmspzTXLikp37aEqKsdh47mW7ZX8hcS3Ba8Uul&id=61573780995993&rdid=eV7e4pTWFxWb6Evx' -v
[gallery-dl][debug] Version 1.31.0-dev - Git HEAD: 994cc34f
[gallery-dl][debug] Python 3.12.10 - Windows-11-10.0.26200-SP0
[gallery-dl][debug] requests 2.32.5 - urllib3 2.5.0
[gallery-dl][debug] Configuration Files []
[gallery-dl][debug] Starting DownloadJob for 'https://www.facebook.com/permalink.php?story_fbid=pfbid034C2PVBhr311C2jo91sBMNwfvcBeLmspzTXLikp37aEqKsdh47mW7ZX8hcS3Ba8Uul&id=61573780995993&rdid=eV7e4pTWFxWb6Evx'
[facebook][debug] Using FacebookUserExtractor for 'https://www.facebook.com/permalink.php?story_fbid=pfbid034C2PVBhr311C2jo91sBMNwfvcBeLmspzTXLikp37aEqKsdh47mW7ZX8hcS3Ba8Uul&id=61573780995993&rdid=eV7e4pTWFxWb6Evx'
[facebook][debug] Using FacebookPhotosExtractor for 'https://www.facebook.com/permalink.php/photos'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.facebook.com:443
[urllib3.connectionpool][debug] https://www.facebook.com:443 "GET /permalink.php/photos_by HTTP/1.1" 200 None
[facebook][debug] Failed to extract user data: 
[facebook][debug] Got empty profile photos page, retrying...
[urllib3.connectionpool][debug] https://www.facebook.com:443 "GET /permalink.php/photos_by HTTP/1.1" 200 None
[facebook][debug] Failed to extract user data: 
[facebook][debug] Got empty profile photos page, retrying...
[urllib3.connectionpool][debug] https://www.facebook.com:443 "GET /permalink.php/photos_by HTTP/1.1" 200 None
[facebook][debug] Failed to extract user data: 
[facebook][debug] Got empty profile photos page, retrying...
[facebook][error] An unexpected error occurred: KeyError - 'set_id'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[facebook][debug] 
Traceback (most recent call last):
  File "C:\data\gallery-dl\gallery_dl\job.py", line 159, in run
    for msg in extractor:
               ^^^^^^^^^
  File "C:\data\gallery-dl\gallery_dl\extractor\common.py", line 83, in __iter__
    return self.items()
           ^^^^^^^^^^^^
  File "C:\data\gallery-dl\gallery_dl\extractor\facebook.py", line 532, in items
    set_id = self._extract_profile(self.groups[0], True)["set_id"]
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'set_id'

0xvd avatar Dec 10 '25 13:12 0xvd

/permalink.php?story_fbid=...

That's a story, I think, and those are not supported (yet) Just use yt-dlp for the time being.

mikf avatar Dec 10 '25 14:12 mikf

/permalink.php?story_fbid=...

That's a story, I think, and those are not supported (yet) Just use yt-dlp for the time being.

yt-dlp is also broke and i already opned issue and it is not a story i guess a normal reel or video but embed or multi. most of reel or video works.

0xvd avatar Dec 10 '25 14:12 0xvd

Still, gallery-dl currently interprets this URL type as a user profile:

[facebook][debug] Using FacebookUserExtractor for 'https://www.facebook.com/permalink.php?story_fbid=pfbid034C2PVBhr311C2jo91sBMNwfvcBeLmspzTXLikp37aEqKsdh47mW7ZX8hcS3Ba8Uul&id=61573780995993&rdid=eV7e4pTWFxWb6Evx'

mikf avatar Dec 10 '25 14:12 mikf

So should i closed this issue or trying to fix this issue.

0xvd avatar Dec 10 '25 14:12 0xvd

Leave it open. I'll (probably) try to at least fix the URL issue https://github.com/mikf/gallery-dl/issues/8679#issuecomment-3637385582.

mikf avatar Dec 10 '25 16:12 mikf

Ok, so this URL is a regular post. Not an image/photo, video, nor story. Just a "thing" with potentially mixed media types.

mikf avatar Dec 10 '25 18:12 mikf

Now u got the point but i fixed and opened PR in ytdlp that fix this issue.

0xvd avatar Dec 10 '25 18:12 0xvd