Hi
I enter the details
$servername = "xxx.xxx.xxx.xxx"; <<<< Main Server IP Address (Server with Xtream UI setup on)
$username = "root";
$password = "PASWORD REMOVED"; <<<< SQL Password (Not the SQL Password X UI issued after setup)
$dbname = "xtream_iptvpro";
$port = 7999; <<<<< Does this need changing?
$ano =2019; <<<<< Catagory name
= **; <<<<<< Server ID with the films
.
.
.
$dir = "/home/FILMS/2019/avi"; <<< Folder on '$loco' server where the files are stored
And uploaded the file 'vodupload.php' to the dir '/var/www/html' on the server with all the film files on (same server as $loco) and I keep getting this error message:
connect_error) { die("Connection failed: " . $conn->connect_error); } $dir = "/home/FILMS/U-Z/avi/"; if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($titulocompleto = readdir($dh)) !== false) { // echo "Titulo Completo: $titulocompleto \n"; list($titulo) = explode('.elimino', $titulocompleto); $titulo = preg_replace('/\./', ' ', $titulo); $sql = "INSERT INTO `streams` (`type`, `category_id`, `stream_display_name`, `stream_source`, `stream_icon`, `notes`, `created_channel_location`, `pid_channel_combine`, `enable_transcode`, `transcode_attributes`, `custom_ffmpeg`, `movie_propeties`, `movie_subtitles`, `read_native`, `target_container_id`, `target_container`, `stream_all`, `remove_subtitles`, `custom_sid`, `epg_id`, `channel_id`, `epg_lang`, `order`, `auto_restart`, `transcode_profile_id`, `pids_create_channel`, `cchannel_rsources`, `gen_timestamps`, `added`, `series_no`, `direct_source`, `tv_archive_duration`, `tv_archive_server_id`, `tv_archive_pid`, `movie_symlink`, `redirect_stream`, `rtmp_output`, `number`, `allow_record`, `probesize_ondemand`, `custom_map`, `external_push`, `delay_minutes`, `create_channel_queue`, `gen_pts`) VALUES (2, NULL, '$titulo', '[\"s:$loco:\\/home\\/vod\\/vod$ano\\/$titulocompleto\"]', '', '', NULL, NULL, 0, '[]', '', '{\"movie_image\":\"\",\"backdrop_path\":[],\"youtube_trailer\":\"\",\"genre\":\"\",\"plot\":\"\",\"cast\":\"\",\"rating\":\"\",\"director\":\"\",\"releasedate\":\"\",\"tmdb_id\":\"\",\"duration_secs\":2593,\"duration\":\"02:45:00\",\"video\":{\"index\":0,\"codec_name\":\"h264\",\"codec_long_name\":\"H.264 \\/ AVC \\/ MPEG-4 AVC \\/ MPEG-4 part 10\",\"profile\":\"High\",\"codec_type\":\"video\",\"codec_time_base\":\"1\\/48\",\"codec_tag_string\":\"avc1\",\"codec_tag\":\"0x31637661\",\"width\":960,\"height\":528,\"coded_width\":960,\"coded_height\":528,\"has_b_frames\":1,\"sample_aspect_ratio\":\"1:1\",\"display_aspect_ratio\":\"20:11\",\"pix_fmt\":\"yuv420p\",\"level\":31,\"color_range\":\"tv\",\"color_space\":\"bt709\",\"color_transfer\":\"bt709\",\"color_primaries\":\"bt709\",\"chroma_location\":\"left\",\"refs\":1,\"is_avc\":\"true\",\"nal_length_size\":\"4\",\"r_frame_rate\":\"24\\/1\",\"avg_frame_rate\":\"24\\/1\",\"time_base\":\"1\\/90000\",\"start_pts\":0,\"start_time\":\"0.000000\",\"duration_ts\":233370000,\"duration\":\"2593.000000\",\"bit_rate\":\"1851870\",\"bits_per_raw_sample\":\"8\",\"nb_frames\":\"62232\",\"disposition\":{\"default\":1,\"dub\":0,\"original\":0,\"comment\":0,\"lyrics\":0,\"karaoke\":0,\"forced\":0,\"hearing_impaired\":0,\"visual_impaired\":0,\"clean_effects\":0,\"attached_pic\":0,\"timed_thumbnails\":0},\"tags\":{\"creation_time\":\"2016-09-15T00:37:19.000000Z\",\"language\":\"und\",\"handler_name\":\"VideoHandler\"}},\"audio\":{\"index\":2,\"codec_name\":\"ac3\",\"codec_long_name\":\"ATSC A\\/52A (AC-3)\",\"codec_type\":\"audio\",\"codec_time_base\":\"1\\/48000\",\"codec_tag_string\":\"ac-3\",\"codec_tag\":\"0x332d6361\",\"sample_fmt\":\"fltp\",\"sample_rate\":\"48000\",\"channels\":2,\"channel_layout\":\"stereo\",\"bits_per_sample\":0,\"dmix_mode\":\"-1\",\"ltrt_cmixlev\":\"-1.000000\",\"ltrt_surmixlev\":\"-1.000000\",\"loro_cmixlev\":\"-1.000000\",\"loro_surmixlev\":\"-1.000000\",\"r_frame_rate\":\"0\\/0\",\"avg_frame_rate\":\"0\\/0\",\"time_base\":\"1\\/48000\",\"start_pts\":0,\"start_time\":\"0.000000\",\"duration_ts\":124469760,\"duration\":\"2593.120000\",\"bit_rate\":\"224000\",\"nb_frames\":\"81035\",\"disposition\":{\"default\":0,\"dub\":0,\"original\":0,\"comment\":0,\"lyrics\":0,\"karaoke\":0,\"forced\":0,\"hearing_impaired\":0,\"visual_impaired\":0,\"clean_effects\":0,\"attached_pic\":0,\"timed_thumbnails\":0},\"tags\":{\"creation_time\":\"2016-09-15T00:37:19.000000Z\",\"language\":\"und\",\"handler_name\":\"Stereo\"},\"side_data_list\":[{\"side_data_type\":\"Audio Service Type\"}]},\"bitrate\":2242}', '[]', 0, NULL, '[\"mp4\"]', 0, 0, '', NULL, NULL, NULL, 0, '', 0, '', '', 1, 1554344364, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 128000, '', '', 0, '', 1)"; if ($conn->query($sql) === TRUE) { echo "Record updated successfully \n"; } else { echo "Error updating record: " . $conn->error; } $sql = "SELECT * FROM streams WHERE stream_display_name = '{$titulo}'"; $resultado = $conn->query($sql); if ($resultado = $resultado->fetch_array(MYSQLI_ASSOC)) { $stream_id = $resultado['id']; } else { echo "Error updating record: " . $conn->error; } $sql = "INSERT INTO `streams_sys` (`stream_id`, `server_id`, `parent_id`, `pid`, `to_analyze`, `stream_status`, `stream_started`, `stream_info`, `analyze_start`, `analyze_pid`, `monitor_pid`, `current_source`, `crashed_analyze`, `integrity`, `bitrate`, `progress_info`, `on_demand`, `delay_pid`, `delay_available_at`) VALUES ($stream_id, $loco, NULL, 2452, 0, 0, 1554344839, '{\"codecs\":{\"video\":{\"index\":0,\"codec_name\":\"h264\",\"codec_long_name\":\"H.264 \\/ AVC \\/ MPEG-4 AVC \\/ MPEG-4 part 10\",\"profile\":\"High\",\"codec_type\":\"video\",\"codec_time_base\":\"1\\/48\",\"codec_tag_string\":\"avc1\",\"codec_tag\":\"0x31637661\",\"width\":960,\"height\":528,\"coded_width\":960,\"coded_height\":528,\"has_b_frames\":1,\"sample_aspect_ratio\":\"1:1\",\"display_aspect_ratio\":\"20:11\",\"pix_fmt\":\"yuv420p\",\"level\":31,\"color_range\":\"tv\",\"color_space\":\"bt709\",\"color_transfer\":\"bt709\",\"color_primaries\":\"bt709\",\"chroma_location\":\"left\",\"refs\":1,\"is_avc\":\"true\",\"nal_length_size\":\"4\",\"r_frame_rate\":\"24\\/1\",\"avg_frame_rate\":\"24\\/1\",\"time_base\":\"1\\/90000\",\"start_pts\":0,\"start_time\":\"0.000000\",\"duration_ts\":233370000,\"duration\":\"2593.000000\",\"bit_rate\":\"1851870\",\"bits_per_raw_sample\":\"8\",\"nb_frames\":\"62232\",\"disposition\":{\"default\":1,\"dub\":0,\"original\":0,\"comment\":0,\"lyrics\":0,\"karaoke\":0,\"forced\":0,\"hearing_impaired\":0,\"visual_impaired\":0,\"clean_effects\":0,\"attached_pic\":0,\"timed_thumbnails\":0},\"tags\":{\"creation_time\":\"2016-09-15T00:37:19.000000Z\",\"language\":\"und\",\"handler_name\":\"VideoHandler\"}},\"audio\":{\"index\":2,\"codec_name\":\"ac3\",\"codec_long_name\":\"ATSC A\\/52A (AC-3)\",\"codec_type\":\"audio\",\"codec_time_base\":\"1\\/48000\",\"codec_tag_string\":\"ac-3\",\"codec_tag\":\"0x332d6361\",\"sample_fmt\":\"fltp\",\"sample_rate\":\"48000\",\"channels\":2,\"channel_layout\":\"stereo\",\"bits_per_sample\":0,\"dmix_mode\":\"-1\",\"ltrt_cmixlev\":\"-1.000000\",\"ltrt_surmixlev\":\"-1.000000\",\"loro_cmixlev\":\"-1.000000\",\"loro_surmixlev\":\"-1.000000\",\"r_frame_rate\":\"0\\/0\",\"avg_frame_rate\":\"0\\/0\",\"time_base\":\"1\\/48000\",\"start_pts\":0,\"start_time\":\"0.000000\",\"duration_ts\":124469760,\"duration\":\"2593.120000\",\"bit_rate\":\"224000\",\"nb_frames\":\"81035\",\"disposition\":{\"default\":0,\"dub\":0,\"original\":0,\"comment\":0,\"lyrics\":0,\"karaoke\":0,\"forced\":0,\"hearing_impaired\":0,\"visual_impaired\":0,\"clean_effects\":0,\"attached_pic\":0,\"timed_thumbnails\":0},\"tags\":{\"creation_time\":\"2016-09-15T00:37:19.000000Z\",\"language\":\"und\",\"handler_name\":\"Stereo\"},\"side_data_list\":[{\"side_data_type\":\"Audio Service Type\"}]}},\"container\":\"mov,mp4,m4a,3gp,3g2,mj2\",\"filename\":\"\\/home\\/xtreamcodes\\/iptv_xtream_codes\\/movies\\/11002.mp4\",\"bitrate\":\"2241938\",\"of_duration\":\"2593.120000\",\"duration\":\"02:45:00\"}', NULL, NULL, NULL, NULL, 0, NULL, 2242, '', 0, NULL, NULL)"; if ($conn->query($sql) === TRUE) { echo "Record updated successfully \n"; } else { echo "Error updating record: " . $conn->error; } } } } $conn->close(); closedir($dh); ?>
So what am I doing wrong? lol