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.78k stars 9.98k forks source link

[SRGSSR] Failed to download m3u8 or f4m #23313

Closed AntoninRousset closed 3 years ago

AntoninRousset commented 4 years ago

Checklist

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.rts.ch/play/tv/le-bazar-de-la-charite/video/episode-7-episode-78-saison-1?id=10897634']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.11.28
[debug] Python version 3.6.9 (CPython) - Linux-4.19.72-gentoo-x86_64-Intel-R-_Core-TM-_i5-3210M_CPU_@_2.50GHz-with-gentoo-2.6
[debug] exe versions: ffmpeg 4.1.3, ffprobe 4.1.3, rtmpdump 2.4
[debug] Proxy map: {}
[SRGSSR] 10897634: Downloading JSON metadata
[SRGSSR] 10897634: Downloading HTTP-HLS-HD token
[SRGSSR] 10897634: Downloading m3u8 information
WARNING: Failed to download m3u8 information: HTTP Error 403: Forbidden
[SRGSSR] 10897634: Downloading HTTP-HLS-SD token
[SRGSSR] 10897634: Downloading m3u8 information
WARNING: Failed to download m3u8 information: HTTP Error 403: Forbidden
[SRGSSR] 10897634: Downloading HTTP-HDS-HD token
[SRGSSR] 10897634: Downloading f4m manifest
WARNING: Unable to download f4m manifest: HTTP Error 403: Forbidden
[SRGSSR] 10897634: Downloading HTTP-HDS-SD token
[SRGSSR] 10897634: Downloading f4m manifest
WARNING: Unable to download f4m manifest: HTTP Error 403: Forbidden
ERROR: No video formats found; 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.
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 796, in extract_info
    ie_result = ie.extract(url)
  File "/usr/lib64/python3.6/site-packages/youtube_dl/extractor/common.py", line 530, in extract
    ie_result = self._real_extract(url)
  File "/usr/lib64/python3.6/site-packages/youtube_dl/extractor/srgssr.py", line 95, in _real_extract
    self._sort_formats(formats)
  File "/usr/lib64/python3.6/site-packages/youtube_dl/extractor/common.py", line 1327, in
_sort_formats
    raise ExtractorError('No video formats found')
youtube_dl.utils.ExtractorError: No video formats found; 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.

Description

Unfortunately the video will not be online for a long time, but this issue may happen for other videos. SRGSSRIE extractor is able to download episode 6 but not episode 7; I checked the asset_url and the only relevant difference is the presence of the ?caption=... in the query string of the episode 7. To solve it I changed the line in _real_extract:

asset_url = asset['text']

to

asset_url = re.sub('\?caption=[^,?]*', '', asset['text'])

A bit sloppy, maybe we should prevent any addition of query, but this did the trick.

remitamine commented 3 years ago

No longer accessible.