-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathThunderDispatchApp.php
More file actions
31 lines (23 loc) · 1016 Bytes
/
ThunderDispatchApp.php
File metadata and controls
31 lines (23 loc) · 1016 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
26
27
28
29
30
31
<?php
require_once dirname(__FILE__) . '/lib/SynologyFileStationAPI.inc';
require_once dirname(__FILE__) . '/lib/yaml/axial.configuration.inc';
require_once dirname(__FILE__) . '/lib/yaml/axial.configuration.yaml.inc';
require_once dirname(__FILE__) . '/lib/bizObject/TVShowHandler.inc';
$config = new Axial_Configuration_Yaml('conf/ThunderDispatch.yaml', true);
$login_info = array(
"account" => $config->account,
"passwd" => $config->passwd,
"session_name" => $config->session_name,
"cookie_file" => $config->cookie_path,
);
$tv_handler = new TVShowHandler(null, $login_info);
//---------- tv shows --------------
$download_folder = "/download/TVshows";
$tv_handler->dispatchTvShows($download_folder);
//---------- subtitles -------------
$subtitle_path = "/program/subtitleFetcher/data/subtitles";
$tvshow_folders = $tv_handler->listFile($subtitle_path, "dir");
foreach ($tvshow_folders['data']['files'] as $tvshow_info) {
$tv_handler->processSubtitleFiles($tvshow_info['path']);
}
?>