Skip to content

Commit

Permalink
Bulk embed youtube videos
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel authored and daniel committed Jul 13, 2019
1 parent 697463a commit fa75561
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion plugin/BulkEmbed/save.json.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,19 @@ function ISO8601ToDuration($ISO8601){
$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);
Expand Down

0 comments on commit fa75561

Please sign in to comment.