diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-12-25 15:33:09 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-12-25 15:33:09 +0100 |
commit | 61224dbcdd46052b264e422cc45da907fb06fd42 (patch) | |
tree | 4439882cb4463ea63e58d35bc1cf758f5cb53c79 /youtube_dl/extractor | |
parent | c3afc93a69fbfbe7712278f7ad03d0369ac9f885 (diff) |
[zdf] Make width extraction more robust
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/zdf.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/youtube_dl/extractor/zdf.py b/youtube_dl/extractor/zdf.py index 94594c5d6..829f002cf 100644 --- a/youtube_dl/extractor/zdf.py +++ b/youtube_dl/extractor/zdf.py @@ -1,10 +1,10 @@ # coding: utf-8 -import operator import re from .common import InfoExtractor from ..utils import ( + int_or_none, unified_strdate, ) @@ -67,7 +67,7 @@ class ZDFIE(InfoExtractor): ''', format_id) ext = format_m.group('container') - proto = format_m.group('proto') + proto = format_m.group('proto').lower() quality = fnode.find('./quality').text abr = int(fnode.find('./audioBitrate').text) // 1000 @@ -85,11 +85,11 @@ class ZDFIE(InfoExtractor): 'vcodec': format_m.group('vcodec'), 'abr': abr, 'vbr': vbr, - 'width': int(fnode.find('./width').text), - 'height': int(fnode.find('./height').text), - 'filesize': int(fnode.find('./filesize').text), + 'width': int_or_none(fnode.find('./width').text), + 'height': int_or_none(fnode.find('./height').text), + 'filesize': int_or_none(fnode.find('./filesize').text), 'format_note': format_note, - 'protocol': format_m.group('proto').lower(), + 'protocol': proto, '_available': is_available, } |