J'essaie
youtube-dl https://www.youtube.com/watch?v=0QRO3gKj3qw --write-sub --convert-subtitles srt -v
le résultat est négatif
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'https://www.youtube.com/watch?v=0QRO3gKj3qw', u'--write-sub', u'--convert-subtitles', u'srt', u'-v']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.08.24.1
[debug] Python version 2.7.12 - Linux-4.4.0-36-generic-x86_64-with-Ubuntu-16.04-xenial
[debug] exe versions: avconv v12_dev0-3134-g6755eb5, avprobe v12_dev0-3134-g6755eb5, ffmpeg 3.1.2-1, ffprobe 3.1.2-1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] 0QRO3gKj3qw: Downloading webpage
[youtube] 0QRO3gKj3qw: Downloading video info webpage
[youtube] 0QRO3gKj3qw: Extracting video information
[youtube] 0QRO3gKj3qw: Downloading MPD manifest
[info] Writing video subtitles to: What is Google Chrome OS-0QRO3gKj3qw.en.vtt
[debug] Invoking downloader on u'https://r2---sn-hpa7zned.googlevideo.com/videoplayback?id=d1044ede02a3deac&itag=136&source=youtube&requiressl=yes&mv=m&ms=au&pl=19&mn=sn-hpa7zned&mm=31&initcwndbps=58750&nh=IgpwcjAxLm1pbDAyKgkxMjcuMC4wLjE&ratebypass=yes&mime=video/mp4&gir=yes&clen=10330102&lmt=1457610153524637&dur=200.916&mt=1472162919&sver=3&key=dg_yt0&signature=871A09D44DD94771EDE6E5D76843EE652268357E.5CE50080607644DD88125B0841D21F95B4C2BA01&upn=XhAQxU6qSMo&ip=41.200.192.33&ipbits=0&expire=1472185159&sparams=ip,ipbits,expire,id,itag,source,requiressl,mv,ms,pl,mn,mm,initcwndbps,nh,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: What is Google Chrome OS-0QRO3gKj3qw.f136.mp4
[download] 100% of 9.85MiB in 00:49
[debug] Invoking downloader on u'https://r2---sn-hpa7zned.googlevideo.com/videoplayback?id=d1044ede02a3deac&itag=140&source=youtube&requiressl=yes&mv=m&ms=au&pl=19&mn=sn-hpa7zned&mm=31&initcwndbps=58750&nh=IgpwcjAxLm1pbDAyKgkxMjcuMC4wLjE&ratebypass=yes&mime=audio/mp4&gir=yes&clen=3194068&lmt=1457610143781263&dur=201.061&mt=1472162919&sver=3&key=dg_yt0&signature=0DD64B9C971E69D61C6D7DD01C8884412CC05A0E.66C91FC66FAC5ECAC65901F4C3C7B60A2E5A6167&upn=XhAQxU6qSMo&ip=41.200.192.33&ipbits=0&expire=1472185159&sparams=ip,ipbits,expire,id,itag,source,requiressl,mv,ms,pl,mn,mm,initcwndbps,nh,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: What is Google Chrome OS-0QRO3gKj3qw.f140.m4a
[download] 100% of 3.05MiB in 00:18
[ffmpeg] Merging formats into "What is Google Chrome OS-0QRO3gKj3qw.mp4"
[debug] ffmpeg command line: avconv -y -i 'file:What is Google Chrome OS-0QRO3gKj3qw.f136.mp4' -i 'file:What is Google Chrome OS-0QRO3gKj3qw.f140.m4a' -c copy -map 0:v:0 -map 1:a:0 'file:What is Google Chrome OS-0QRO3gKj3qw.temp.mp4'
Deleting original file What is Google Chrome OS-0QRO3gKj3qw.f136.mp4 (pass -k to keep)
Deleting original file What is Google Chrome OS-0QRO3gKj3qw.f140.m4a (pass -k to keep)
[ffmpeg] Converting subtitles
[debug] ffmpeg command line: avconv -y -i 'file:What is Google Chrome OS-0QRO3gKj3qw.en.vtt' -f srt 'file:What is Google Chrome OS-0QRO3gKj3qw.en.srt'
ERROR: file:What is Google Chrome OS-0QRO3gKj3qw.en.vtt: Invalid data found when processing input
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1832, in post_process
files_to_delete, info = pp.run(info)
File "/usr/lib/python2.7/dist-packages/youtube_dl/postprocessor/ffmpeg.py", line 572, in run
self.run_ffmpeg(old_file, new_file, ['-f', new_format])
File "/usr/lib/python2.7/dist-packages/youtube_dl/postprocessor/ffmpeg.py", line 172, in run_ffmpeg
self.run_ffmpeg_multiple_files([path], out_path, opts)
File "/usr/lib/python2.7/dist-packages/youtube_dl/postprocessor/ffmpeg.py", line 168, in run_ffmpeg_multiple_files
raise FFmpegPostProcessorError(msg)
FFmpegPostProcessorError
1. Le problème:
Le problème peut être vu dans votre débogage. Vous avez le dernier youtube-dl
:
[debug] youtube-dl version 2016.08.24.1
ce qui est excellent, mais votre journal de contrôle montre que vous avez les deux avconv
et ffmpeg
installés:
[debug] exe versions: avconv v12_dev0-3134-g6755eb5, avprobe v12_dev0-3134-g6755eb5,
ffmpeg 3.1.2-1, ffprobe 3.1.2-1, rtmpdump 2.4
Notez que si les deux sont installés, alors avconv
sera utilisé par défaut :
--prefer-avconv Prefer avconv over ffmpeg for running the postprocessors (default)
--prefer-ffmpeg Prefer ffmpeg over avconv for running the postprocessors
2. La solution:
Tester sur mon propre système indique que si vous utilisez ffmpeg
plutôt que avconv
votre téléchargement et votre conversion fonctionnent parfaitement, vous avez donc deux choix de solution:
--prefer-ffmpeg
à votre ligne de commande pour une commande unique--prefer-ffmpeg
au fichier ~/.config/youtube-dl.conf
pour un résultat plus permanent. Vous devrez peut-être créer ce fichier initialement en exécutant la commande: touch ~/.config/youtube-dl.conf
Fonctionne très bien sur mon système ...