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

Closed
5 tasks done
someziggyman opened this issue Oct 19, 2020 · 17 comments
Closed
5 tasks done

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

someziggyman opened this issue Oct 19, 2020 · 17 comments

Comments

@someziggyman
Copy link

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

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

@someziggyman
Copy link
Author

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 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 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 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 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 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 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 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

@sebma
Copy link

sebma commented Nov 16, 2020

@october Here's what I get with the 2020.11.17 version :

$ youtube-dl -F https://www.facebook.com/100052997931710/posts/158984389211491
[facebook] 158984389211491: 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; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
$ youtube-dl -F https://www.facebook.com/justicededieu.ministere.1/videos/158983125878284/
[facebook] 158983125878284: Downloading webpage
[facebook] 158983125878284: Downloading webpage
[facebook] 158983125878284: Downloading webpage
[info] Available formats for 158983125878284:
format code               extension  resolution note
387176535985756a          m4a        audio only DASH audio   65k , m4a_dash container, mp4a.40.5 (44100Hz)
847799622629973v          mp4        144x256    DASH video   94k , mp4_dash container, avc1.42C01E, 30fps, video only
3367989963254467v         mp4        240x426    DASH video  227k , mp4_dash container, avc1.42C01E, 30fps, video only
2818763831694719v         mp4        360x640    DASH video  476k , mp4_dash container, avc1.4D401E, 30fps, video only
1042837749561825v         mp4        720x1280   DASH video 2148k , mp4_dash container, avc1.4D401F, 30fps, video only
dash_sd_src               mp4        unknown    
dash_sd_src_no_ratelimit  mp4        unknown    
dash_hd_src               mp4        unknown    (best)

My guest is that it does not support the FB channel ID (I'm not sure how it's called) but only the FB name.

@RingoTheDog
Copy link

RingoTheDog commented Nov 24, 2020

Similar issue: https://m.facebook.com/Alliance.Police.Department/posts/4048563708499330?comment_id=4048581808497520

youtube-dl.py -v "https://m.facebook.com/Alliance.Police.Depar
tment/posts/4048563708499330?comment_id=4048581808497520"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://m.facebook.com/Alliance.Police.Depart
ment/posts/4048563708499330?comment_id=4048581808497520']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2020.11.19
[debug] Python version 3.6.3 (CPython) - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-71727-g46778ab, rtmpdump 2.4
[debug] Proxy map: {}
[facebook] 4048563708499330: 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 t
o update. Be sure to call youtube-dl with the --verbose flag and include its com
plete output.
Traceback (most recent call last):
File "C:\Transmogrifier\youtube-dl.py\youtube_dl\YoutubeDL.py", line 797, in e
xtract_info
ie_result = ie.extract(url)
File "C:\Transmogrifier\youtube-dl.py\youtube_dl\extractor\common.py", line 53
2, in extract
ie_result = self._real_extract(url)
File "C:\Transmogrifier\youtube-dl.py\youtube_dl\extractor\facebook.py", line
479, in _real_extract
video_id = self._search_regex(r'video_id:\s*"([0-9]+)"', webpage, 'single vi
deo id')
File "C:\Transmogrifier\youtube-dl.py\youtube_dl\extractor\common.py", line 10
10, in _search_regex
raise RegexNotFoundError('Unable to extract %s' % _name)
youtube_dl.utils.RegexNotFoundError: Unable to extract single video id; please r
eport this issue on https://yt-dl.org/bug . Make sure you are using the latest v
ersion; type youtube-dl -U to update. Be sure to call youtube-dl with the --ve
rbose flag and include its complete output.

@sonicer105
Copy link

Also ran into this issue:

> youtube-dl --version
2020.11.26
> youtube-dl https://www.facebook.com/776675572/posts/10164338564565573 --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'https://www.facebook.com/776675572/posts/10164338564565573', u'--verbose']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.11.26
[debug] Python version 2.7.18 (CPython) - Linux-5.4.0-53-generic-x86_64-with-Ubuntu-20.04-focal
[debug] exe versions: ffmpeg 4.2.4, ffprobe 4.2.4
[debug] Proxy map: {}
[facebook] 10164338564565573: 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 803, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 824, 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.

Using --force-generic-extractor worked and downloaded a 400 x 302 video when -F said it was 720x544 so I'm not sure what's going on there. I ended up using https://fbdown.net/ to get the video for now.

@someziggyman
Copy link
Author

Here's another test URL if needed:
https://m.facebook.com/filharmoniaKosice/videos/667625703956456

Works only with force generic. Hope some day FB extractor is fixed and will work without a hustle as before.

@Sepero
Copy link

Sepero commented Dec 8, 2020

Same issue here. Using -f option with generic extractor doesn't work correctly either. Cheers!

@NitroBiedermann
Copy link

Also having this issue. Any idea when this can be fixed or improved?

@remitamine
Copy link
Collaborator

support for most of the videos posted here has been restored(except for the example posted by @RingoTheDog).

@sebma
Copy link

sebma commented Dec 11, 2020

@remitamine Yes, it works now, thanks 😄 :

$ sudo -H $(which pip3.6) uninstall youtube-dl
Found existing installation: youtube-dl 2020.12.9
Uninstalling youtube-dl-2020.12.9:
  Would remove:
    /usr/local/bin/youtube-dl
    /usr/local/etc/bash_completion.d/youtube-dl.bash-completion
    /usr/local/etc/fish/completions/youtube-dl.fish
    /usr/local/lib/python3.6/dist-packages/youtube_dl-2020.12.9.dist-info/*
    /usr/local/lib/python3.6/dist-packages/youtube_dl/*
    /usr/local/share/doc/youtube_dl/README.txt
    /usr/local/share/man/man1/youtube-dl.1
Proceed (y/n)? y
  Successfully uninstalled youtube-dl-2020.12.9
$ sudo -H $(which pip3.6) install -U git+https://github.com/ytdl-org/youtube-dl
Collecting git+https://github.com/ytdl-org/youtube-dl
  Cloning https://github.com/ytdl-org/youtube-dl to /tmp/pip-req-build-ecezg2xp
Building wheels for collected packages: youtube-dl
  Building wheel for youtube-dl (setup.py) ... done
  Created wheel for youtube-dl: filename=youtube_dl-2020.12.9-py2.py3-none-any.whl size=1776444 sha256=5bac9c4a5017692c41eb738e4b58f3f7b00d0fe67039ed973a1a3dd75d2a2bc9
  Stored in directory: /tmp/pip-ephem-wheel-cache-wlp15dx8/wheels/ff/37/dd/aa769c199856673937d095ecfacadc6f056b3c1bfe02aa3998
Successfully built youtube-dl
Installing collected packages: youtube-dl
Successfully installed youtube-dl-2020.12.9
$ youtube-dl -F https://www.facebook.com/100052997931710/posts/158984389211491
[facebook] 158984389211491: Downloading webpage
[info] Available formats for 158984389211491:
format code               extension  resolution note
387176535985756a          m4a        audio only DASH audio   65k , m4a_dash container, mp4a.40.5 (44100Hz)
847799622629973v          mp4        144x256    DASH video   94k , mp4_dash container, avc1.42C01E, 30fps, video only
3367989963254467v         mp4        240x426    DASH video  227k , mp4_dash container, avc1.42C01E, 30fps, video only
2818763831694719v         mp4        360x640    DASH video  476k , mp4_dash container, avc1.4D401E, 30fps, video only
1042837749561825v         mp4        720x1280   DASH video 2148k , mp4_dash container, avc1.4D401F, 30fps, video only
dash_sd_src               mp4        unknown    
dash_sd_src_no_ratelimit  mp4        unknown    
dash_hd_src               mp4        unknown    (best)

ThirumalaiK pushed a commit to ThirumalaiK/youtube-dl that referenced this issue Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants