libo26 / feedparser

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

media:title ignored or used for main item title #257

Open GoogleCodeExporter opened 9 years ago

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

To reproduce, download the attached file and run:

python -m feedparser file:///Path/to/media_title_error.xml

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

For example, the attached file has a media:content element, with a media:title 
element inside. This produces this list of entries:

[{
    'media_content': [{'medium': u'image',
                       'url': u'http://example.com/image.jpg'}],
    'title': u'MAIN TITLE',
    'title_detail': {'base': u'file://Path/to/media_title_error.xml',
           'language': None,
           'type': 'text/plain',
           'value': u'MAIN TITLE'}}],

I would expect the title of the media_content element to appear:

[{'media_content': [{'medium': u'image',
                             'url': u'http://example.com/image.jpg'
                             'title': u'MEDIA TITLE'}],
    'title': u'MAIN TITLE',
    'title_detail': {'base': u'file://Path/to/media_title_error.xml',
                               'language': None,
                               'type': 'text/plain',
                               'value': u'MAIN TITLE'}}],

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

I'm using feedparser-5.0.1 on Python 2.6.1 on Mac OS X 10.6.6. I also tried SVN 
HEAD with the same result.

** Please provide any additional information below.

If the parent feed item doesn't have a title element, the media:title content 
appears as the item's title instead. This suggests that this bug is related to 
issue #76:

http://code.google.com/p/feedparser/issues/detail?id=76

Original issue reported on code.google.com by jesse.ru...@gmail.com on 3 Mar 2011 at 7:14

Attachments:

GoogleCodeExporter commented 9 years ago
This appears to be happening in part because media:content doesn't set a flag 
to indicate that the element has been opened and subsequently closed; it's 
treated as an element that can have no subelements. As a result, there's no way 
to know that media:title should be applied to media:content.

This shouldn't take a lot of effort to fix, but it is indicative of a wider 
issue with media rss support, and I hope to tackle these issues in the coming 
weeks.

Original comment by kurtmckee on 4 Mar 2011 at 5:55

GoogleCodeExporter commented 9 years ago
Issue 263 has been merged into this issue.

Original comment by kurtmckee on 14 Mar 2011 at 3:34

GoogleCodeExporter commented 9 years ago

Original comment by kurtmckee on 28 May 2012 at 3:16

GoogleCodeExporter commented 9 years ago
Issue 423 has been merged into this issue.

Original comment by kurtmckee on 10 Jul 2014 at 2:12