- return contents
-
- def _extract_content_rss(self, rss):
- '''
- Extracts links to entry items right out of RSS feed.
- This approach is faster than extracting from web pages
- one by one, but suffers from some problems.
- Pros:
- - no need to download additional pages
- - provides more media links
- - accurate file size
- Cons:
- - fewer meta data provided
- - links to media files have no appropriate data that may be used as format_id
- - RSS does not contain links to presentation materials (slides, zip)
- '''
- entries = []
- for item in rss.findall('./channel/item'):
- url = item.find('./link').text
- video_id = url.split('/')[-1]
- formats = self._formats_from_rss_item(item)
-
- if len(formats) == 0:
- self._downloader.report_warning(u'The recording for session %s is not yet available' % video_id)
- continue
-
- title = item.find('./title').text
- description = item.find('./description').text
-
- thumbnail = item.find('./{http://search.yahoo.com/mrss/}thumbnail').text
-
- duration_e = item.find('./{http://www.itunes.com/dtds/podcast-1.0.dtd}duration')
- duration = duration_e.text if duration_e is not None else 0
-
- speakers_e = item.find('./{http://purl.org/dc/elements/1.1/}creator')
- speakers = speakers_e.text.split(', ') if speakers_e is not None and speakers_e.text else []
-
- entries.append({'_type': 'video',
- 'id': video_id,
- 'formats': formats,
- 'title': title,
- 'description': description,
- 'thumbnail': thumbnail,
- 'duration': duration,
- 'session_speakers': speakers,
- })
- return entries