如何在android中使用facebook copy Url获取facebook视频详细信息

时间:2017-10-30 07:02:46

标签: android facebook video

我想使用Facebook复制URL检索Facebook视频mp4网址和拇指图像。我在获取视频详细信息时获得了200个权限错误。我的代码如下。请任何人帮我解决这个问题。

https://www.facebook.com/shreyaghoshal/posts/10155774118036484

 request= GraphRequest.newMeRequest( AccessToken.getCurrentAccessToken(),
                new GraphRequest.GraphJSONObjectCallback() {
                    @Override
                    public void onCompleted(
                            JSONObject object,  GraphResponse response) {
                        try {
                            if(object!=null) {
                                create_facebookID = object.getString("id").toString();
                                Log.e("facebook" ,"id"+create_facebookID);

                                new GraphRequest(
                                        AccessToken.getCurrentAccessToken(),
                                      create_facebookID+"_10155774118036484",
                                        null,
                                        HttpMethod.GET,
                                        new GraphRequest.Callback() {
                                            public void onCompleted(GraphResponse response) {

                                                Log.e("response", "res...." + response.toString());
                                            }
                                        }
                                ).executeAsync();
                            }
                        }catch (Exception e){
                            e.printStackTrace();

                        }
                    }
                });

        Bundle parameters = new Bundle();
        parameters.putString("fields", "id,name,email,gender, birthday");
        request.setParameters(parameters);
        request.executeAsync();

这是我得到的回应。我想获得视频网址。 10-31 10:04:45.203 27233-27233 / com.tweak.tweak videos E / response:res .... {Response:responseCode:200,graphObject:{"created_time":"2017-10-09T09:12:56+0000","message":"‪I think I forgot how to breathe! Heart skipped beats. #PadmavatiTrailer is pure goosebumps. #SanjayLeelaBhansali has created the unthinkable.‬\nThe poetic magic that he alone can bring to the screens.Deepika Padukone Shahid Kapoor Ranveer Singh bring their best in this film! Music coming soon. Stay tuned.","the story":"Shreya Ghoshal shared Padmavati's video.","id":"11541726483_10155774118036484"}, error: null}

1 个答案:

答案 0 :(得分:0)

经过这么多时间的研究。我得到了解决方案。现在我可以获取视频的视频详细信息。我添加了捆绑包的密钥。现在我可以获取视频详细信息。

      if (Youtube_videos.fb_post_url) {
                                    request_fb_post = new GraphRequest(
                                            AccessToken.getCurrentAccessToken(),                                    
                                                create_facebookID + "_10155774118036484",
                                            null,
                                            HttpMethod.GET,
                                            new GraphRequest.Callback() {
                                                public void onCompleted(GraphResponse response) {

                                                    Log.e("response", "res...." + response.toString());
                                                }
                                            }
                                    );
                                    Bundle parameters = new Bundle();
                                    parameters.putString("fields", "id,caption ,object_id ,permalink_url ,picture,source,status_type,properties,type ");
                                    request_fb_post.setParameters(parameters);
                                    request_fb_post.executeAsync();