blackjack4494 / yt-dlc

media downloader and library for various sites.
The Unlicense
2.89k stars 364 forks source link

[Facebook] Video-Posts: "RegexNotFoundError: Unable to extract single video id" #231

Open hairycactus opened 3 years ago

hairycactus commented 3 years ago

Checklist:

Description:

  1. Youtube-dlc encounters "RegexNotFoundError: Unable to extract single video id" error, & fails to extract the video from this common Facebook video-post URL:

    https://www.facebook.com/<PageName or PageID>/post/<IDString1>.

    This URL contains only a single video, which is public & watchable in the browser without any account login.

  2. The same video is also accessible in the browser via the below URLs ("video", "watch"), from which Youtube-dlc has no problem extracting the video:

    https://www.facebook.com/<PageName or PageID>/videos/<IDString2>
    https://www.facebook.com/watch/?v=<IDString2>

Note that (2)'s IDString2 differs from (1)'s IDString1 found within the video-post URL. This IDString2 can be obtained by checking the video-post's timestamp URL (beside the "Public" marker at the top of the post).

Sample URLs for Testing:

RegexNotFoundError: Unable to extract single video id:

https://www.facebook.com/bbcnews/posts/10158313576807217
https://www.facebook.com/228735667216/posts/10158313576807217

Working OK in Youtube-dlc:

https://www.facebook.com/bbcnews/videos/2464080690554475
https://www.facebook.com/228735667216/videos/2464080690554475
https://www.facebook.com/watch/?v=2464080690554475

where:

Verbose Log:

[debug] System config: []
[debug] User config: []
[debug] Custom config: []

[debug] Command-line args: ['-v', 'https://www.facebook.com/bbcnews/posts/10158313576807217']
AND
[debug] Command-line args: ['-v', 'https://www.facebook.com/228735667216/posts/10158313576807217']

[debug] Loading archive file None
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dlc version 2020.11.11-3
[debug] Python version 3.8.6 (CPython) - Windows-10-10.0.18362-SP0
[debug] exe versions: ffmpeg 4.3.1, ffprobe 4.3.1
[debug] Proxy map: {}

[facebook] 10158313576807217: Downloading webpage

ERROR: Unable to extract single video id
Traceback (most recent call last):
  File "youtube_dlc\YoutubeDL.py", line 830, in extract_info
  File "youtube_dlc\extractor\common.py", line 532, in extract
  File "youtube_dlc\extractor\facebook.py", line 479, in _real_extract
  File "youtube_dlc\extractor\common.py", line 1010, in _search_regex

youtube_dlc.utils.RegexNotFoundError: Unable to extract single video id
october262 commented 3 years ago

for this link - https://www.facebook.com/bbcnews/posts/10158313576807217 play the video and click the enlarge button, copy the link at the top of the search bar and enter youtube-dlc --force-generic-extractor https://www.facebook.com/watch/?v=2464080690554475 the video will now download.

merval commented 3 years ago

I wonder if the reason the first two are failing is because they aren't actual video sources, they are posts. A post will usually only have an embed of the video which redirects to the actual video source.