+ Reply to Thread
Results 1 to 3 of 3

Thread: Handling of blocked videos retrieved through youtube video feed

  1. #1
    bhupendra2895's Avatar
    bhupendra2895 is offline x10 Elder bhupendra2895 is an unknown quantity at this point
    Join Date
    Jun 2010
    Location
    India
    Posts
    554

    Handling of blocked videos retrieved through youtube video feed

    Hi,

    The Problem:-
    I am creating a youtube application(for mobile browsers) in zend framework(PHP) to learn the basics of framework.I have created a search form which uses GET method.So when user enters a query the api fetches the data from youtube server and parse it.So I can display it to user.

    The problem is that whenever I search for 'Michael Jackson', I get some videos without content url, running this query in youtube.com's search engine shows that this blocked by Vevo in my country, may be due to copyright issue.

    For resolving this issue I blocked videos with no content URL in view (User's Browser).But my youtube search interface is designed to show 10 videos per page, so when I block such videos either no video display in result or only few videos get displayed.This will certainly create a confusion in the mind of user.Unfortunately Michael Jackson is very popular among us.

    The solutions in my mind:-
    I think one solution isto fetch around 30 enteries at once and display 10 out of them having the content URL.But I feel it is very costly for server.Because if user find his choice in first page useful than what is the meaning of fetching 30 entries at once.For example when I search for 'mozila firefox', I don't get such videos.I can cache the filtered results, but is it a good idea to use caching with webservices.

    The Question:-
    If you had used youtube api in your application, is this issue occured to you and if occured how you resolved it?

    Please suggest me a better solution for this problem.

  2. #2
    misson is online now x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Handling of blocked videos retrieved through youtube video feed

    What URL(s) are you using to fetch results? What API of YouTube's are you using?
    Last edited by misson; 09-06-2010 at 05:12 PM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  3. #3
    bhupendra2895's Avatar
    bhupendra2895 is offline x10 Elder bhupendra2895 is an unknown quantity at this point
    Join Date
    Jun 2010
    Location
    India
    Posts
    554

    Re: Handling of blocked videos retrieved through youtube video feed

    This is the URL that is used to fetch the result http://gdata.youtube.com/feeds/api/v...ichael+Jackson

    I am using zend Gdata PHP api, more info here:-
    Develepors's guide php
    Developer Guide
    Youtube API Reference

    This is the php code that is written in controller to fetch feed
    PHP Code:
        public function searchAction() {
            try {
                
    $q $this->_request->getParam 'q' ); //parameter from get request
                
    $yt = new Zend_Gdata_YouTube ();
                
    $yt->setMajorProtocolVersion );
                
    $query $yt->newVideoQuery ();
                
    $query->setMaxResults );
                
    $query->setVideoQuery $q );
                
    $videoFeed $yt->getWatchOnMobileVideoFeed($query->getQueryUrl) );
                
    $this->view->videos $videoFeed;
                
    $this->view->string $q;
                
    $request_url $query->getQueryUrl(); //Used for getting request URL
                
    $this->view->request $request_url;
            } catch ( 
    Zend_Excetion_Service $e ) {
                throw 
    $e;
            }
        } 

    Edit:- I found the solution here http://code.google.com/apis/youtube/....html#formatsp

    I set this format
    PHP Code:
    $query->setFormat('1'); 
    So request URL changed to
    http://gdata.youtube.com/feeds/api/v...ckson&format=1
    Now I am getting only those videos in feed which have rtsp link for mobile phones.I am sorry that I asked this question before searching the Youtube API developers forum, instead I searched Google for finding solution.
    Last edited by bhupendra2895; 09-07-2010 at 05:21 AM.

+ Reply to Thread

Similar Threads

  1. [Videos Youtube]
    By Kansy in forum General
    Replies: 23
    Last Post: 01-05-2010, 08:49 PM
  2. Youtube Videos?
    By elliott1 in forum Free Hosting
    Replies: 6
    Last Post: 10-13-2007, 09:11 PM
  3. My 2 New YouTube Videos
    By SEÑOR in forum Off Topic
    Replies: 0
    Last Post: 08-20-2007, 01:14 PM
  4. videos de youtube
    By figu120 in forum Soporte
    Replies: 3
    Last Post: 08-14-2007, 05:53 PM
  5. Videos YouTube
    By DarkPaladin16 in forum Soporte
    Replies: 6
    Last Post: 08-09-2007, 08:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers