libo26 / feedparser

Automatically exported from code.google.com/p/feedparser
Other
0 stars 0 forks source link

media:content attributes are lost #216

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

    import feedparser
    feed = feedparser.parse('http://backend.deviantart.com/rss.xml?q=special%3Apopular&type=deviation&offset=0') # deviantART RSS
    item = feed['items'][0]
    print repr(item.media_content) # u''
    print repr(item.media_thumbnail) # u''

What is the expected output? What do you see instead?

There should be some way to access the url attribute of media:content, and the 
width/height of media:thumbnail would also be helpful. Instead, we get 
zero-length unicode strings, which apparently represent the contained text of 
the element (i.e., there is none).

What version of the product are you using? On what operating system?

Please provide any additional information below.

feedparser.__version__ is '4.1'; it is ubuntu 10.04's 4.1-14 package.

Original issue reported on code.google.com by chad+goog@sapphirepaw.org on 12 Jun 2010 at 7:08

GoogleCodeExporter commented 9 years ago
This is what I get:
>>> import feedparser
>>> feed = 
feedparser.parse('http://backend.deviantart.com/rss.xml?q=special%3Apopular&type
=deviation&offset=0') # deviantART RSS
>>> item = feed['items'][0]
>>> print repr(item.media_content) # u''
[{'url': 
u'http://fc01.deviantart.net/fs70/f/2010/170/b/e/The_Wanderer_Sketch_6_by_GENZOM
AN.jpg', 'width': u'1391', 'medium': u'image', 'height': u'900'}, {'url': 
u'http://www.deviantart.com/download/168246360/', 'medium': u'document'}]
>>> print repr(item.media_thumbnail) # u''
[{'url': 
u'http://th01.deviantart.net/fs70/300W/f/2010/170/b/e/The_Wanderer_Sketch_6_by_G
ENZOMAN.jpg', 'width': u'300', 'height': u'194'}, {'url': 
u'http://th01.deviantart.net/fs70/150/f/2010/170/b/e/The_Wanderer_Sketch_6_by_GE
NZOMAN.jpg', 'width': u'150', 'height': u'97'}]

The problems have been fixed in the current HEAD of Feedparser which you can 
check out from the repository.

Original comment by a...@google.com on 20 Jun 2010 at 4:20

GoogleCodeExporter commented 9 years ago

Original comment by adewale on 20 Jun 2010 at 4:20