Analisando o feed RSS usando PHP para inserir no meu SQL

Posso obter meu script para analisar os itens e inserir no mySQL OK ao usar os itens Channel->. Agora preciso inserir o URL da miniatura que está localizado nos itens, mas em um sub-item “pasta” por falta de saber o que o chama, mas não consegue chegar a ele já que é um em outro nível do item “mídia: thumbnail “o feed rss é: http://feeds.bbci.co.uk/sport/0/audiovideo/rugby-league-av/rss.xml#

libxml_use_internal_errors(true); $RSS_DOC = simpleXML_load_file($feed_url); if (!$RSS_DOC) { echo "Failed loading XML\n"; foreach(libxml_get_errors() as $error) { echo "\t", $error->message; } } /* Get title, link, managing editor, and copyright from the document */ $rss_title = $RSS_DOC->channel->title; $rss_link = $RSS_DOC->channel->link; $rss_description = $RSS_DOC->channel->description; $rss_copyright = $RSS_DOC->channel->guid; $rss_date = $RSS_DOC->channel->pubDate; //Loop through each item in the RSS document foreach($RSS_DOC->channel->item as $RSSitem) { $item_id = md5($RSSitem->title); $fetch_date = date("Ymj G:i:s"); //NOTE: we don't use a DB SQL function so its database independent $item_title = $RSSitem->title; $item_description = $RSSitem->description; $item_date = date("Ymj G:i:s", strtotime($RSSitem->pubDate)); $item_url = $RSSitem->link; $image_url =($RSSitem->media:thumbnails)->url; echo "Processing item '" , $item_id , "' on " , $fetch_date , "
"; echo $item_title, " - "; echo $item_date, "
"; echo $item_description, "
"; echo $item_url, "
"; echo $image_url, "
"; // Does record already exist? Only insert if new item... $item_exists_sql = "SELECT item_id FROM $db_database.`rssingest` where item_id = '" . $item_id . "'"; $item_exists = mysqli_query($db,$item_exists_sql); if(mysqli_num_rows($item_exists)<1) { echo "Inserting new item..
"; $item_insert_sql = "INSERT INTO $db_database.`rssingest`(item_id, feed_url, item_title, item_date, item_url, fetch_date,image_url) VALUES ('" . $item_id . "', '" . $feed_url . "', '" . $item_title . "', '" . $item_date . "', '" . $item_url . "', '" . $fetch_date . "', '" . $image_url . "')"; $insert_item = mysqli_query($db,$item_insert_sql); } else { echo "Not inserting existing item..
"; } echo "
"; }