开发者

Issue with YouTube Java API

开发者 https://www.devze.com 2023-01-13 19:47 出处:网络
I am using YouTube API to perform simple searches on YouTube. Here\'s my code : import java.net.URL; import com.google.gdata.client.youtube.YouTubeQuery;

I am using YouTube API to perform simple searches on YouTube. Here's my code :

import java.net.URL;

import com.google.gdata.client.youtube.YouTubeQuery;
import com.google.gdata.client.youtube.YouTubeService;

/**
 * 
 */

/**
 * @author denzilc
 *
 */
public class CollectData {

    public static String clientID = "****";
    public static String developer_key = "*****";
    public static String YOUTUBE_URL = "http://gdata.youtube.com/feeds/api/videos";

    public static String myQuery = "India";
    public static int maxResults = 200;
    public static int timeout = 2000;


    public static String outputDir = "";
    public static String outputFile = "";




    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub

        try {
            YouTubeService service = new YouTubeService(clientID);
            YouTubeQuery query = new YouTubeQuery(new URL(YOUTUBE_URL));

            query.setSafeSearch(YouTubeQuery.SafeSearch.NONE);




        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }



    }

}

However, I receive the following compilation error:

Description Resource Path Location Type The type com.google.gdata.client.Query cannot be resolve开发者_如何学Pythond. It is indirectly referenced from required .class files CollectData.java /YouTube/src line 1 Java Problem

Here's a pic of my JAVA Build Path and the referenced libraries:

Issue with YouTube Java API

Am I missing something here?


Looks like you're missing gdata-client-core-1.0.jar

0

精彩评论

暂无评论...
验证码 换一张
取 消