aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/ivi.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-01-04 03:54:52 +0600
committerSergey M․ <dstftw@gmail.com>2016-01-04 03:54:52 +0600
commit1463c5b9ac16bd50d5e30d2145ec584d1e6e74ce (patch)
treed992d620bf5a13affdd9d7b5375c561e36a279ac /youtube_dl/extractor/ivi.py
parentc6270b2ed5be9e83bcb8114511641f9c5ad9008d (diff)
[ivi] Extract season info
Diffstat (limited to 'youtube_dl/extractor/ivi.py')
-rw-r--r--youtube_dl/extractor/ivi.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/youtube_dl/extractor/ivi.py b/youtube_dl/extractor/ivi.py
index 9ccfee173..d0f00cdea 100644
--- a/youtube_dl/extractor/ivi.py
+++ b/youtube_dl/extractor/ivi.py
@@ -41,6 +41,8 @@ class IviIE(InfoExtractor):
'ext': 'mp4',
'title': 'Двое из ларца - Дело Гольдберга (1 часть)',
'series': 'Двое из ларца',
+ 'season': 'Сезон 1',
+ 'season_number': 1,
'episode': 'Дело Гольдберга (1 часть)',
'episode_number': 1,
'duration': 2655,
@@ -105,6 +107,13 @@ class IviIE(InfoExtractor):
webpage = self._download_webpage(url, video_id)
+ season = self._search_regex(
+ r'<li[^>]+class="season active"[^>]*><a[^>]+>([^<]+)',
+ webpage, 'season', default=None)
+ season_number = int_or_none(self._search_regex(
+ r'<li[^>]+class="season active"[^>]*><a[^>]+data-season(?:-index)?="(\d+)"',
+ webpage, 'season number', default=None))
+
episode_number = int_or_none(self._search_regex(
r'<meta[^>]+itemprop="episode"[^>]*>\s*<meta[^>]+itemprop="episodeNumber"[^>]+content="(\d+)',
webpage, 'episode number', default=None))
@@ -116,6 +125,8 @@ class IviIE(InfoExtractor):
'id': video_id,
'title': title,
'series': compilation,
+ 'season': season,
+ 'season_number': season_number,
'episode': episode,
'episode_number': episode_number,
'thumbnails': thumbnails,