Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

videos is undefined #31

Open
mMoovs opened this issue Aug 28, 2014 · 4 comments
Open

videos is undefined #31

mMoovs opened this issue Aug 28, 2014 · 4 comments

Comments

@mMoovs
Copy link

mMoovs commented Aug 28, 2014

I noticed today, that this plugin wasn't working on a page it worked yesterday. And it gives the "videos is undefined" error.

Further digging revealed that this is using the Youtube Api v2 which is deprecated and they've already taken down some of the functions (?). So this would need an update to work with Youtube api v3. Is this plugin even maintained anymore?

I tried some quick fix: from row 107 to 123 there's the endpoints function which gets the data and I replaced some of the urls to match the api v3 getters to get playlistdata but I didn't get it to work.

Changes I tried, the originals are commented out
Row 108:

//base: 'http://gdata.youtube.com/',
base: 'https://developers.google.com/apis-explorer/#p/youtube/v3/',

Row 119:

//return utils.endpoints.base+'feeds/api/playlists/'+(settings.playlist)+'?v=2&alt=json&format=5&max-results=50';
return utils.endpoints.base+'youtube.playlistItems.list?part=snippet,contentDetails,status&playlistId='+(settings.playlist)+'&key=AIzaSyCzdE3rTJNED_zQmGnHDGxnIg3A4AR6Km4';

Any ideas for this?

@mylittletools
Copy link

I had the same issue. It appears that the format parameter is not supported anymore by google API.
Just change the endpoints from lines 108-120 by removing the &format=5 part.

 endpoints: {
    base: 'http://gdata.youtube.com/',
    userInfo: function(){
        return utils.endpoints.base+'feeds/api/users/'+settings.user+'?v=2&alt=json';
    },
    userVids: function(){
        return utils.endpoints.base+'feeds/api/users/'+settings.user+'/uploads/?v=2&alt=json&max-results=50';
    },
    userPlaylists: function(){
        return utils.endpoints.base+'feeds/api/users/'+settings.user+'/playlists/?v=2&alt=json&max-results=50';
    },
    playlistVids: function(){
        return utils.endpoints.base+'feeds/api/playlists/'+(settings.playlist)+'?v=2&alt=json&max-results=50';
    }
 },

Hope this helps!

@charlisteron
Copy link

Hi!! I try to replace endpoints from lines 108-120, but dosnt works

some help!!! please!

@mMoovs
Copy link
Author

mMoovs commented Aug 29, 2014

Thanks @mylittletools , that worked, for now!

But I'd still like to know if there's going to be a update to using the Youtube Api from v2 to v3. According to this http://apiblog.youtube.com/2014/03/committing-to-youtube-data-api-v3.html the v2 is in use until April 20, 2015 and after that who knows what they're going to do to it.

"To focus on improving v3, it’s time to say goodbye to our old friend, v2. In keeping with deprecation policy, most API functionality will remain available for use until April 20, 2015, so you have more than a year to move to the new API. See the deprecation policy in the Terms of Service for more details."

@charlisteron
Copy link

Yes! Its works fine!

thanks guys!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants