common = new Common; $this->count = 25; } public function index ($id, $cat='videos', $page=0) { $res = []; $res['page'] = 'channel'; $res['cat'] = $cat; $res['paginate'] = $page; $res['channel'] = $this->getChannel($id); $res['video'] = $this->getVideo($id, ($page*$this->count), $this->count); return view('pages.peertube.c', ['res' => $res]); } function getChannel ($id) { return $this->ptapi_get('/api/v1/video-channels/'.$id); } function getVideo ($id, $start, $count) { return $this->ptapi_get('/api/v1/video-channels/'.$id.'/videos?start='.$start.'&count='.$count.'&sort=-publishedAt&skipCount=false&nsfw=both'); } }