youtube-dl

Another place where youtube-dl lives on
git clone git://git.oshgnacknak.de/youtube-dl.git
Log | Files | Refs | README | LICENSE

commit f92259c0260880ac8e5f285b4b267183b97761c0
parent 0afef30b23dbf5e590f510924a1271f515512ac3
Author: Philipp Hagemeister <phihag@phihag.de>
Date:   Mon,  3 Mar 2014 12:34:34 +0100

Merge remote-tracking branch 'origin/master'

Diffstat:
Myoutube_dl/extractor/orf.py | 11++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/youtube_dl/extractor/orf.py b/youtube_dl/extractor/orf.py @@ -8,6 +8,7 @@ from .common import InfoExtractor from ..utils import ( HEADRequest, unified_strdate, + ExtractorError, ) @@ -35,7 +36,15 @@ class ORFIE(InfoExtractor): data_json = self._search_regex( r'initializeAdworx\((.+?)\);\n', webpage, 'video info') all_data = json.loads(data_json) - sdata = all_data[0]['values']['segments'] + + def get_segments(all_data): + for data in all_data: + if data['name'] == 'Tracker::EPISODE_DETAIL_PAGE_OVER_PROGRAM': + return data['values']['segments'] + + sdata = get_segments(all_data) + if not sdata: + raise ExtractorError('Unable to extract segments') def quality_to_int(s): m = re.search('([0-9]+)', s)