]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/ccc.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
12 class CCCIE(InfoExtractor
):
13 IE_NAME
= 'media.ccc.de'
14 _VALID_URL
= r
'https?://(?:www\.)?media\.ccc\.de/v/(?P<id>[^/?#&]+)'
17 'url': 'https://media.ccc.de/v/30C3_-_5443_-_en_-_saal_g_-_201312281830_-_introduction_to_processor_design_-_byterazor#video',
18 'md5': '3a1eda8f3a29515d27f5adb967d7e740',
22 'title': 'Introduction to Processor Design',
23 'creator': 'byterazor',
24 'description': 'md5:df55f6d073d4ceae55aae6f2fd98a0ac',
25 'thumbnail': r
're:^https?://.*\.jpg$',
26 'upload_date': '20131228',
27 'timestamp': 1388188800,
32 'url': 'https://media.ccc.de/v/32c3-7368-shopshifting#download',
36 'title': 'Shopshifting',
37 'creator': 'Karsten Nohl, Fabian Bräunlein, dexter',
38 'description': 'md5:0fade0535e9dc3076d0cbda4958a18eb',
39 'upload_date': '20151227',
40 'timestamp': 1451249100,
45 def _real_extract(self
, url
):
46 display_id
= self
._match
_id
(url
)
47 webpage
= self
._download
_webpage
(url
, display_id
)
48 event_id
= self
._search
_regex
(r
"data-id='(\d+)'", webpage
, 'event id')
49 event_data
= self
._download
_json
('https://media.ccc.de/public/events/%s' % event_id
, event_id
)
52 for recording
in event_data
.get('recordings', []):
53 recording_url
= recording
.get('recording_url')
56 language
= recording
.get('language')
57 folder
= recording
.get('folder')
63 format_id
+= '-' + folder
66 vcodec
= 'h264' if 'h264' in folder
else (
67 'none' if folder
in ('mp3', 'opus') else None
70 'format_id': format_id
,
72 'width': int_or_none(recording
.get('width')),
73 'height': int_or_none(recording
.get('height')),
74 'filesize': int_or_none(recording
.get('size'), invscale
=1024 * 1024),
78 self
._sort
_formats
(formats
)
82 'display_id': display_id
,
83 'title': event_data
['title'],
84 'creator': try_get(event_data
, lambda x
: ', '.join(x
['persons'])),
85 'description': event_data
.get('description'),
86 'thumbnail': event_data
.get('thumb_url'),
87 'timestamp': parse_iso8601(event_data
.get('date')),
88 'duration': int_or_none(event_data
.get('length')),
89 'tags': event_data
.get('tags'),
94 class CCCPlaylistIE(InfoExtractor
):
95 IE_NAME
= 'media.ccc.de:lists'
96 _VALID_URL
= r
'https?://(?:www\.)?media\.ccc\.de/c/(?P<id>[^/?#&]+)'
98 'url': 'https://media.ccc.de/c/30c3',
103 'playlist_count': 135,
106 def _real_extract(self
, url
):
107 acronym
= self
._match
_id
(url
).lower()
109 conf
= self
._download
_json
('https://media.ccc.de/public/conferences/' + acronym
, acronym
)
111 return self
.playlist_result(
112 [self
.url_result(event
['frontend_link']) for event
in conf
['events']],