Merge branch 'MDL-28509_master' of git://github.com/marxjohnson/moodle
[moodle.git] / repository / youtube / lib.php
index 415aebd..30a5f07 100644 (file)
@@ -57,7 +57,7 @@ class repository_youtube extends repository {
         foreach ($xml->entry as $entry) {
             $media = $entry->children('http://search.yahoo.com/mrss/');
             $title = $media->group->title;
-            $attrs = $media->group->thumbnail->attributes();
+            $attrs = $media->group->thumbnail[2]->attributes();
             $thumbnail = $attrs['url'];
             $arr = explode('/', $entry->id);
             $id = $arr[count($arr)-1];