common = new Common; $this->count = 25; } public function index ($id, $cat='videos', $page=0) { $res = [ 'page' => 'channel', 'cat' => $cat, 'paginate' => $page, 'pagetotal' => 500, 'userinfo' => $this->common->user, ]; $res['channel'] = $this->getChannel($id); $res['video'] = $this->getVideo($id, ($page*$this->count), $this->count); $res['pagetotal'] = $res['video']->total; 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'); } }