projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2c39b0c
)
[orf] Fix segments extraction (Closes #2501)
author
Sergey M․
<dstftw@gmail.com>
Mon, 3 Mar 2014 11:05:46 +0000
(18:05 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Mon, 3 Mar 2014 11:05:46 +0000
(18:05 +0700)
youtube_dl/extractor/orf.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/orf.py
b/youtube_dl/extractor/orf.py
index 5f5694393765104b45b573c53155d447a45b1e50..03421d1d5c78f2acd712e560ae17fb96d4a323be 100644
(file)
--- 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,
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)
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)
def quality_to_int(s):
m = re.search('([0-9]+)', s)