aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2014-09-02 20:54:00 +0700
committerSergey M․ <dstftw@gmail.com>2014-09-02 20:54:00 +0700
commit3baa62e8d1aa98bdb42ddf91e8b139d2dd36ff9e (patch)
treee14bbc94cd2282179ab12db699f476eef09f997c /youtube_dl/extractor
parent1bf8cf5c2c6d9b54824fda6c9e0477f9eaabd776 (diff)
[beeg] Extract all formats
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/beeg.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/youtube_dl/extractor/beeg.py b/youtube_dl/extractor/beeg.py
index d7301fe18..314e37f8b 100644
--- a/youtube_dl/extractor/beeg.py
+++ b/youtube_dl/extractor/beeg.py
@@ -27,8 +27,16 @@ class BeegIE(InfoExtractor):
webpage = self._download_webpage(url, video_id)
- video_url = self._html_search_regex(
- r"'480p'\s*:\s*'([^']+)'", webpage, 'video URL')
+ quality_arr = self._search_regex(
+ r'(?s)var\s+qualityArr\s*=\s*{\s*(.+?)\s*}', webpage, 'quality formats')
+
+ formats = [{
+ 'url': fmt[1],
+ 'format_id': fmt[0],
+ 'height': int(fmt[0][:-1]),
+ } for fmt in re.findall(r"'([^']+)'\s*:\s*'([^']+)'", quality_arr)]
+
+ self._sort_formats(formats)
title = self._html_search_regex(
r'<title>([^<]+)\s*-\s*beeg\.?</title>', webpage, 'title')
@@ -48,10 +56,10 @@ class BeegIE(InfoExtractor):
return {
'id': video_id,
- 'url': video_url,
'title': title,
'description': description,
'thumbnail': thumbnail,
'categories': categories,
+ 'formats': formats,
'age_limit': 18,
}