Note that there are some explanatory texts on larger screens.

plurals
  1. POSearch multiple keywords in Youtube GData Youtube class
    text
    copied!<p>The Youtube API document says that multiple keywords can be searched during video fetch as per the below link.</p> <p><a href="https://developers.google.com/youtube/2.0/reference#Searching_for_videos" rel="nofollow">https://developers.google.com/youtube/2.0/reference#Searching_for_videos</a></p> <p>The below link gives some examples for the same. The example provided for the "q" parameter says that we can use NOT (-) and OR (|) operator in the search:</p> <p><a href="https://developers.google.com/youtube/2.0/reference#qsp" rel="nofollow">https://developers.google.com/youtube/2.0/reference#qsp</a></p> <p>Example: q=boating%7Csailing does a search for either boating or sailing.</p> <p>I am able to understand these points. My question is I am using ZendGData library in Zend Framework 2 to search the videos. I am not sure how to provide multiple keywords for the search.</p> <pre><code>$yt = new ZendGData\YouTube(); $query = $yt-&gt;newVideoQuery(); </code></pre> <p>All the combinations that I tried is provided below. None of them works.</p> <pre><code>$query-&gt;setQuery("french,tamil"); $query-&gt;setQuery("french|tamil"); $query-&gt;setQuery("french%7Ctamil"); $query-&gt;setQuery("french or tamil"); </code></pre> <p>Note: The docs says to use url encode so that the pipe symbol is encoded. That's why I treid %7C in the search.</p> <p>The URL generated by the ZendGData class is: <a href="https://gdata.youtube.com/feeds/api/videos?q=french|tamil&amp;start-index=58&amp;max-results=50&amp;safeSearch=none&amp;orderby=viewCount&amp;format=5&amp;v=2" rel="nofollow">https://gdata.youtube.com/feeds/api/videos?q=french|tamil&amp;start-index=58&amp;max-results=50&amp;safeSearch=none&amp;orderby=viewCount&amp;format=5&amp;v=2</a></p> <p>This does not fetch the videos with keyword "tamil". All the videos are from the first keyword only. </p> <p>Please point me in the correct direction.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload