mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +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->setStatus('a');
|
||||
try {
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
$resp = $videos->save(true);
|
||||
|
||||
YouPHPTubePlugin::afterNewVideo($resp);
|
||||
|
||||
YouPHPTubePlugin::saveVideosAddNew($_POST, $resp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue