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
39a6a3d0e0
commit
2f03468bfa
1 changed files with 2 additions and 5 deletions
|
@ -50,7 +50,6 @@ if (!User::canUpload()) {
|
|||
|
||||
foreach ($_POST['itemsToSave'] as $value) {
|
||||
foreach ($value as $key => $value2) {
|
||||
$value[$key] = preg_replace("/\\\x[^A-Fa-f0-9]{2}/", '', $value2);
|
||||
$value[$key] = xss_esc($value2);
|
||||
}
|
||||
//$info = url_get_contents($config->getEncoderURL() . "getLinkInfo/" . base64_encode($value));
|
||||
|
@ -58,10 +57,10 @@ if (!User::canUpload()) {
|
|||
$filename = uniqid("_YPTuniqid_", true);
|
||||
$videos = new Video();
|
||||
$videos->setFilename($filename);
|
||||
$videos->setTitle($value['title']);
|
||||
$videos->setTitle(preg_replace("/[^A-Za-z0-9 ]/", '', $value['title']));
|
||||
$videos->setDescription(preg_replace("/[^A-Za-z0-9 ]/", '', $value['description']));
|
||||
$videos->setClean_title($value['title']);
|
||||
$videos->setDuration(ISO8601ToDuration($value['duration']));
|
||||
$videos->setDescription($value['description']);
|
||||
file_put_contents($global['systemRootPath'] . "videos/{$filename}.jpg", url_get_contents($value['thumbs']));
|
||||
$videos->setVideoLink($value['link']);
|
||||
$videos->setType('embed');
|
||||
|
@ -71,8 +70,6 @@ if (!User::canUpload()) {
|
|||
$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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue