My personnal website.
alaouy / youtube Goto Github PK
View Code? Open in Web Editor NEW🔥 Laravel PHP Facade/Wrapper for the Youtube Data API
License: MIT License
🔥 Laravel PHP Facade/Wrapper for the Youtube Data API
License: MIT License
Hi ,
Any way to get time duration via your package ? ?
i'm looking about this feature inside the playlist item data
I use an api key generated from google console but it expires every 24 hours, How can i make it valid for ever or for long time ?
Thanks
Hi !
I have a problem with searchChannelVideos, i can not order the results.
Youtube::searchChannelVideos('video', '.....', $limit, 'date');
The method returns false to me.
'date' it's a valid value after the documentation..
https://developers.google.com/youtube/v3/docs/search/list#order
Thank you !
Do i need https to use this library
Can i make requests with oauth token?
This condition is not nesseccary and should be removed. Use case: Get a list of videos for a given channel id.
if (empty($params) || !isset($params['q'])) {
throw new \InvalidArgumentException('at least the Search query must be supplied');
}
I noticed that when I list all video's from a channel, I get a list of objects back:
But when I request a single video, I get far more detailed information for that specific video:
Wouldn't it be better if the listChannelVideo
method would return more information as well, might even return the same object as getVideoInfo
to keep code responsibility?
@alaouy
What is the aim of this repo? I think this package should stop supporting deprecated software and tools. Reasons:
What I suggest is creating two branches. One for PHP 7 and Laravel 5.* and the other branch for current old package which still supports old stuff.
Thoughts?
B
have you subscriptionsListByChannelId method ?
Hello,
I recently updated one of my projects to Laravel 5.4 and came across an error when using your package.
Unresolvable dependency resolving [Parameter #0 [ $key ]] in class Alaouy\Youtube\Youtube
I'm not sure, but I think it may be related to the removal of the share()
(see here) method being removed in 5.4 and being replaced with the singleton()
method.
I would love to submit a PR to fix this but I'm not sure how to test it :D
Hope someone can help :)
Hi.
Many thanks for your time creating the package.
I just have one question: It is possible to protect videos using the Youtube API?
For example, if I need to create an "online school" with free videos and premium videos, is Youtube able to do it?
I have read that it is possible to do with Vimeo PRO, but if it also possible with Youtube, probably I would prefer it.
Thank you.
When running the artisan command to publish the assets, nothing is published. It appears the package installation is not completing according to the documentation.
Hi,
There an upload video function inside this class?
i didn't see this inside the docs.
thanks!
Using Laravel 5, added the Service Provider & config but getting the non-static error. Any ideas?
$youtubeVideoId = Youtube::parseVidFromURL($request->get('social_youtube'));
Youtube::getVideoInfo($youtubeVideoId);
Apart from snippet, I need the status of the channel in the php object also. Is this possible?
Elmar
i do what you said in my project,and own a api from google , but in the controller
<?php
namespace App\Http\Controllers;
use Alaouy\Youtube\Facades\Youtube;
class ConvtestController extends Controller
{
public function api()
{
$video = Youtube::getVideoInfo('rie-hPVJ7Sw');
}
}
method “givevideoinfo” not found in Alaouy\Youtube\Facades\Youtube;
thanks
Im having this problem using the latest version on Laravel 5.3 and osx 10.11.6.
Thanks in advance
I have this:
$courses = Youtube::getPlaylistsByChannelId($channelId);
There is no docs about how to paginate the results as I only see 5 results and nextPageToken value.
Help?
Can i make requests with oauth token?
Hello,
1.2.x does not work in laravel 5.2
Master branch - works.
Maybe you could tag master for next version, with Laravel 5.2 support?
Thank you
Hello,
Is it possible to fetch a channels latest uploads? I'm trying to use listChannelVideos
but it doesn't appear to return the latest videos.
Am I doing something wrong?
Thanks in advance.
I don't really know if this a problem with the package or with laravel
I use the facade in a job that is pushed to a queue. It fails returning an exception
Google API key is Required, please visit https://console.developers.google.com/ in public_html/vendor/alaouy/youtube/src/Youtube.php:43
They the installation and key are correct cause if i don't use a queue everything works fine!
Hi,
Currently it doesn't seem like there's any way to paginate playlists for a channel. The default returned is 5, and there's no easy way of doing it using the library, unless I'm missing something
Thanks
Hello!
Just starting to use this package and I am wondering how can I get the channel's header image from an username account.
I've noticed that you can make a call like this one:
https://www.googleapis.com/youtube/v3/channels?part=brandingSettings&forUsername={USERNAME}&key={YOUR_API_KEY}
But I would like make it using this package methods. Is there any way to do it?
Thanks in advance
i tried to get videos like this :
// Set Default Parameters
$params = array(
'q' => 'Android',
'type' => 'video',
'part' => 'id, snippet',
'maxResults' => 50
);
// Make Intial Call. With second argument to reveal page info such as page tokens.
$search = Youtube::searchAdvanced($params, true);
// check if we have a pageToken
if (isset($search['info']['nextPageToken'])) {
$params['pageToken'] = $search['info']['nextPageToken'];
}
// Make Another Call and Repeat
$search = Youtube::searchAdvanced($params, true);
// add results key with info parameter set
print_r($search['results']);
But i am not getting ['nextPageToken']
it gives error :
ErrorException
Illegal string offset 'nextPageToken'
Youtube::parseVIdFromURL('youtube.com/embed/dQw4w9WgXcQ');
Returns an Exception, while it is a valid URL
The library is giving an error without add this line ->
curl_setopt($tuCurl, CURLOPT_SSL_VERIFYPEER, FALSE);
on vendor\alaouy\youtube\src\Alaouy\Youtube\Youtube.php file
Youtube::parseVidFromURL(); should return false or null if url format is not valid instead of exception. Because if someone is giving invalid url page would just die.
Hi
I just install a fresh version of laravel 5.4.*
after installing the package I try to copy the config file to config dir with
php artisan vendor:publish
but the command doesn't publish the youtube.php file
Hi and sorry to bring this one up again but I get this error on Laravel 5.3
"Non-static method Alaouy\Youtube\Youtube::getVideoInfo() should not be called statically"
I noticed that there was two issues already about the same thing. I double and triple checked that I have added the both lines from read me to config/app.php to providers and aliases array. I have used optimize class loader but still I get the same error. I cant figure out what is the problem
Curl Error : SSL certificate problem: unable to get local issuer certificate
thank for advance
Having this issue with laravel 5.2, how may i solve it
I was wondering if there is some way to use the Youtube Live Streaming api with this package. Its possible ?
"Fatal error: Call to undefined method Alaouy\Youtube\Facades\Youtube::parseVIdFromURL()"
"Fatal error: Call to undefined method Alaouy\Youtube\Facades\Youtube::parseVidFromURL()"
$videoId = Youtube::parseVidFromURL('https://www.youtube.com/watch?v=moSFlvxnbgk');
Hello friends that I would like to have your help I am new to this laravel and I would like you to help me with an example of how to show the data obtained in $playlists within a view.
Thank you.
The package works fine on localhost but on server I am getting the key missing error while trying the API in console with artisan-
dev@server1: php artisan tinker
Psy Shell v0.7.2 (PHP 7.1.7-1+ubuntu16.10.1+deb.sury.org+1 — cli) by Justin Hileman
>>> \Youtube::getVideoInfo('rie-hPVJ7Sw');
Exception with message 'Google API key is Required, please visit https://console.developers.google.com/'
>>>
I have ensured to check that there exists youtube.php file in config folder with a valid API key. Also fetching config('youtube.KEY') in artisan console provides me the valid youtube api key as well. So it cannot be an issue with config cache for sure.
Or is that an Oauth thing?
Since this is an external integration with youtube using an api, would you find interesting adding a check conection status function in the library?
Lets say that we're using a controller to handle this library, we have different API keys for different environments, I would say that a simple check in the tests or object initialization will come in handy as a good practice. I just did the check in my controller but then I thought that adding the function here might be a good idea.
Let me know what you think.
Cheers.
when used in lumen error appears Class 'Illuminate\Foundation\Application' not found
Hi There Sorry i know this ist an issue but rather a general question
I love this Api its super easy to use with laravel, BUT Is there a way to sort the videos?
I looked in the youtubeapi docs with no such luck
this is what im looking to do
$YTvideos = Youtube::searchChannelVideos('{MY Channel}', '{MY KEY}', 40 , ['order' => 'date']);
Hi.
I'm trying to make a part in my website with paginated results.
Youtube::getPlaylistItemsByPlaylistId('xxxxxx')
returns only 50 results but what I want is only 8 results and the ability to change the page.
getPlaylistItemsByPlaylistId($playlistId, $pageToken = false, $maxResults = 50, $part = ['id', 'snippet', 'contentDetails', 'status'])
What is $pageToken ?
Thank you
Hi
tried library with Laravel 5(dev) and not working, getting class not found, is there any way that you could look what is problem???
Thx
Is there a clean way to remove / overwrite the 'part' key in the requests? Use case: I only need the ID of the video, don't need the snippet (and the snippet costs in API quota)
Should be able to resolve dependency from container.
Facade works Great ... But to follow better practice you should not use Facades in Repositories.
Error:
Unresolvable dependency resolving [Parameter #0 [ $key ]] in class Alaouy\Youtube\Youtube
Code:
use Alaouy\Youtube\Youtube;
...
private $model;
private $youtube;
public function __construct(Song $model, Youtube $youtube)
{
$this->model = $model;
$this->youtube = $youtube;
}
...
$video = $this->youtube->getVideoInfo($video_id);
Config:
return [
'key' => env('YOUTUBE_KEY', '')
];
.env
YOUTUBE_KEY=SECRET CODE
As the title states, i used your usage and it does not allow me to use it.
src/Alaouy/Youtube/YoutubeFacades.php
is identical to src/Alaouy/Youtube/Facades/Youtube.php
. In addition, the former is improperly named and namespaced. This results in composer complaining:
Warning: Ambiguous class resolution, "Alaouy\Youtube\Facades\Youtube" was found in both "vendor/alaouy/youtube/src/Alaouy/Youtube/YoutubeFacades.php" and "vendor/alaouy/youtube/src/Alaouy/Youtube/Facades/Youtube.php", the first will be used.
I have no idea what YoutubeFacades.php is/was used for, but it clearly should be removed!
The methods mentioned in README can actually not called statically. But i'm kind of new to laravel, i followed all setup steps, is there another thing to do?
However, i managed to access it like $youtube = App::make('youtube');
When installing from Composer, I'm getting the 1.0 release (which doesn't work for L5), could you add new tags and push? Thanks in advance 👍
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.