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