Closed Jhilik11 closed 1 year ago
i Had same issue, any solution?
Can you please show me your code?
This is my code
and this is the response when i try to upload..
Google_Service_Exception not found
public function store(Request $request) { //
$video = Youtube::upload($request->file('video')->getPathName(), [
'title' => $request->input('title'),
'description' => $request->input('description')
]));
return "Video uploaded successfully. Video ID is ". $video->getVideoId();
}
One more thing I want to ask I am using using https on live server So when I am using https://your_domain/youtube/auth I am getting "Error 400: redirect_uri_mismatch"
@Ali07 @Jhilik11 preferably your controllers please.
@joedawson am i missing something?
Can you paste your controllers here?
class VideoController extends Controller { /**
@return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Http\Response|\Illuminate\View\View */ public function index() { // return view('video'); }
/**
@return \Illuminate\Http\Response */ public function create() { // }
/**
@return string */ public function store(Request $request) { //
$video = Youtube::upload($request->file('video')->getPathName(), [
'title' => $request->input('title'),
'description' => $request->input('description')
]);
return "Video uploaded successfully. Video ID is ". $video->getVideoId();
}
/**
@return \Illuminate\Http\Response */ public function show($id) { // }
/**
@return \Illuminate\Http\Response */ public function edit($id) { //
}
/**
@return \Illuminate\Http\Response */ public function update(Request $request, $id) { // }
/**
@Jhilik11 The full controller please!
Everything from <?php onwards
``<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request; use Youtube;
class VideoController extends Controller { /**
@return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Http\Response|\Illuminate\View\View */ public function index() { // return view('video'); }
/**
@return \Illuminate\Http\Response */ public function create() { // }
/**
@return string */ public function store(Request $request) { //
$video = Youtube::upload($request->file('video')->getPathName(), [
'title' => $request->input('title'),
'description' => $request->input('description')
]);
return "Video uploaded successfully. Video ID is ". $video->getVideoId();
}
/**
@return \Illuminate\Http\Response */ public function show($id) { // }
/**
@return \Illuminate\Http\Response */ public function edit($id) { //
}
/**
@return \Illuminate\Http\Response */ public function update(Request $request, $id) { // }
/**
@Jhilik11 have you also registered the alias in config/app.php
?
'aliases' => [
...
'Youtube' => Dawson\Youtube\Facades\Youtube::class,
],
Yes
Yes
Does running composer dump-autoload
resolve your issue?
I tried still not working
What version of the package are you using?
"dawson/youtube": "^5.0",
I have the same problem with Laravel 8. Worked with Laravel 7
This error happens when executing this line of code: $status = $media->nextChunk($chunk);
This is not related to the package. It works after updating my dependencies:
....
- Updating google/apiclient-services (v0.147 => v0.148): Downloading (100%)
- Updating guzzlehttp/promises (v1.3.1 => 1.4.0): Downloading (100%)
- Updating guzzlehttp/psr7 (1.6.1 => 1.7.0): Downloading (100%)
- Updating laravel/framework (v8.6.0 => v8.7.1): Downloading (100%)
- Updating guzzlehttp/guzzle (7.1.0 => 7.1.1): Downloading (100%)
....
Probably something bogus with the previous version of some guzzle related packages (or guzzlehttp/guzzle itself)
can I see your dependencies? i still get the error.. @topclaudy
@Ali07 I listed the related dependencies in my previous post
@Jhilik11 @Ali07 are either of you still experiencing an issue after updating your packages?
yes
@joedawson i'm good, i think the problem from the API, took sometime to get the data... thank you..
Even after using use Youtube I am getting not found exception