aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/ccc.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2019-04-28 23:05:36 +0700
committerSergey M․ <dstftw@gmail.com>2019-04-28 23:08:09 +0700
commitf916abc0ac4d1dc7f3a243d791d0f57fd3848a3c (patch)
tree98f99119192e770e6df66aa49766345c26b8a87f /youtube_dl/extractor/ccc.py
parent24510bdcfab3e450f9e1a1b82cf7fca4183c3333 (diff)
downloadyoutube-dl-f916abc0ac4d1dc7f3a243d791d0f57fd3848a3c.tar.xz
[ccc] Improve extraction (closes #14601, closes #20355)
Diffstat (limited to 'youtube_dl/extractor/ccc.py')
-rw-r--r--youtube_dl/extractor/ccc.py30
1 files changed, 13 insertions, 17 deletions
diff --git a/youtube_dl/extractor/ccc.py b/youtube_dl/extractor/ccc.py
index 5fc473fce..36e6dff72 100644
--- a/youtube_dl/extractor/ccc.py
+++ b/youtube_dl/extractor/ccc.py
@@ -6,6 +6,7 @@ from ..utils import (
int_or_none,
parse_iso8601,
try_get,
+ url_or_none,
)
@@ -30,16 +31,7 @@ class CCCIE(InfoExtractor):
}
}, {
'url': 'https://media.ccc.de/v/32c3-7368-shopshifting#download',
- 'info_dict': {
- 'id': '2835',
- 'ext': 'mp4',
- 'title': 'Shopshifting',
- 'creator': 'Karsten Nohl, Fabian Bräunlein, dexter',
- 'description': 'md5:0fade0535e9dc3076d0cbda4958a18eb',
- 'upload_date': '20151227',
- 'timestamp': 1451249100,
- 'tags': list,
- }
+ 'only_matching': True,
}]
def _real_extract(self, url):
@@ -104,12 +96,16 @@ class CCCPlaylistIE(InfoExtractor):
}]
def _real_extract(self, url):
- acronym = self._match_id(url).lower()
+ playlist_id = self._match_id(url).lower()
+
+ conf = self._download_json(
+ 'https://media.ccc.de/public/conferences/' + playlist_id,
+ playlist_id)
- conf = self._download_json('https://media.ccc.de/public/conferences/' + acronym, acronym)
+ entries = []
+ for e in conf['events']:
+ event_url = url_or_none(e.get('frontend_link'))
+ if event_url:
+ entries.append(self.url_result(event_url, ie=CCCIE.ie_key()))
- return self.playlist_result(
- [self.url_result(event['frontend_link']) for event in conf['events']],
- acronym,
- conf['title'],
- )
+ return self.playlist_result(entries, playlist_id, conf.get('title'))