# Sample usage: # python geolocation_--q=surfing --location-"37.42307,-122.08427" --location-radius=50km --max-results=10 # NOTE: To use the sample, you must provide a developer key obtained # in the Google APIs Console. /usr/bin/python # This sample executes a search request for the specified search term.Therefore, a developer can restrict results to videos uploaded through the developer's own app or website but not to videos uploaded through other apps or sites. Searching videos with "youtube.search.list" method and setting "type", "q", "location" and * "location Radius" parameters. Retrieving location details for each video with "youtube.videos.list" method and setting * "id" parameter to comma separated list of video IDs in search result. Please visit to do so.""") else: youtube = build( YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION, developer Key=DEVELOPER_KEY) search_response = youtube.search().list( q="Hello", part="id,snippet", max Results=5 ).execute() videos =  channels =  playlists =  for search_result in search_response.get("items", ): if search_result["id"]["kind"] == "youtube#video": videos.append("%s (%s)" % (search_result["snippet"]["title"], search_result["id"]["video Id"])) elif search_result["id"]["kind"] == "youtube#channel": channels.append("%s (%s)" % (search_result["snippet"]["title"], search_result["id"]["channel Id"])) elif search_result["id"]["kind"] == "youtube#playlist": playlists.append("%s (%s)" % (search_result["snippet"]["title"], search_result["id"]["playlist Id"])) template_values = self.response.headers[' Content-type'] = 'text/plain' template = JINJA_ENVIRONMENT.get_template('index.html') self.response.write(template.render(template_values)) app = webapp2.parameter retrieves a list of videos that are related to the video that the parameter value identifies. * * @author Ibrahim Ulukaya */ public class Geolocation Search using System; using System. WSGIApplication([ ('/.*', Main Handler), ], debug=True) # Please ensure that you have enabled the You Tube Data API for your project.
DEVELOPER_KEY = ' REPLACE_ME' YOUTUBE_API_SERVICE_NAME = 'youtube' YOUTUBE_API_VERSION = 'v3' def youtube_search(options): youtube = build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION, developer Key=DEVELOPER_KEY) # Call the method to retrieve results matching the specified # query term.
HD videos are available for playback in at least 720p, though higher resolutions, like 1080p, might also be available. You may obtain a copy of the License at * * * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied.
If you specify a value for this parameter, you must also set the parameter filters search results to only include videos with a particular license. See the License for the specific language governing permissions and limitations under * the License.
At that time, You Tube started supporting a small set of curated topic IDs, and you can only use that smaller set of IDs as values for this parameter. * * @author Jeremy Walker */ public class Search /* * Copyright (c) 2014 Google Inc.
parameter lets you restrict a search to only include either high definition (HD) or standard definition (SD) videos. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. Joiner; import com.services.samples.youtube.cmdline. For this feature, each uploaded video is automatically tagged with the project number that is associated with the developer's application in the Google Developers Console. DEVELOPER_KEY = "REPLACE_ME" YOUTUBE_API_SERVICE_NAME = "youtube" YOUTUBE_API_VERSION = "v3" class Main Handler(webapp2.