youtube-dl: 【FranceTV】Download no longer possible
Checklist
- I’m reporting a broken site support
- I’ve verified that I’m running youtube-dl version 2021.06.06
- 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
C:\Users\DELL\video>youtube-dl -v https://www.france.tv/france-3/plus-belle-la-vie/plus-belle-la-vie-saison-18/2739781-episode-du-vendredi-10-septembre-2021.html
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.france.tv/france-3/plus-belle-la-vie/plus-belle-la-vie-saison-18/2739781-episode-du-vendredi-10-septembre-2021.html']
[debug] Encodings: locale cp936, fs mbcs, out cp936, pref cp936
[debug] youtube-dl version 2021.03.14
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.18362
[debug] exe versions: ffmpeg N-89508-g1f1207145a, ffprobe N-89508-g1f1207145a
[debug] Proxy map: {'http': 'http://127.0.0.1:52528', 'socks': 'socks://127.0.0.1:52527', 'https': 'https://127.0.0.1:52528'}
[FranceTVSite] 2739781-episode-du-vendredi-10-septembre-2021: Downloading webpage
[FranceTV] b44f8a0a-e316-4735-9e1f-0fdf9839e2e2: Downloading video JSON
ERROR: Unable to download JSON metadata: HTTP Error 404: Not Found (caused by HTTPError()); 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.
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp8z3w9mz6\build\youtube_dl\extractor\common.py", line 634, in _request_webpage
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp8z3w9mz6\build\youtube_dl\YoutubeDL.py", line 2279, in urlopen
File "C:\Python\Python34\lib\urllib\request.py", line 470, in open
File "C:\Python\Python34\lib\urllib\request.py", line 580, in http_response
File "C:\Python\Python34\lib\urllib\request.py", line 508, in error
File "C:\Python\Python34\lib\urllib\request.py", line 442, in _call_chain
File "C:\Python\Python34\lib\urllib\request.py", line 588, in http_error_default
C:\Users\DELL\video>
Description
Hi team,
I can’t seem to download any more video from FRANCE.TV, here are some examples:
https://www.france.tv/france-3/plus-belle-la-vie/plus-belle-la-vie-saison-18/2743611-episode-du-lundi-13-septembre-2021.html https://www.france.tv/france-2/amour-gloire-et-beaute/2743793-emission-du-lundi-13-septembre-2021.html https://www.france.tv/france-5/la-quotidienne/la-quotidienne-saison-9/2743883-emission-du-lundi-13-septembre-2021.html
I assure you it has nothing to do with any of my VPNs for I have verified these videos play like a charm in the browser with my VPNs turned on.
Could you please look into this FRANCE.TV issue on priority and help to publish the latest version ASAP?
Many Thanks!! NiesmialyGosc
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 18
- Comments: 194 (15 by maintainers)
Commits related to this issue
- [version] update :ci skip all — committed to yt-dlp/yt-dlp by pukkandan 3 years ago
- [francetv] Update extractor (#1096) Original PR: https://github.com/ytdl-org/youtube-dl/pull/29996 Closes: https://github.com/yt-dlp/yt-dlp/issues/970, https://github.com/ytdl-org/youtube-dl/issues/... — committed to yt-dlp/yt-dlp by fstirlitz 3 years ago
- [francetv] Update extractor (#1096) Original PR: https://github.com/ytdl-org/youtube-dl/pull/29996 Closes: https://github.com/yt-dlp/yt-dlp/issues/970, https://github.com/ytdl-org/youtube-dl/issues/... — committed to nixxo/yt-dlp by fstirlitz 3 years ago
- Updated with patch by sarnoud Updated with patch by @sarnoud via https://github.com/ytdl-org/youtube-dl/issues/29956 — committed to scramblr/youtube-dl by scramblr 3 years ago
Here is quick early patch I wrote that seems to repair quite a few links. youtube-dl-patch.txt
In your Python directory (i.e. /usr/lib/python3/dist-packages for Linux) enter the following command:
patch youtube_dl/extractor/francetv.py < youtube-dl-patch.txtEt voilà 😃
Workaround for lazy people like me:
manifest.mpdfilemanifest.mpdfile using dev toolsExample:
For newbies who don’t understand how to follow the comprehensive information repeated several times in this issue thread, if as me, you’re using compiled version in /usr/local/bin/youtube-dl, here’s a simple procedure to replace it:
(French version)
Pour les débutants qui ne comprennent pas comment appliquer les instructions complètes indiquées ci-dessus dans ce suivi de problème (surtout destiné à corriger le code pour que ce soit intégré à la prochaine version), si comme moi vous utilisez la version compilée dans /usr/local/bin/youtube-dl, voici une procédure simple pour la remplacer. Ces commandes sont à exécuter en utilisateur non privilégié, d’où le sudo devant cp. Il vous faut au préalable les programmes wget, make, zip, pas forcément installés.
Hello @NiesmialyGosc, below I upload the complete
francetv.pyfile patched with @sarnoud fix. Suppress.txtextension and replaceextractor/francetv.pyin your youtube-dl local installation by this modified version.Hope that helps.
francetv.py.txt
I just downloaded the last update of Captvty (version 2.9.4.1) which fixes the extraction of France Télévisions’ contents and I tried to download
Les Enquêtes de Murdochreplays (which are DRM protected contents) and Captvty was able to download the replays without DRMs! So I looked into the app requests to see how the extraction works and here is how the app is able to download non-protected M3U8s playlists:(Note: the example I am using is based on this program.)
https://cloudreplay.ftven.fr/7ecf38ef53416/1036062453_france-domtom_DRM.ism/manifest.mpd, so the id is7ecf38ef53416) and reverses it (61435fe83fce7). It tooks also the string of theplurimedia_id(1036066892).replayftv-vhURL based on the following structure:https://replayftv-vh.akamaihd.net/i/streaming-adaptatif_media-secure_france-dom-tom/YEAR/SWEEK/JDAY/PLURIMEDIA_ID-MANIFEST_ID_REVERSED-,standard1,standard2,standard3,standard4,qaa,.mp4.csmil/master.m3u8Where
YEAR,WEEK(which represents the week number of the broadcast) andDAY(which represents the day number of the broadcast) should be extracted somewhere (maybe from thebroadcasted_atstring in the JSON player response): for my example, the values are respectively2021,37and1. ThePLURIMEDIA_IDandMANIFEST_IDvalues are the corresponding values we are getting from the step 2…The app requests then the
token-akamai/hdfauthftv-aendpoint with the URL created (https://hdfauthftv-a.akamaihd.net/esi/TA?format=json&url=https://replayftv-vh.akamaihd.net/i/streaming-adaptatif_media-secure_france-dom-tom/2021/S37/J1/1036062453-61435fe83fce7-,standard1,standard2,standard3,standard4,qaa,.mp4.csmil/master.m3u8).It takes the URL returned in the JSON response (from the
urlstring) and fetches it. In this case, we are getting a 404 error (An error occurred while processing your request.).But Captvty increases the
DAYnumber to 1 (and of course theWEEKnumber, ifDAYis equal to 7) and repeats steps 4. and 5. a few times:https://hdfauthftv-a.akamaihd.net/esi/TA?format=json&url=https://replayftv-vh.akamaihd.net/i/streaming-adaptatif_media-secure_france-dom-tom/2021/S37/J2/1036062453-61435fe83fce7-,standard1,standard2,standard3,standard4,qaa,.mp4.csmil/master.m3u8-> URL with token returns 404.https://hdfauthftv-a.akamaihd.net/esi/TA?format=json&url=https://replayftv-vh.akamaihd.net/i/streaming-adaptatif_media-secure_france-dom-tom/2021/S37/J3/1036062453-61435fe83fce7-,standard1,standard2,standard3,standard4,qaa,.mp4.csmil/master.m3u8-> URL with token returns 404.And when requesting an URL with a token with 4 as the value of
DAY(J4) (https://hdfauthftv-a.akamaihd.net/esi/TA?format=json&url=https://replayftv-vh.akamaihd.net/i/streaming-adaptatif_media-secure_france-dom-tom/2021/S37/J4/1036062453-61435fe83fce7-,standard1,standard2,standard3,standard4,qaa,.mp4.csmil/master.m3u8), the URL we are getting fromtoken-akamai/hdfauthftv-aworks (response code 200) and is not protected by DRMs!I don’t know if this can be implemented in youtube-dl (and/or in its forks), but at least we have now a fix for DRM protected videos on the website/apps!
(Note: by searching for what is
qaa, I found it means for original version, maybe this “param” is not always present on some streams.)Merci @alexisfrjp ça fonctionne nickel désormais !
Et merci @sarnoud pour le patch !
Patch works. Thanks.
Need to download video and audio separately :
youtube-dl -i -f “bestvideo,bestaudio” https://www.france.tv/france-3/carnets-de-vol/2783631-emission-du-samedi-11-septembre-2021.html
Merging video and audio :
ffmpeg -i Carnets\ de\ vol-a386d839-8337-4975-bc98-767299aafb82.mp4 -i Carnets\ de\ vol-a386d839-8337-4975-bc98-767299aafb82.m4a -c copy -map 0:0 -map 1:0 Carnets\ de\ vol.mp4
Même problème.
@Bocio First, try with a non-mobile URL (https://www.france.tv/france-2/mediterranee-l-odyssee-pour-la-vie/3257512-les-aventuriers-de-la-mediterranee.html). Second, since the France.tv extractor was not patched in youtube-dl since it broke last September, use yt-dlp instead: it will work fine, and use the same parameters than yt-dl.
The logic described is definitely within the scope of what yt-dl can do. There is an extractor method
_is_valid_url()that could be used to check the URLs returned by Akamai in step 5. Presumably increase the DAY by 1 rather than ~to~ 1?Python has
datetime.isocalendar()to get the week and day number oncebroadcasted_athas been parsed into a timestamp and then passed todatetime.fromtimestamp().Is there any rule as to how many times the Akamai API has to be challenged before it reveals a valid URL?
In the yt-dlp discussion it was mentioned that qxx is a private-use ISO 639 language code. An audio description may be tagged
qad. See also here.For what it’s worth… I discovered that you can still have access to videos which are no longer “officially” available. What you need is the “videoid” code. Search engines (Google, Bing) proposing “cached” pages are of little help since their “cached” version of the web page is usually very recent (2-3 days at most), and they don’t keep archives (each new version replaces the former) ; archive.org does keep multiple versions of a same page but doesn’t browse that kind of website. In this case that works though : right now (2021/09/22 07:00 AM) Google’s cached page, which was saved on 2021/09/20 08:06 PM, does contain the code for the program mentioned above. If that doesn’t work, I found out that it is possible to dump a JSON file containing data relative to all programs that were available on the “replay” platform for a given channel over the past few weeks. I now do such dumps regularly with a script :
(Change the name of the channel to get a similar dump for that channel, for instance “france-5” instead of “france-3”. I tried various values for “size”, it would seem like the limit is 9999, but 1000 should be more than enough for such purposes, it covers about 2 weeks of broadcasts.) Open the resulting file with MiTeC JSONView, search the “product_id” code of the page you’re looking for (the one appearing in the web page URL, in this case “736443” – the interface is a bit capricious, sometimes you have to press the “TAB” key to highlight the search box as it won’t work with the mouse pointer), then go to “content has media”, then “<element #0>”, then “media”, and there you should find the “videoid” code. With this code you can then download the specific JSON page for this program through this URL. (For another program, replace the “videoid” code and the “product_id” code, although in practice the second one doesn’t seem to matter.) And the video link is still there (which wasn’t the case before, I could still reconstruct it but it involved a few more tricks). I don’t know how long it works beyond the regular end of availibility ; in the past I’ve been able to download videos from M3U8 links up to about a month later, now with the complete overhaul of the platform I’ll have to test again. (For those interested, I asked about this here, got little insight but that was enough to get on the right track to finding what I was looking for on my own.)
Now, could someone reply to my questions about the most recommended methods to download and convert those streams ? Should I be concerned with those warnings about “packet discontinuity” and whatnot, when converting TS files downloaded by Captvty to MP4 with either ffmpeg or mp4box, or are there extra options that could solve the issue altogether ? Does anyone know what exact command Captvty uses to record those streams (with video and audio separated) to a single TS file, and why it proceeds like this ? (I mean : why does it record to a single TS file considering that it then goes through a rather complicated process to demux those streams before remuxing them as MP4 ?) I tried doing it manually with ffmpeg but I get a 403 error ; apparently youtube-dl follows a redirection whereas ffmpeg gets stuck.
When downloading with youtube-dl, a small annoyance is that the resulting files are identified by MediaInfo as having a “constant” audio bitrate, whereas it should be “variable”. When converting a TS file downloaded by Captvty to MP4, either through Captvty’s own convoluted 3 steps method, or with ffmpeg, or with mp4box, the audio bitrate is correctly identified as “variable” in the resulting file. I tried downlading to TS with youtube-dl (to see if downloading to TS and then converting to MP4 would fix the erroneous audio bitrate identification), but it insists on generating a MP4 file. (I asked about these minor issues on the VideoHelp forum, got very little insight, quite frustrating.)
Another question : now there’s only link available, which if I’m not mistaken corresponds to the “DASH” protocol (I’ll admit that I have a very cursory and empirical knowledge of all that stuff). How do you get the “HLS” versions (which are apparently made available with this new patch), and what is the difference ?
@NiesmialyGosc
To get subtitles for:
https://www.france.tv/france-3/plus-belle-la-vie/plus-belle-la-vie-saison-18/2743347-episode-du-mardi-14-septembre-2021.html
The manifest.mpd is:
https://cloudreplay.ftven.fr/6f1d1b301a316/1036062661_france-domtom_TA.ism/ZXhwPTE2MzE2NTQ3MDh+YWNsPSUyZjZmMWQxYjMwMWEzMTYlMmYxMDM2MDYyNjYxX2ZyYW5jZS1kb210b21fVEEuaXNtKn5obWFjPTNlNjU1N2QxNTYwYWEwZjQ1NjcyYTIwMmRmYTgyYWRkYjg5ZDU5YThmYmMwODEwNmI5Nzc2NGViNDZjNTg1NzE=/manifest.mpd
In Firefox (any browser) replace manifest.mpd with textstream_fre=1000.webvtt and save file as vtt
https://cloudreplay.ftven.fr/6f1d1b301a316/1036062661_france-domtom_TA.ism/ZXhwPTE2MzE2NTQ3MDh+YWNsPSUyZjZmMWQxYjMwMWEzMTYlMmYxMDM2MDYyNjYxX2ZyYW5jZS1kb210b21fVEEuaXNtKn5obWFjPTNlNjU1N2QxNTYwYWEwZjQ1NjcyYTIwMmRmYTgyYWRkYjg5ZDU5YThmYmMwODEwNmI5Nzc2NGViNDZjNTg1NzE=/textstream_fre=1000.webvtt
Useful info for a future back-port/update.
Can confirm this on latest
yt-dlp-nightly, from a non-French IP address; however, using a French VPN, the programme referenced by @amigainc appears well supported:Be that as it may, this is still the
yt-dlissue tracker and can confirmyt-dlitself remains in a broken state:(test above performed under the same French VPN…).
It works well with yt-dlp 2023.06.22:
yt-dlp finds manifests but they are 403 from the UK, regardless of
--geo-bypass-country FR. I guess that they could be OK from FR.@TiA4f8R Yes, it works!!! Thank you!!!
J2? It would mean that they have re-uploaded the video (J2 = Tuesday, so today), because they had uploaded it first yesterday (Monday, soJ1). The date to find is the date when the video was uploaded in the server (not always the broadcast day, especially for the “avant-première” version, when it’s available before it has aired on the linear TV; once it’s done, they replace it by the brodcasted version).And no
.qaain the request? Well, we’ll see for the next episode, this Sunday.@Trit34 I think you still don’t understand what I am saying. You can’t use this URL, you need to get a temporary URL with the hdauth server for this URL (so an URL with an authorization in its params). That’s why you need to request the hdauth endpoint with the URL of the playlist (
https://hdfauthftv-a.akamaihd.net/esi/TA?format=json&url=https://replayftv-vh.akamaihd.net/i/streaming-adaptatif_media-secure_france-dom-tom/2021/S39/J2/1040654889-6152c2dceecf4-,standard1,standard2,standard3,standard4,qaa,.mp4.csmil/master.m3u8).Then look at the JSON response, copy the URL you get from the hdauth server and use it to download the stream. The URL should look like this:
https://replayftv-vh.akamaihd.net/i/streaming-adaptatif_media-secure_france-dom-tom/2021/S39/J2/1040654889-6152c2dceecf4-,standard1,standard2,standard3,standard4,qaa,.mp4.csmil/master.m3u8?hdnea=exp=1633209940~acl=%2fi%2fstreaming-adaptatif_media-secure_france-dom-tom%2f2021%2fS39%2fJ2%2f1040654889-6152c2dceecf4-,standard1,standard2,standard3,standard4,qaa,.mp4.csmil*~hmac=7c3e3afe0b9592ec429084d09af41149aab7649ac7bf31df3a7ef1bcc1b6db3eHope you can now understand what I wanted to say.
Merci pour le patch rapide. Je ne critique jamais ceux qui travaillent (sauf si je paye). Ce n’est pas la panacée, mais ça permet de continuer à récupérer des vidéos avant qu’elles ne disparaissent, modulo un “post-processing” manuel. S’il y a des choses qu’on peut faire sans être un spécialiste, n’hésitez pas à demander. Cordialement
@guy-teube Sorry, remove
--userand use just sudo to remove the globally installed app. If your user is the only one usingyoutube-dl, remove the global package:sudo pip uninstall youtube-dland keep the user’s one. Then apply the patchpatch /home/myuser/.local/lib/python2.7/site-packages/youtube_dl/extractor/francetv.py < youtube-dl-patch.txt.06/06/2021 alors que nous sommes le 15/09/2021…???
En français pour toi : je recommande de passer d’abord par
youtube-dl -F [URL]pour récupérer les identifiants des bons flux vidéo et audio, car j’ai déjà constaté chez France TV que laisser récupérer automatiquement bestvideo et bestaudio pouvait récupérer le flux audio d’audiodescription pour les malvoyants ou la version originale d’une série étrangère. C’est pas forcément ce qu’on veut.Par exemple : pour Slam d’aujourd’hui, tu fais ensuite
youtube-dl -f dash-video=2000000+dash-audio_fre=96000 https://www.france.tv/france-3/slam/2743369-emission-du-mardi-14-septembre-2021.html, et si tu as ffmpeg installé, ce dernier sera automatiquement sollicité pour réunir les deux flux en un fichier MP4 unique. Tu utiliseras ensuite la méthode donnée plus haut pour les sous-titres.@D84web Open the console (F12) then Network tab. When the video is launched, make a search “manifest” (under this Network tab), and you will get this url.
@D84web @LateLament
Thank you both team for the support! This is greatly appreciated & your tips really useful for future reference. THANK U. Can we have the subtitles downloaded as well?
I actually had to resort to “Lj video downloader” for the video download, and the only & key issue is actually with the subtitles for which I had to use the yt-dlp downloader:
https://www.france.tv/france-3/plus-belle-la-vie/plus-belle-la-vie-saison-18/2743347-episode-du-mardi-14-septembre-2021.html
However, the generated subtitle file is in a mess which looks like this:
As a result, I have to remove those tags & recode the encoding which would take a lot of work… Is there a better way to generate the subtitles than using the yt-dlp tool??? Or could any of you provide some tips on how to mass download, merge & reformat the webvtt files from France.TV, or a quick fix to remove the tags above? (If possible & if you could elaborate each step in detail, that’ll be great)
Thanks & Regards NiesmialyGosc
Sorry I don’t understand. I’m not an professional IT guy and I can’t understand some technical terms such as “patched with” & “youtube-dl local installation”.
Is youtube-dl intended for users with IT development knowledge (e.g. python) only?
Could anyone please help to translate the above into an on-the-ground language without me as a normal user that wishes to watch online videos having to learn python grammar & vocabulary from scratch?
Thank you for your patience & time, NiesmialyGosc
Hello @guy-teube , your local youtube-dl installation should be in
/usr/local/lib/python3.9/dist-packages/youtube_dl-...(modify python3.9 path if you have another version).The file to patch is
extractor/francetv.pyI confirm this issue with FranceTV site. Specific code for extractor is in
youtube_dl/extractor/francetv.pyTo download JSON metadata, extractor requests
https://sivideo.webservices.francetelevisions.fr/tools/getInfosOeuvre/v2/with video ID (line 94). But it seems that this API is deprecated 😦With datas used for tests in FranceTV extractor (line 51) : request for https://sivideo.webservices.francetelevisions.fr/tools/getInfosOeuvre/v2/?idDiffusion=162311093 => JSON message
{"status":"NOK","code":404,"message":"This api is deprecated, contact France.tv video-factory"}After a few debug, I didn’t find the new URL/service in my HTTP logs to get metadatas via API.