-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpusha_video.php
More file actions
25 lines (24 loc) · 838 Bytes
/
pusha_video.php
File metadata and controls
25 lines (24 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?
require_once "lib/VideoUploader.php";
require_once "lib/HttpClient.php";
require_once "lib/CurlFileUploader.php";
$config = yaml_parse(file_get_contents("config.yml"));
$d = dir($config["video_path"]);
while (false !== ($entry = $d->read())) {
if ($entry == ".." || $entry == ".") continue;
if (is_file($config['video_path']."/".$entry)) continue;
$category_id = $entry;
$video_uploader = new VideoUploader();
$dv = dir($config['video_path']."/".$entry);
$cd = $config['video_path']."/".$entry;
$flvs = glob("{{$cd}/*.*,{$cd}/*/*.*}",GLOB_BRACE);
foreach ($flvs as $video) {
try {
echo "uploading video $video to category $category_id\n";
$video_uploader->upload($video, $category_id);
echo "gooood\n";
} catch (Exception $e) {
echo "failed :( ".$e->getMessage()."\n";
}
}
}