aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-12-19 19:23:28 +0600
committerSergey M․ <dstftw@gmail.com>2015-12-19 19:23:28 +0600
commit8f097af4ec5d6ff72a80c744d67f947336fecb28 (patch)
tree7aab5e37025249f9d608f2a1a24168d30e78d75d
parentc40dbb19ab475e8a0e1b29548130adf9ce13ea43 (diff)
[toggle] Extract counters
-rw-r--r--youtube_dl/extractor/togglesg.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/youtube_dl/extractor/togglesg.py b/youtube_dl/extractor/togglesg.py
index a2b89d6bb..36367971f 100644
--- a/youtube_dl/extractor/togglesg.py
+++ b/youtube_dl/extractor/togglesg.py
@@ -8,6 +8,7 @@ from .common import InfoExtractor
from ..utils import (
determine_ext,
ExtractorError,
+ float_or_none,
int_or_none,
parse_iso8601,
sanitized_Request,
@@ -152,6 +153,10 @@ class ToggleSgIE(InfoExtractor):
description = info.get('Description')
created_at = parse_iso8601(info.get('CreationDate') or None)
+ average_rating = float_or_none(info.get('Rating'))
+ view_count = int_or_none(info.get('ViewCounter') or info.get('view_counter'))
+ like_count = int_or_none(info.get('LikeCounter') or info.get('like_counter'))
+
thumbnails = []
for picture in info.get('Pictures', []):
if not isinstance(picture, dict):
@@ -177,6 +182,9 @@ class ToggleSgIE(InfoExtractor):
'description': description,
'duration': duration,
'timestamp': created_at,
+ 'average_rating': average_rating,
+ 'view_count': view_count,
+ 'like_count': like_count,
'thumbnails': thumbnails,
'formats': formats,
}