Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

Commit

Permalink
修改一些小细节
Browse files Browse the repository at this point in the history
  • Loading branch information
FlxSNX committed Dec 18, 2020
1 parent e5c98ed commit 6610777
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions app/controller/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function __init(){

public function index($url,$dirid=false){
$project = teambition::get_project($this->projectId,$this->cookie);
if($project){
if($project && $project['_id']){
if(!$dirid){
$dirid = $project['_rootCollectionId'];
$root = true;
Expand Down Expand Up @@ -42,7 +42,6 @@ public function getDownload($url,$id){
$type = authstr($_GET['type']) ?: 302;
$result = teambition::get_download_url($id,$this->cookie);
if($result){
$result = json_decode($result,true);
if($result['fileType'] == 'mp4' and $_SERVER['HTTP_RANGE'] == NULL){
assign('item',$result);
view('index/_play');
Expand Down
5 changes: 3 additions & 2 deletions extend/teambition.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ public static function get_files($projectId,$dirId,$cookie,$page=1){
public static function get_download_url($parentId,$cookie){
$result = self::get('https://www.teambition.com/api/works/'.$parentId,$cookie);
if($result){
$resultArray = json_decode($result,true);
if($resultArray['downloadUrl']){
$result = json_decode($result,true);
if($result['downloadUrl']){
return $result;
}else{
return false;
Expand All @@ -179,6 +179,7 @@ protected static function get($url,$cookie=false,$post=false,$header=false){
curl_setopt($ch, CURLOPT_POSTFIELDS,$post);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
}
curl_setopt($ch, CURLOPT_TIMEOUT,10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
Expand Down

0 comments on commit 6610777

Please sign in to comment.