]> jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/nerdcubed.py
[ie/motherless] Support uploader playlists (#8994)
[yt-dlp.git] / yt_dlp / extractor / nerdcubed.py
1 import datetime
2
3 from .common import InfoExtractor
4
5
6 class NerdCubedFeedIE(InfoExtractor):
7 _VALID_URL = r'https?://(?:www\.)?nerdcubed\.co\.uk/feed\.json'
8 _TEST = {
9 'url': 'http://www.nerdcubed.co.uk/feed.json',
10 'info_dict': {
11 'id': 'nerdcubed-feed',
12 'title': 'nerdcubed.co.uk feed',
13 },
14 'playlist_mincount': 1300,
15 }
16
17 def _real_extract(self, url):
18 feed = self._download_json(url, url, 'Downloading NerdCubed JSON feed')
19
20 entries = [{
21 '_type': 'url',
22 'title': feed_entry['title'],
23 'uploader': feed_entry['source']['name'] if feed_entry['source'] else None,
24 'upload_date': datetime.datetime.strptime(feed_entry['date'], '%Y-%m-%d').strftime('%Y%m%d'),
25 'url': 'http://www.youtube.com/watch?v=' + feed_entry['youtube_id'],
26 } for feed_entry in feed]
27
28 return {
29 '_type': 'playlist',
30 'title': 'nerdcubed.co.uk feed',
31 'id': 'nerdcubed-feed',
32 'entries': entries,
33 }