【发布时间】:2017-10-30 07:02:46
【问题描述】:
我想使用 Facebook 复制 URL 检索 facebook 视频 mp4 URL 和拇指图像。我在获取视频详细信息时收到 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 视频 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}
【问题讨论】:
-
您需要提取视频id(字符串函数,正则表达式),然后使用该id通过API查询对象的详细信息。