]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[ccc:playlist] Add extractor
authorTobias Kunze <rixx@cutebit.de>
Fri, 27 Oct 2017 11:22:13 +0000 (13:22 +0200)
committerSergey M․ <dstftw@gmail.com>
Sun, 28 Apr 2019 16:07:01 +0000 (23:07 +0700)
youtube_dl/extractor/ccc.py
youtube_dl/extractor/extractors.py

index 73470214412b542adad72f1227e66fd341742e82..a4fdf74e8f220d696d45e2c58721b4d9f11e7546 100644 (file)
@@ -75,3 +75,27 @@ class CCCIE(InfoExtractor):
             'tags': event_data.get('tags'),
             'formats': formats,
         }
+
+
+class CCCPlaylistIE(InfoExtractor):
+    IE_NAME = 'media.ccc.de:lists'
+    _VALID_URL = r'https?://(?:www\.)?media\.ccc\.de/c/(?P<id>[^/?#&]+)'
+    _TESTS = [{
+        'url': 'https://media.ccc.de/c/30c3',
+        'info_dict': {
+            'title': '30C3',
+            'id': '30c3',
+        },
+        'playlist_count': 135,
+    }]
+
+    def _real_extract(self, url):
+        acronym = self._match_id(url).lower()
+
+        conf = self._download_json('https://media.ccc.de/public/conferences/' + acronym, acronym)
+
+        return self.playlist_result(
+            [self.url_result(event['frontend_link']) for event in conf['events']],
+            acronym,
+            conf['title'],
+        )
index 26a30b4c39fc81f6c39314af32626905fa36f526..c011cf9814f884dc9347c1e558176af74828cc40 100644 (file)
@@ -177,7 +177,10 @@ from .cbsnews import (
     CBSNewsLiveVideoIE,
 )
 from .cbssports import CBSSportsIE
-from .ccc import CCCIE
+from .ccc import (
+    CCCIE,
+    CCCPlaylistIE,
+)
 from .ccma import CCMAIE
 from .cctv import CCTVIE
 from .cda import CDAIE