ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.41k stars 9.96k forks source link

Site support request: https://rmc.bfmtv.com #31072

Open fds39 opened 2 years ago

fds39 commented 2 years ago

Checklist

$ youtube-dl --version
2021.12.17
$ youtube-dl --verbose https://rmc.bfmtv.com/replay-emissions/estelle-midi/l-integrale-d-estelle-midi-du-lundi-4-juillet-2022_VN-202207040445.html
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', 'https://rmc.bfmtv.com/replay-emissions/estelle-midi/l-integrale-d-estelle-midi-du-lundi-4-juillet-2022_VN-202207040445.html']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.17763
[debug] exe versions: ffmpeg N-93151-gff03418348, ffprobe N-93151-gff03418348
[debug] Proxy map: {}
[generic] l-integrale-d-estelle-midi-du-lundi-4-juillet-2022_VN-202207040445: Requesting header
WARNING: Falling back on generic information extractor.
[generic] l-integrale-d-estelle-midi-du-lundi-4-juillet-2022_VN-202207040445: Downloading webpage
[generic] l-integrale-d-estelle-midi-du-lundi-4-juillet-2022_VN-202207040445: Extracting information
ERROR: Unsupported URL: https://rmc.bfmtv.com/replay-emissions/estelle-midi/l-integrale-d-estelle-midi-du-lundi-4-juillet-2022_VN-202207040445.html
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\YoutubeDL.py", line 815, in wrapper
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\YoutubeDL.py", line 836, in __extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\common.py", line 534, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\generic.py", line 3489, in _real_extract
youtube_dl.utils.UnsupportedError: Unsupported URL: https://rmc.bfmtv.com/replay-emissions/estelle-midi/l-integrale-d-estelle-midi-du-lundi-4-juillet-2022_VN-202207040445.html

Youtube-dl works perfectly with bfmtv.com but NOT with rmc.bfmtv.com

dirkf commented 2 years ago

Voilà:

--- old/youtube_dl/extractor/bfmtv.py
+++ new/youtube_dl/extractor/bfmtv.py
@@ -8,7 +8,7 @@

 class BFMTVBaseIE(InfoExtractor):
-    _VALID_URL_BASE = r'https?://(?:www\.)?bfmtv\.com/'
+    _VALID_URL_BASE = r'https?://(?:www\.)?(?:rmc\.)?bfmtv\.com/'
     _VALID_URL_TMPL = _VALID_URL_BASE + r'(?:[^/]+/)*[^/?&#]+_%s[A-Z]-(?P<id>\d{12})\.html'
     _VIDEO_BLOCK_REGEX = r'(<div[^>]+class="video_block"[^>]*>)'
     BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/%s_default/index.html?videoId=%s'
@@ -35,6 +35,9 @@
             'upload_date': '20201002',
             'timestamp': 1601629620,
         },
+    }, {
+        'url': 'https://rmc.bfmtv.com/replay-emissions/estelle-midi/l-integrale-d-estelle-midi-du-lundi-4-juillet-2022_VN-202207040445.html',
+        'only_matching': True,
     }]

     def _real_extract(self, url):

You only need to apply the first change to make the extractor work; the rest is to ensure it keeps working.

And then:

$ python -m youtube_dl -v -F 'https://rmc.bfmtv.com/replay-emissions/estelle-midi/l-integrale-d-estelle-midi-du-lundi-4-juillet-2022_VN-202207040445.html'
[debug] System config: [u'--prefer-ffmpeg']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-F', u'https://rmc.bfmtv.com/replay-emissions/estelle-midi/l-integrale-d-estelle-midi-du-lundi-4-juillet-2022_VN-202207040445.html']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Git HEAD: 1625723ef
[debug] Python version 2.7.17 (CPython) - Linux-4.4.0-210-generic-i686-with-Ubuntu-16.04-xenial
[debug] exe versions: avconv 4.3, avprobe 4.3, ffmpeg 4.3, ffprobe 4.3
[debug] Proxy map: {}
[bfmtv] 202207040445: Downloading webpage
[brightcove:new] 6309108259112: Downloading JSON metadata
[brightcove:new] 6309108259112: Downloading JSON metadata
[brightcove:new] 6309108259112: Downloading m3u8 information
[brightcove:new] 6309108259112: Downloading m3u8 information
[brightcove:new] 6309108259112: Downloading MPD manifest
[brightcove:new] 6309108259112: Downloading MPD manifest
[info] Available formats for 6309108259112:
format code                                  extension  resolution note
hls-audio-0-en__Main_-0                      mp4        audio only [en] 
hls-audio-0-en__Main_-1                      mp4        audio only [en] 
hls-audio-1-en__Main_-0                      mp4        audio only [en] 
hls-audio-1-en__Main_-1                      mp4        audio only [en] 
hls-audio-2-en__Main_-0                      mp4        audio only [en] 
hls-audio-2-en__Main_-1                      mp4        audio only [en] 
dash-cc953ca1-5902-4484-8aa6-5e1716fc5e98-0  m4a        audio only [en] DASH audio   96k , m4a_dash container, mp4a.40.2 (48000Hz)
dash-cc953ca1-5902-4484-8aa6-5e1716fc5e98-1  m4a        audio only [en] DASH audio   96k , m4a_dash container, mp4a.40.2 (48000Hz)
dash-727214e5-527a-49d8-b6a7-f915ff418fe6-0  m4a        audio only [en] DASH audio  127k , m4a_dash container, mp4a.40.2 (48000Hz)
dash-727214e5-527a-49d8-b6a7-f915ff418fe6-1  m4a        audio only [en] DASH audio  127k , m4a_dash container, mp4a.40.2 (48000Hz)
dash-2a032a82-fdbe-42bb-ba45-0a5aecc53ff4-0  m4a        audio only [en] DASH audio  192k , m4a_dash container, mp4a.40.2 (48000Hz)
dash-2a032a82-fdbe-42bb-ba45-0a5aecc53ff4-1  m4a        audio only [en] DASH audio  192k , m4a_dash container, mp4a.40.2 (48000Hz)
dash-7632b8d8-9c4c-4233-80a7-a7b9415e48c8-0  mp4        384x216    DASH video  198k , mp4_dash container, avc1.42000d, video only
dash-7632b8d8-9c4c-4233-80a7-a7b9415e48c8-1  mp4        384x216    DASH video  198k , mp4_dash container, avc1.42000d, video only
hls-323-0                                    mp4        384x216     323k , avc1.42000d, video only
hls-323-1                                    mp4        384x216     323k , avc1.42000d, video only
dash-4dc17afa-4636-45b1-ab1e-1f5b339efcbe-0  mp4        640x360    DASH video  377k , mp4_dash container, avc1.4d001e, video only
dash-4dc17afa-4636-45b1-ab1e-1f5b339efcbe-1  mp4        640x360    DASH video  377k , mp4_dash container, avc1.4d001e, video only
hls-554-0                                    mp4        640x360     554k , avc1.4d001e, video only
hls-554-1                                    mp4        640x360     554k , avc1.4d001e, video only
dash-d559ea6f-9457-45bf-b742-77370930a9ad-0  mp4        960x540    DASH video  718k , mp4_dash container, avc1.4d001f, video only
dash-d559ea6f-9457-45bf-b742-77370930a9ad-1  mp4        960x540    DASH video  718k , mp4_dash container, avc1.4d001f, video only
hls-1001-0                                   mp4        960x540    1001k , avc1.4d001f, video only
hls-1001-1                                   mp4        960x540    1001k , avc1.4d001f, video only
dash-2f464eb9-faa8-424f-ae70-8131c5cd18f1-0  mp4        1280x720   DASH video 1159k , mp4_dash container, avc1.4d001f, video only
dash-2f464eb9-faa8-424f-ae70-8131c5cd18f1-1  mp4        1280x720   DASH video 1159k , mp4_dash container, avc1.4d001f, video only
hls-1486-0                                   mp4        1280x720   1486k , avc1.4d001f, video only
hls-1486-1                                   mp4        1280x720   1486k , avc1.4d001f, video only
http-2125k-720p-0                            mp4        1280x720   2125k , MP4 container, H264, 2.12GiB
http-2125k-720p-1                            mp4        1280x720   2125k , MP4 container, H264, 2.12GiB (best)
$
fds39 commented 2 years ago

Oh thank you. Could you please give me the procedure to add the patch (4 green lines) to youtube-dl.exe ? Should I extract bfmtv.pyo from youtube-dl.exe ... C:\PGM_D_ENVIRONNEMENT\youtube-dl\youtube-dl.exe\youtube_dl\extractor\ ? Sorry I'm so confused.

dirkf commented 2 years ago

Until there's a new release, or you install the git master (shortly to be updated) using python -m pip ..., just change the rmc to www in your URL: it seems to give the same result.