mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
Bulk embed youtube videos
This commit is contained in:
parent
697463a1cc
commit
fa7556197f
1 changed files with 12 additions and 1 deletions
|
@ -63,8 +63,19 @@ if (!User::canUpload()) {
|
||||||
$videos->setType('embed');
|
$videos->setType('embed');
|
||||||
|
|
||||||
$videos->setStatus('a');
|
$videos->setStatus('a');
|
||||||
|
try {
|
||||||
$resp = $videos->save(true);
|
$resp = $videos->save(true);
|
||||||
|
} catch (Exception $exc) {
|
||||||
|
try {
|
||||||
|
$videos->setTitle(preg_replace("/[^A-Za-z0-9 ]/", '', $videos->getTitle()));
|
||||||
|
$videos->setDescription(preg_replace("/[^A-Za-z0-9 ]/", '', $videos->getDescription()));
|
||||||
|
$resp = $videos->save(true);
|
||||||
|
} catch (Exception $exc) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
YouPHPTubePlugin::afterNewVideo($resp);
|
YouPHPTubePlugin::afterNewVideo($resp);
|
||||||
|
|
||||||
YouPHPTubePlugin::saveVideosAddNew($_POST, $resp);
|
YouPHPTubePlugin::saveVideosAddNew($_POST, $resp);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue