diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index a24979d4..29e6a632 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -11296,17 +11296,16 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() } function getShortenURL_get(){ - $id = $this->get('id'); - $fk_lender_id = $this->get('lender_id'); + $url = $this->get('url'); $this->load->helper('video_grabber_helper'); - $result_data = (new video_grabber_helper)->shortenVideoURL($id,$fk_lender_id); + // $url="https://venbainfotech.com/VenbaIT/"; + $result_data = "127.0.0.1:5000/sh_url?url=".$url; $result_data = json_decode($result_data,true); - //print_r($result_data);die(); if(!empty($result_data) && $result_data['datastatus'] == 200) { $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; - $data['shorten_url'] = $result_data->data; + $data['shorten_url'] = $result_data['data']; } else { diff --git a/api/application/helpers/video_grabber_helper.php b/api/application/helpers/video_grabber_helper.php index 78232734..55017888 100644 --- a/api/application/helpers/video_grabber_helper.php +++ b/api/application/helpers/video_grabber_helper.php @@ -33,10 +33,10 @@ class video_grabber_helper $video_name = $value['composition_id'].'.mp4'; if($value['is_uploaded']){$video_name = $value['composition_id'];} $file_name = $video_name; - $get_url = "127.0.0.1:5000?sh_url?url=".$video_name; - if($get_url['datastatus'] == 200 ){ - $shorten_url = $get_url['data']; - }else{ $shorten_url = ''; } + // $get_url = "127.0.0.1:5000?sh_url?url=".$video_name; + // if($get_url['datastatus'] == 200 ){ + // $shorten_url = $get_url['data']; + // }else{ $shorten_url = ''; } // $date_of_creation = date('Ymd'); // $shorten_url = custom_encryption::encode( 'vdo/'.$date_of_creation.'/'.$pdid.'/'.$value['composition_id']); @@ -47,7 +47,7 @@ class video_grabber_helper $final_key = 'pd'.$pd_master_details[0]['pd_id'].'/video/'.$file_name; $singed_uri = $CI->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$final_key,'+7 days'); - $result_data[] = array('video_name' => $video_name,'s3_url' => $singed_uri,'url'=>$shorten_url,'status' => $value['twilo_status'],'room_id' => $value['room_id'],'id' => $value['video_room_info_id']); + $result_data[] = array('video_name' => $video_name,'s3_url' => $singed_uri,'url'=>$singed_uri,'status' => $value['twilo_status'],'room_id' => $value['room_id'],'id' => $value['video_room_info_id']); } else { @@ -70,34 +70,9 @@ class video_grabber_helper $affectedRows = $CI->db->affected_rows(); return (($affectedRows > 0 ) ? "Deleted successfully" : "Fail to Delete"); } - public function shortenVideoURL($id,$fk_lender_id){ - $CI =&get_instance(); - $query = "SELECT * FROM ".VIDEO_ROOM_INFO." where video_room_info_id = $id and isactive = 1"; - $video_info = $CI->db->query($query); - $bucket_name = LENDER_BUCKET_NAME_PREFIX.$fk_lender_id; - if($video_info->num_rows()) - { - $video_info = $video_info->result_array(); - foreach ($video_info as $key => $value) - { - $video_name = $value['composition_id'].'.mp4'; - if($value['is_uploaded']){$video_name = $value['composition_id'];} - $file_name = $video_name; - if($value['s3_copied']) - { - $final_key = 'pd'.$value['fk_pd_id'].'/video/'.$file_name; - $singed_uri = $CI->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$final_key,'+7 days'); - $py_response = "127.0.0.1:5000?sh_url?url=".$singed_uri; - } - else - { - $py_response = ""; - } - - } - } - return $py_response; - } + + + }