zend-framework,youtube-api,google-client-login , Zend And YouTube Not Deleting Videos

Zend And YouTube Not Deleting Videos


Tag: zend-framework,youtube-api,google-client-login

Until yesterday I could delete YouTube videos using Zend framework.

I was using this code:

$httpClient = Zend_Gdata_ClientLogin::getHttpClient(
               $username, $password, 'youtube', 
               null, 'MySite', null, null, 

$yt = new Zend_Gdata_YouTube($httpClient, '', '', $myDevKey);

$vid = $yt->getVideoEntry($myVidID, null, true);                                

Now I am getting this error:

Expected response code 200, got 410 No longer available

It is the $yt->delete($vid); that causes the problem. Perhaps YouTube has changed, but that used to be working. I tried two other dev keys and youtube accounts and still nothing.

The video is in YouTube and the ID is correct.


Zend_Gdata uses ClientLogin which was deprecated as of April 20, 2012 and turned off on May 26 2015. This code will not longer work you need to switch to using Oauth2.

You can use the current Google PHP client library to authenticate then use the access token created there to access it.


I am trying to use GoogleAPI YouTube to get details about YouTube Videos

Using GoogleAPI v3 url using this url: https://www.googleapis.com/youtube/v3/videos?part=snippet&id=D-wxnID2q4A&key={MyKey} I get this json: { "kind": "youtube#videoListResponse", "etag": "\"dhbhlDw5j8dK10GxeV_UG6RSReM/uzqDS1yLcX0DglL60bHeS56kZ7c\"", "pageInfo": { "totalResults": 1, "resultsPerPage": 1 }, "items": [ { "kind": "youtube#video", "etag": "\"dhbhlDw5j8dK10GxeV_UG6RSReM/l7OMkGqgmC10NvbO5PzI_nonZzA\"", "id": "D-wxnID2q4A", "snippet": { "publishedAt": "2014-01-08T05:34:04.000Z", "channelId":...

Using Youtube's Data API

I cannot figure out how to use Youtube's API V3, with Chrome's identity extension API. Is there a tutorial somewhere? I would like to start by rating a video.

Failed installation of zend-escaper with Composer

I'm trying to install zend-escaper but I'm getting this error: This is strange as my PHP version (from phpinfo()) is 5.5.19, the message claims it is 5.3.5(!) which should satisfy the requirement anyway. My ZF version is 1.12.13 I'm using PHP Storm Can anyone help please? Thanks Tomasz...

Pass array on url using zend framework 2 routes

I have a web app that lets user make multiple searches and show the results of that searches all on the same page. Here's a basic structure: Search 1 - Attribute 1 = X - Attribute 3 = Y Search 2 -Attribute 2 = Z All these results are loaded...

Zend paginator with AJAX

I have multiple albums listed on a page, next to each album are listed reviews about the album. Essentially this means there are many reviews about many albums on a single page. What would be the best approach to paginate each review section for each album? For example so each...

zend framework 2 nested module structrue in one main module

I am trying to create a app using zend framework 2. Have used structure as follow. Getting error class not found. Trying to created nested sub module login inside a main module called album. I have following structure: Album - src - Album - Controller - AlbumController.php - Form -...

Zend Framework 2 - Sending form using Zend\Mail

So i'm making a contact page. Of course it will have a form, which needs to be sent. I made the class to send email: <?php namespace Site\Mail; use Zend\Mail\Message; use Zend\Mail\Transport\Sendmail; class SendEMail { public function SendEMail($to, $from, $subject, $body) { $message = new Message(); $message->addTo($to) ->addFrom($from) ->setSubject($subject) ->setBody($body);...

Google Developer API V3 for video upload in YouTube C#.net

I have been using google's reputed API V2 for uploading the videos on YouTube from my web application as there has been up gradation in API to V3 , I am unable to upload the same through the same code. I have tried with the new application for uploading the...

Outputting YouTube API data in AngularJS

I'm trying to retrieve all the playlists from a certain channel, and printing out the name of each playlist in my AngularJS app. var myApp = angular.module('app', ['ngResource']); myApp.factory('videoApi', function ($resource) { return $resource( 'https://www.googleapis.com/youtube/v3/playlists', {callback: 'JSON_CALLBACK'}, { get: { method: 'JSONP', params: { part: 'snippet', channelId: '**removed**', maxResults: 50,...

YouTube API UnicodeEncodeError in Python 3.4

I was exploring the YouTube Data API and finding that improperly encoded results were holding me back. I got good results until I retrieve a set that includes unmapped characters in the titles. My code is NOW (cleaned up a little for you fine folks): import urllib.request import urllib.parse import...

Youtube API v3 - How to get the list of videos on iterative manner

We are planning to show a list of videos from our youtube channel on the website. I have checked the V3 API and it works fine. I followed the solution specified on this question. The problem is how to browse through the list of videos uploaded over the years. The...

how to get first video after ending last video youtube api

I am trying to get first video after completing last video i am using youtube i will play video continues but after last video its ending its not getting first video here the code i am working on <div id="player"></div> <script src="http://www.youtube.com/iframe_api"></script> <script> /** * Put your video IDs in...

Can anyone help me make the search bar work as I now have the JS prompt? [on hold]

I have created a small program that pulls from the YouTube API which allows you to search for a random video for whatever title you enter when prompted. My goal is to have this work like a search engine. I would like to make my search bar the input instead...

Socialengine addon Advanced Events Plugin v4.8.8p2 throwing errror on create

I've got a site set up with the base Socialengine setup going. I've installed most of the SocialEngineAddon suite of plugins, and for some reason, the Advanced Events plugin throws this error when I try and create one ie: example.com/appeals/create I've tried renaming back to the default site-event, but the...

How to get data of a youtube playlist in JSON format using JavaScript API V3

Youtube stopped support to V2 I'm using till now, can anyone tell me how to get data of a youtube playlist in JSON format using JavaScript API V3 V2 URL I used is as given below http://gdata.youtube.com/feeds/api/playlists/{PLAYLIST_ID}?alt=json-in-script&callback=showMyVideos Resolved v3 URL is https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=50&playlistId={PLAYLIST_ID}&key={KEY}...

Get youtube title from videoid in PHP using API v3

Here is the url to to get the video info where you have to put VIDEO-ID and API-KEY: https://www.googleapis.com/youtube/v3/videos?part=snippet&id=VIDEO-ID-HERE&key=YOUR-API-KEY-HERE How to get the title from it and save it as a variable in PHP?...

Bootstrap of Zend Module is not loading

I am new in working with zend so I am facing this problem from the past two days. I have searched a lot but still can not find any solution. Possible duplicate of Zend Module Bootstrap does not load but it still can not solve my problem. In my User...

Wrong datatype for referenced entity on Doctrine ObjectSelect

I have a form which uses Doctrine's ObjectSelect to make a dropdown $this->add(array( 'name' => 'category', 'type' => 'DoctrineModule\Form\Element\ObjectSelect', 'options' => array( 'label' => 'Category', 'object_manager' => $em, 'target_class' => 'Blog\Entity\Category', 'property' => 'name' ), 'attributes' => array( 'required' => true ) )); the issue I have, is that this...

Obtaining youtube user profile using WebService::GData::YouTube fails

I am trying to learn how to use WebService::GData::YouTube by following the tutorial at http://perlmaven.com/fetching-data-from-youtube-using-perl : use strict; use warnings; use WebService::GData::YouTube; my $yt = WebService::GData::YouTube->new(); my $p = $yt->get_user_profile('Gabor Szabo'); print "ok\n"; But this fails with output: WebService::GData::Error=HASH(0x1c45dc8) The exception occurs in $yt->get_user_profile().....

I want to upload video on youtube using client side login. without open web page permission

When I upload video to YouTube using client side login. The first time redirect to UI for permissions. I want upload without redirect to web page. I need to execute this code on server. Here is my code. private async Task<string> Run(string title, string description, string filepath) { var videoID...

YouTube IFrame API doesn't always load?

I've seen lots of similar questions to this, but I believe this is different. When I try to define onYouTubeIframeAPIReady in the global scope, the function only gets called about half the times I load the page (if I keep refreshing, sometimes I'll see the console message, and sometimes it...

Listing large amount of subscriptions of a youtube channel

I am trying to fetch all the subscriptions ids of a youtube channel that has 100k+ subscribers. When fetching the first page of results, youtube returns properly the total amount of subscriptions and the next page token. After a few hundred calls (because you can only fetch 50 results per...

youtube api v3 - get videos from a public playlist. with out using api key

Youtube V2 where this code use to list top 50 videos from the play list var ytURL = "http://gdata.youtube.com/feeds/api/playlists/PLgtnUFn0ROBBPO2nC-bduEDDlxikKwZ6R?v=2&alt=json&callback=?&max-results=50"; var thumbBase = "http://img.youtube.com/vi/"; $.getJSON(ytURL, function (data) { $.each(data.feed.entry, function (i, item) { var itemTitle = item.title.$t; // Title of the video var itemdescription = item.media$group.media$description.$t; //Description of the Video itemdescription...

Check users subscriptions?

Is it possible to check how many subscriptions a channel has made? I have been looking around in Youtubes API without any success. Note: I am not looking for the amount of subscribers but the amount of subscriptions. https://www.googleapis.com/youtube/v3/channels?part=statistics&id=ID&key=KEY The above call returns for example the amount of subscribers which...

Obtaining video duration

A search is made to obtain videos. How do I obtain the duration of the video? for search_result in search_response.get("items", []): if search_result["id"]["kind"] == "youtube#video": VideoID.append(search_result["id"]["videoId"]) ChannelID.append(search_result["snippet"]["channelId"]) VideoName.append(search_result["snippet"]["title"]) ChannelName.append(search_result["snippet"]["channelTitle"]) videoDuration.append(search_result["contentDetails"]["duration"]) The last line returns a key error. Judging by the API on the website this is how...

Why when trying to upload a video file to youtube i'm getting InvalidCredentialsException?

This is my code in form1: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; using Google.GData.Client; using Google.GData.Extensions; using Google.GData.YouTube; using Google.GData.Extensions.MediaRss; using Google.YouTube; namespace YouTube_Manager { public partial class Form1 : Form { YouTubeRequestSettings settings; YouTubeRequest request; string username...

how to get fullscreen for youtube api

I just trying to set default allow fullscreen for youtube api but i can't find that and i am new to javascript i tried so any many code but i didn't got.Actually i want to allow multiple youtube video with full screen. here's the code i am working <div id="player"></div>...

Grabbing color palette from YouTube thumbnail

I'm trying to grab the color palette from YouTube thumbnails, to better blend the YouTube video with a whole website design, and I'm wondering if there is any way of doing this? I've tried using color-thief (https://github.com/lokesh/color-thief) and this code (with no luck): var img = new Image(); img.onload =...

GAE python - client_secrets.json 'File not found' - app.yaml error?

I am using GAE (python) to make a web application. I am specifically attempting to get a youtube API to work, but I cannot get the credentials to function properly. If I follow the "Retrieve my Uploads" example here, I keep getting an error when importing the client_secrets.json file: InvalidClientSecretsError('File...

Errors in the Youtube API v3 python examples

Because Youtube Engineers monitor stack overflow with tags related to Youtube API v3 When executing: #!/usr/bin/python from apiclient.discovery import build from apiclient.errors import HttpError from oauth2client.tools import argparser I am receiving the following error: from apiclient.discovery import build ImportError: No module named apiclient.discovery Please Google Engineers correct the samples so...

YouTube giving me error while using file_get_contents

So I'm trying to update YouTube code from API v2 to v3, but file_get_contents() keep on giving me an error. This is my code: stream_context_set_default(['http' => ['ignore_errors' => true]]); $url = file_get_contents('https://www.googleapis.com/youtube/v3/playlistItems?part=contentDetails&playlistId=PLwC9H0qrxrLyQsNFq37MeivYOMOBxfCdo&key=MY_API_KEY'); echo $url; This is the error message I've been thrown stdClass Object ( [error] => stdClass Object (...

Transfert a Zend Project to Symfony

I have a project made using Zend. My boss asked me to change the technology to Symfony 2.7. Is there a way to transfer the project ? Or to take some files into Symfony ? Or should I begin all the project from scratch using Symfony ? Thanks !...

Rails: Model method doesn't execute as a cron task in development

I am currently writing an application in Ruby on Rails that fetches data (videoId as a string, title as a string, thumbnail url as a string, and date of when video was created as a datetime type) from YouTube and saves it to the database. I have tested YouTube API...

Dynamic youtube iframe in javascript and jQuery

I'm going crazy, trying to fix this and it wont work the way I want it to work,ahhh I feel like a child :/ var videoID; var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); videoID = sessionStorage.getItem("key"); var onYouTubeIframeAPIReady = function(){ player = new YT.Player('player',...

How can i get list of my youtube videos from youtube?

I installed the google api 3 and the OAuth2. And i tried the google develope example: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Google.GData.Client; using Google.GData.Extensions; using Google.GData.YouTube; using Google.GData.Extensions.MediaRss; using Google.YouTube; namespace Youtube_Manager { public partial class...

Youtube api v3 getVideoData() list functions

I used player.getVideoData().title to get the title of the current video, but what to use to get views? please javascript only :)...

Alternative for https://gdata.youtube.com/feeds/api/videos/?v=2

These days I noticed that Youtube API which I'm using on my project is no longer available, e.g. https://gdata.youtube.com/feeds/api/videos/dLEk9yiXVQs?v=2 returns HTTP 410 response code which means that requested resource is no longer available and will not be available again. What should I use instead?...

Zend_Pdf how to reduce the loading time of images?

I built an pdf document which is based on database records of 2 related tables. The mastertable contains shopdata with logos. In the records I of course don't save the image itself, but only the pathinfo. The detailtable just contains meeting dates, no problems with this one. If I start...

Uninstalling php 5.3 in ubuntu 14.04

I have installed php 5.3 manually by executing commands like make & make install. But I need to upgrade it to v5.5 therefore I deleted all the directories related to php5 using sudo command. But when I run php -v Still I am getting PHP 5.3.29 (cli) (built: Jun 8...

How to get number of video views with YouTube API V3?

i use this code to achieve this but this don't work : <?php $JSON = file_get_contents("https://www.googleapis.com/youtube/v3/videos?part=statistics&id=hqepb5hzuB0&key={YOUR-API-KEY}"); $JSON_Data = json_decode($JSON); $views = $json_data->{'entry'}->{'yt$statistics'}->{'viewCount'}; echo $views; ?> Thanks...

Quota cost of searching for videos and only needing the ID?

What is the quota cost of searching videos and only needing the ID returned? I tried using the quota calculator but it doesn't output anything (and I'm assuming that the cost isn't actually 0 when you only specify "part" to be id only).

I cant pass clicked value into function

DEMO Static Value : Hi, Iam not able to Pass the Clicked Value in to Return Function. function getArtistId() { //return 'l-gQLqv9f4o'; if i uncomment this videos will work like charm, but instead of static i need dynamic onclick of the element getting the value and passing. return 'ytData1'; }...

Unbranded, advertisement free, video streaming with youtube api

Is it possible to use the youtube api to provide video for an app I'm hoping to develop. I want to upload videos from iOS, android and the web. I want to be able to control access to my videos - i.e. they're all private unless my app provides access....

Using YTPlayerView to play embedded youtube video in iOS failed with restriction error

I want play embedded youtube video in iOS app using YTPlayerView provided at https://developers.google.com/youtube/v3/guides/ios_youtube_helper When I tried to play this video with ID = "Ri7-vnrJD3k" (https://www.youtube.com/embed/Ri7-vnrJD3k), I got the error message "This video contains content from VEVO. It is restricted from playback on certain sites. Watch on YouTube". Note that...

Handle key events when using Youtube iframe API

I was looking for a solution on how to handle key events when running Youtube videos on my application using Youtube iframe API. unfortunately couldn't find any. Did went through this documentation https://developers.google.com/youtube/iframe_api_reference#Events but it seems player doesn't fire any event related to key ( ex: onkeydown, keypress, keyup )....

PHP: YouTube v3 APIā€¦ Retrieve last 50 videos from Watch Later list and add them to a playlist

<?php require_once 'Google/autoload.php'; require_once 'Google/Client.php'; require_once 'Google/Service/YouTube.php'; $client = new Google_Client(); $client->setDeveloperKey('{YOUR-API-KEY}'); $youtube = new Google_Service_YouTube($client); $nextPageToken = ''; $htmlBody = '<ul>'; do { $playlistItemsResponse = $youtube->playlistItems->listPlaylistItems('snippet', array( 'playlistId' => '{PLAYLIST-ID-HERE}', 'maxResults' => 50, 'pageToken' => $nextPageToken)); foreach ($playlistItemsResponse['items'] as...

Youtube API v3 - get list of all restricted countries

In Youtube API v2 there was the section to describe in which countries video will be blocked: <media:restriction type='country' relationship='deny'> BD BE BF... </media:restriction> How can I get the same information using new Youtube API v3?...

Youtube subscriber count with Youtube Data Api V3

So previously i was getting a youtube channel subcriber count with youtube data api v2. I used the following ( i am using TED channel for demo purposes ) http://gdata.youtube.com/feeds/api/users/TEDtalksDirector?alt=json&callback=jQuery111202977260369807482_1433828589506&jsonp&_=1433828589507 However with the new v3 api, there is not subscriber count in the result....

Get comments thread for a YouTube video using api v3.0

I'm trying to use the .net YouTube API v.3.0 to retrieve the comments thread. I'm basically trying to reuse the sample for Java, but when I try to authorize with my client secrets I do not get any scope with my token (it is set to null when I inspect...

Zend Skeleton Application album tutorial 404

As far as I can see I've followed the Zend skeleton application tutorial to the letter (I actually went through it twice with the same result) but when I try to access zf2-tutorial.localhost/album I get the following error: A 404 error occurred Page not found. The requested URL could not...