I've looked through the Python feedparser documentation and done enough Googling, but not finding any example feeds that look like what I'm working with:
http://smrss.neulion.com/u/nhl/mrss/sights-and-sounds/vod.xml
What I'm trying to access is the mp4 URLs in the media:group --> media:content element in each item in the feed.
Here's my code so far:
#! /usr/bin/python
# -*- coding: utf-8 -*-
import feedparser
d = feedparser.parse('http://smrss.neulion.com/u/nhl/mrss/sights-and-sounds/vod.xml')
for index,item in enumerate(d.entries):
if index >= 4:
print item.title
print item.media_content
print item.summary
What prints out to Terminal for item.media_content is:
[{'duration': u'150', 'url': u'http://smrss.neulion.com/spmrss/s/nhl/vod/flv/2015/04/19/811204_20150418_PIT_NYR_WIRELESS_1800_sd.mp4', 'type': u'video_sd.mp4'}]
This is a dictionary inside of a list, yes? What would be the best way to iterate through this dictionary in my for loop so I can extract the value at the 'url' key?