Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

http://video.google.com/?output=rss #58

Closed
peters55 opened this Issue · 10 comments

4 participants

@peters55

If you use simplepie to open http://video.google.com/?output=rss
thumbnails for videos that are not from youtube.com are not showing. For example at:

http://simplepie.org/demo/?feed=http%3A%2F%2Fvideo.google.com%2F%3Foutput%3Drss

the first 6 entries are videos from youtube.com, and the rest are videos from dailymotion.com and video.google.com. For dailymotion.com and video.google.com entries thumbnails are not showing. The image location url for the thumbnail is wrong:

src="http://0.gvt0.com/ThumbnailServer2?app=vss&content"

it should be:

src="http://0.gvt0.com/ThumbnailServer2?app=vss&contentid=8a9a96f0f77efda8&offsetms=145000&itag=w160&sigh=jBymPA0NVNGGPSU33G13_nqlnbo"

@rmccue
Owner

Is this specific to this feed only?

@peters55

I haven't tested other feeds for this particular bug. But this might happen with other feeds, if they have image urls containing "id=" (or "id"). I'm not sure what is the reason for this bug. Do you have any suggestions how to fix this, or what might cause this? We might be able to help fixing this or provide feedback, if you can point possible reasons for this bug.

@rmccue
Owner

I'm trying to get it down to a specific test case. At a guess, it's something weird with the XML parser.

@peters55

I cannot locate the reason for this bug.

@upekshapriya

The problem appears to be in the lines 13541ff of v1.1.3

            if ($this->strip_attributes)
            {
                foreach ($this->strip_attributes as $attrib)
                {
                    $data = preg_replace('/(<[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*)' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . trim($attrib) . '(?:\s*=\s*(?:"(?:[^"]*)"|\'(?:[^\']*)\'|(?:[^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>/', '\1\2\3>', $data);
                }
            }

because if I remove this section the problem disappears

@rmccue
Owner

Version 1.1.3 is no longer supported. Can you reproduce this with 1.2 or 1.3-dev?

@upekshapriya

Using the following simplepietest.php

<?php
require '/home/myaccount/wp-content/plugins/simplepie-core/simplepie.inc';

$url = 'http://video.google.com/videosearch?q=news&hl=en&qscrl=1&output=rss';
$stupidly_fast = false;
$max = 0;
$feed = new SimplePie();
$feed->force_feed(true);
$feed->enable_order_by_date(false); // thanks Julian Popov
$feed->set_feed_url($url);
$feed->set_item_limit($max);
$feed->set_stupidly_fast($stupidly_fast);
$feed->enable_cache(false); 
$feed->set_useragent('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)');
$feed->init();
$feed->handle_content_type(); 

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>SimplePie Test</title>
</head>

<body>
            <h1>SimplePie Test</h1>
            <ul>
            <?php
                $channel = $feed->get_feed_tags('', 'channel');
                // loop through items
                foreach ($feed->get_items() as $item):
            ?>
                <li><a href="<?php echo $item->get_link(); ?>"><?php echo $item->get_title(); ?></a>&nbsp;|&nbsp;<?php echo $item->get_date('j F Y'); ?><br /><?php echo $item->get_description(); ?></li>
            <?php endforeach; ?>
            </ul>
</body>
</html>

if I try this with 1.2-dev and 1.3-dev all I get is the title printed 'SimplePie Test' with the Google Search rss http://video.google.com/videosearch?q=news&hl=en&qscrl=1&output=rss as above.

SimplePie gives the error This XML document is invalid, likely due to invalid characters. XML error: XML_ERR_NAME_REQUIRED at line 1, column 2

This feed was no problem in 1.1.3.

So I can't test the original problem.

If I use another feed eg http://vimeo.com/channels/staffpicks/videos/rss then it works fine.

@rmccue
Owner

Can anyone confirm this bug still exists in 1.2.1-dev?

@CarlosJa

I downloaded 1.2.1 and the problem still exist. I'm using an older version of SimplePie 1.0 and it works fine on that example. I'm also bumping into another bug not sure if it falls into the same category

if you try to get this feed it'll shoot back an error. The old version worked fine.

http://www.npr.org/rss/podcast.php?id=5194672

@rmccue
Owner

Just checked on 1.2.1-dev that I have locally. What does SimplePie_Misc::debug($sp) give? (Where $sp is your instance of SimplePie)

@rmccue rmccue closed this issue from a commit
@rmccue rmccue Update IRI percent-normalisation code.
Fixes a few tests, see https://gist.github.com/1187856 for before/after

Backport of 4e022de for one-dot-two. Fixes #108, fixes #112, maybe fixes #58.
76b5fd6
@rmccue rmccue closed this in 76b5fd6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.