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

invalid subtitle file results in exception #8568

Closed
y opened this issue Feb 15, 2016 · 0 comments
Closed

invalid subtitle file results in exception #8568

y opened this issue Feb 15, 2016 · 0 comments

Comments

@y
Copy link

@y y commented Feb 15, 2016

The subtitle file here was empty (0 bytes), which resulted in an exception. youtube-dl should safely handle bad subtitle files and at worst issue a warning.

youtube-dl -v -f hls-110  'http://www.cbsnews.com/videos/john-brennan-fifa-danny-clinch/'

[debug] System config: []
[debug] User config: [u'--sub-lang', u'en', u'--convert-subtitles', u'srt', u'--write-sub', u'--embed-sub']
[debug] Command-line args: [u'-v', u'-f', u'hls-110', u'http://www.cbsnews.com/videos/john-brennan-fifa-danny-clinch/']
[debug] Encodings: locale UTF-8, fs utf-8, out None, pref UTF-8
[debug] youtube-dl version 2016.02.13
[debug] Python version 2.7.11 - Darwin-15.3.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 2.8.6, ffprobe 2.8.6, rtmpdump 2.4
[debug] Proxy map: {}
[CBSNews] john-brennan-fifa-danny-clinch: Downloading webpage
[CBSNews] john-brennan-fifa-danny-clinch: Downloading enUCJTHvRFhm SMIL data
[CBSNews] john-brennan-fifa-danny-clinch: Checking video URL
[CBSNews] john-brennan-fifa-danny-clinch: Checking video URL
[CBSNews] john-brennan-fifa-danny-clinch: Downloading ccvQ26rvOHe_ SMIL data
[CBSNews] john-brennan-fifa-danny-clinch: Checking video URL
[CBSNews] john-brennan-fifa-danny-clinch: Checking video URL
[CBSNews] john-brennan-fifa-danny-clinch: Downloading IRMD_h4AebK3 SMIL data
[CBSNews] john-brennan-fifa-danny-clinch: Downloading m3u8 information
[CBSNews] john-brennan-fifa-danny-clinch: Downloading m3u8 information
[CBSNews] john-brennan-fifa-danny-clinch: Downloading m3u8 information
[CBSNews] john-brennan-fifa-danny-clinch: Downloading m3u8 information
[CBSNews] john-brennan-fifa-danny-clinch: Downloading m3u8 information
[CBSNews] john-brennan-fifa-danny-clinch: Downloading m3u8 information
[CBSNews] john-brennan-fifa-danny-clinch: Downloading m3u8 information
[CBSNews] john-brennan-fifa-danny-clinch: Downloading oU1gPV5QSj7Y SMIL data
[info] Writing video subtitles to: John_Brennan_FIFA_Danny_Clinch-john-brennan-fifa-danny-clinch.en.ttml
[debug] Invoking downloader on u'http://ipad-streaming.cbsnews.com/media/mpx/2016/02/14/622853187889/60_MINUTES_021416_FULL_SHOW_491448_110/60_MINUTES_021416_FULL_SHOW_491448_110.m3u8'
[download] Destination: John_Brennan_FIFA_Danny_Clinch-john-brennan-fifa-danny-clinch.mp4
[debug] ffmpeg command line: ffmpeg -y -headers 'Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20150101 Firefox/44.0 (Chrome)
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Cookie: fly_geo={"countryCode": "us"}; fly_device=desktop
' -i http://ipad-streaming.cbsnews.com/media/mpx/2016/02/14/622853187889/60_MINUTES_021416_FULL_SHOW_491448_110/60_MINUTES_021416_FULL_SHOW_491448_110.m3u8 -c copy -f mp4 -bsf:a aac_adtstoasc file:John_Brennan_FIFA_Danny_Clinch-john-brennan-fifa-danny-clinch.mp4.part
ffmpeg version 2.8.6 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 7.0.2 (clang-700.1.81)
configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libsoxr --enable-libspeex --enable-libass --enable-libbluray --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --enable-vda --enable-videotoolbox --arch=x86_64 --enable-yasm --enable-librtmp --enable-libx265 --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-nonfree --enable-libfdk-aac --enable-libfaac
libavutil      54. 31.100 / 54. 31.100
libavcodec     56. 60.100 / 56. 60.100
libavformat    56. 40.101 / 56. 40.101
libavdevice    56.  4.100 / 56.  4.100
libavfilter     5. 40.101 /  5. 40.101
libavresample   2.  1.  0 /  2.  1.  0
libswscale      3.  1.101 /  3.  1.101
libswresample   1.  2.101 /  1.  2.101
libpostproc    53.  3.100 / 53.  3.100
Input #0, hls,applehttp, from 'http://ipad-streaming.cbsnews.com/media/mpx/2016/02/14/622853187889/60_MINUTES_021416_FULL_SHOW_491448_110/60_MINUTES_021416_FULL_SHOW_491448_110.m3u8':
Duration: 00:43:34.03, start: 1.400000, bitrate: 0 kb/s
Program 0 
    Metadata:
    variant_bitrate : 0
    Stream #0:0: Video: h264 (Constrained Baseline) ([27][0][0][0] / 0x001B), yuv420p, 400x224 [SAR 1:1 DAR 25:14], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 22050 Hz, stereo, fltp, 39 kb/s
[mp4 @ 0x7f87b380b000] Codec for stream 0 does not use global headers but container format requires global headers
[mp4 @ 0x7f87b380b000] Codec for stream 1 does not use global headers but container format requires global headers
Output #0, mp4, to 'file:John_Brennan_FIFA_Danny_Clinch-john-brennan-fifa-danny-clinch.mp4.part':
Metadata:
    encoder         : Lavf56.40.101
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 400x224 [SAR 1:1 DAR 25:14], q=2-31, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 22050 Hz, stereo, 39 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=  600 fps=0.0 q=-1.0 size=     351kB time=00:00:20.10 bitrate= 143.1kbits/s
...
[mpegts @ 0x7f87b3009a00] DTS 139949 < 12184191 out of order
[hls,applehttp @ 0x7f87b3005800] DTS 139949 < 12184191 out of order
...
frame=78277 fps=653 q=-1.0 Lsize=   46601kB time=00:13:46.62 bitrate= 461.8kbits/s    
video:33267kB audio:12368kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.117372%
[download] 100% of 45.51MiB
[ffmpeg] Converting subtitles
WARNING: You have requested to convert dfxp (TTML) subtitles into another format, which results in style information loss
Traceback (most recent call last):
File "/Users/y/local/bin/youtube-dl", line 11, in <module>
    sys.exit(main())
File "/Users/y/.virtualenv/lib/python2.7/site-packages/youtube_dl/__init__.py", line 411, in main
    _real_main(argv)
File "/Users/y/.virtualenv/lib/python2.7/site-packages/youtube_dl/__init__.py", line 401, in _real_main
    retcode = ydl.download(all_urls)
File "/Users/y/.virtualenv/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1692, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
File "/Users/y/.virtualenv/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 677, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
File "/Users/y/.virtualenv/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 722, in process_ie_result
    return self.process_video_result(ie_result, download=download)
File "/Users/y/.virtualenv/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1362, in process_video_result
    self.process_info(new_info)
File "/Users/y/.virtualenv/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1674, in process_info
    self.post_process(filename, info_dict)
File "/Users/y/.virtualenv/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1738, in post_process
    files_to_delete, info = pp.run(info)
File "/Users/y/.virtualenv/lib/python2.7/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 507, in run
    srt_data = dfxp2srt(f.read())
File "/Users/y/.virtualenv/lib/python2.7/site-packages/youtube_dl/utils.py", line 2052, in dfxp2srt
    dfxp = compat_etree_fromstring(dfxp_data.encode('utf-8'))
File "/Users/y/.virtualenv/lib/python2.7/site-packages/youtube_dl/compat.py", line 248, in compat_etree_fromstring
    doc = _XML(text, parser=etree.XMLParser(target=etree.TreeBuilder(element_factory=_element_factory)))
File "/Users/y/.virtualenv/lib/python2.7/site-packages/youtube_dl/compat.py", line 238, in _XML
    return parser.close()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1654, in close
    self._raiseerror(v)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1506, in _raiseerror
    raise err
xml.etree.ElementTree.ParseError: no element found: line 1, column 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.