Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook - RegexNotFoundError: Unable to extract single video id #26935

Open
someziggyman opened this issue Oct 19, 2020 · 9 comments
Open

Facebook - RegexNotFoundError: Unable to extract single video id #26935

someziggyman opened this issue Oct 19, 2020 · 9 comments

Comments

@someziggyman
Copy link

@someziggyman someziggyman commented Oct 19, 2020

Checklist

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2020.09.20
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar issues including closed ones

Verbose log

youtube-dl -v -F https://m.facebook.com/bakhtiar.kamal1/posts/10214187189745894 
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-F', u'https://m.facebook.com/bakhtiar.kamal1/posts/10214187189745894']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.09.20
[debug] Python version 2.7.16 (CPython) - Darwin-18.7.0-x86_64-i386-64bit
[debug] exe versions: none
[debug] Proxy map: {}
[facebook] 10214187189745894: Downloading webpage
ERROR: Unable to extract single video id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 797, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 532, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/facebook.py", line 479, in _real_extract
    video_id = self._search_regex(r'video_id:\s*"([0-9]+)"', webpage, 'single video id')
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 1010, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
RegexNotFoundError: Unable to extract single video id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

Description

'https://m.facebook.com/bakhtiar.kamal1/posts/10214187189745894

@october262
Copy link

@october262 october262 commented Oct 19, 2020

try the video like this > youtube-dl --force-generic-extractor https://m.facebook.com/bakhtiar.kamal1/posts/10214187189745894

@someziggyman
Copy link
Author

@someziggyman someziggyman commented Oct 20, 2020

Thanks, youtube-dl --force-generic-extractor works, but I assume this is not how it's supposed to work out of the box. Some regex code refactoring is needed.

@sebma
Copy link

@sebma sebma commented Oct 20, 2020

@october262 The generic extractor cannot not choose the best video format for the download.
For one of my videos, it downloads the 240p instead of the 720p :-(

@october262
Copy link

@october262 october262 commented Oct 20, 2020

@october262 The generic extractor cannot not choose the best video format for the download
For one of my videos, it download the 240p instead of the 720p :-(

do you see 3 dots ... in the upper right corner of the video ??
it should give you an option to download & save the video

@sebma
Copy link

@sebma sebma commented Oct 20, 2020

@october262 It's not really my video :-), but one of my friends.
And I don't have a FB account (and I don't want one :-) ).
The "..." in the upper right corner of the video proposes a menu with "Report video" and "Copy Link" items.
The "Copy Link" is not a direct link to the video stream :-(

@october262
Copy link

@october262 october262 commented Oct 20, 2020

@october262 It's not really my video :-), but one of my friends.
And I don't have a FB account (and I don't want one :-) ).
The "..." in the upper right corner of the video proposes a menu with "Report video" and "Copy Link" items.
The "Copy Link" is not a direct link to the video stream :-(

try youtube-dl --force-generic-extractor -f best URL

@sebma
Copy link

@sebma sebma commented Oct 21, 2020

@october262 It's not really my video :-), but one of my friends.
And I don't have a FB account (and I don't want one :-) ).
The "..." in the upper right corner of the video proposes a menu with "Report video" and "Copy Link" items.
The "Copy Link" is not a direct link to the video stream :-(

try youtube-dl --force-generic-extractor -f best URL

The only format available with the generic extractor is this one :

$ youtube-dl -F --force-generic-extractor https://www.facebook.com/100052997931710/posts/158984389211491 
[generic] 158984389211491: Requesting header
[generic] 158984389211491: Downloading webpage
[generic] 158984389211491: Extracting information
[info] Available formats for 158984389211491:
format code  extension  resolution note
0            mp4        720x1280   
@sebma
Copy link

@sebma sebma commented Oct 21, 2020

But the resolution given is wrong because the 0 format downloads a video with a 240x426 that is 240p and NOT 720p

@october262
Copy link

@october262 october262 commented Oct 21, 2020

But the resolution given is wrong because the 0 format downloads a video with a 240x426 that is 240p and NOT 720p

according to this - https://stackoverflow.com/questions/31631535/youtube-dl-dash-video-and-audio-in-highest-quality-without-human-intervention the bestvideo+bestaudio/best will get you the 720p version

try opening this link - https://www.facebook.com/100052997931710/videos/158983125878284/
in a new tab, click the three dots ... select copy URL then youtube-dl -F https://www.facebook.com/100052997931710/videos/158983125878284/
there you can select the available formats

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.