Correzioni importOldData per video youtube

This commit is contained in:
Riccardo Di Dato
2016-03-17 12:13:07 +01:00
parent 261523f539
commit 5a926adf74
+2 -2
View File
@@ -85,14 +85,14 @@ $dati = $statement->fetchALL(PDO::FETCH_CLASS,"stdClass");
if ( preg_match("~^http[s]?[:]//youtu\.be/(.+)$~", trim($ele->img), $matches) ){
$media->link = $matches[1];
}
else if (preg_match("~http[s]?[:]//www\.youtube\.com/embed/([^\"]+)[\"]~", trim($ele->img), $matches)){
else if (preg_match("~http[s]?[:]//www\.youtube\.com/embed/([^\"]++)~", trim($ele->img), $matches)){
$media->link = $matches[1];
}
else if (preg_match("~http[s]?[:]//www\.youtube\.com/watch[?]v[=](.+)$~", trim($ele->img), $matches)){
$media->link = $matches[1];
}
// LEGACY FORMAT http://www.youtube.com/v/c0B1snrcoPk&hl=it_IT&fs=1&
else if (preg_match("~http[:]//www\.youtube\.com/v/(.+)[&]amp[;]hl[=]it_IT[&]amp[;]fs[=]1[&]amp[;]$~", trim($ele->img), $matches)){
else if (preg_match("~http[:]//www\.youtube\.com/v/([^&]++)~", trim($ele->img), $matches)){
$media->link = $matches[1];
}
// $media->link = $ele->img;