1 from .common
import InfoExtractor
10 class CCCIE(InfoExtractor
):
11 IE_NAME
= 'media.ccc.de'
12 _VALID_URL
= r
'https?://(?:www\.)?media\.ccc\.de/v/(?P<id>[^/?#&]+)'
15 'url': 'https://media.ccc.de/v/30C3_-_5443_-_en_-_saal_g_-_201312281830_-_introduction_to_processor_design_-_byterazor#video',
16 'md5': '3a1eda8f3a29515d27f5adb967d7e740',
20 'title': 'Introduction to Processor Design',
21 'creator': 'byterazor',
22 'description': 'md5:df55f6d073d4ceae55aae6f2fd98a0ac',
23 'thumbnail': r
're:^https?://.*\.jpg$',
24 'upload_date': '20131228',
25 'timestamp': 1388188800,
30 'url': 'https://media.ccc.de/v/32c3-7368-shopshifting#download',
31 'only_matching': True,
34 def _real_extract(self
, url
):
35 display_id
= self
._match
_id
(url
)
36 webpage
= self
._download
_webpage
(url
, display_id
)
37 event_id
= self
._search
_regex
(r
"data-id='(\d+)'", webpage
, 'event id')
38 event_data
= self
._download
_json
(f
'https://media.ccc.de/public/events/{event_id}', event_id
)
41 for recording
in event_data
.get('recordings', []):
42 recording_url
= recording
.get('recording_url')
45 language
= recording
.get('language')
46 folder
= recording
.get('folder')
52 format_id
+= '-' + folder
55 vcodec
= 'h264' if 'h264' in folder
else (
56 'none' if folder
in ('mp3', 'opus') else None
59 'format_id': format_id
,
61 'width': int_or_none(recording
.get('width')),
62 'height': int_or_none(recording
.get('height')),
63 'filesize': int_or_none(recording
.get('size'), invscale
=1024 * 1024),
70 'display_id': display_id
,
71 'title': event_data
['title'],
72 'creator': try_get(event_data
, lambda x
: ', '.join(x
['persons'])),
73 'description': event_data
.get('description'),
74 'thumbnail': event_data
.get('thumb_url'),
75 'timestamp': parse_iso8601(event_data
.get('date')),
76 'duration': int_or_none(event_data
.get('length')),
77 'view_count': int_or_none(event_data
.get('view_count')),
78 'tags': event_data
.get('tags'),
83 class CCCPlaylistIE(InfoExtractor
):
84 IE_NAME
= 'media.ccc.de:lists'
85 _VALID_URL
= r
'https?://(?:www\.)?media\.ccc\.de/c/(?P<id>[^/?#&]+)'
87 'url': 'https://media.ccc.de/c/30c3',
92 'playlist_count': 135,
94 'url': 'https://media.ccc.de/c/DS2023',
96 'title': 'Datenspuren 2023',
102 def _real_extract(self
, url
):
103 playlist_id
= self
._match
_id
(url
)
105 conf
= self
._download
_json
(
106 'https://media.ccc.de/public/conferences/' + playlist_id
,
110 for e
in conf
['events']:
111 event_url
= url_or_none(e
.get('frontend_link'))
113 entries
.append(self
.url_result(event_url
, ie
=CCCIE
.ie_key()))
115 return self
.playlist_result(entries
, playlist_id
, conf
.get('title'))