Fix bug
This commit is contained in:
parent
f234cb17d5
commit
6f1425623d
|
|
@ -354,6 +354,7 @@ public class AliYun {
|
||||||
JsonObject param = new JsonObject();
|
JsonObject param = new JsonObject();
|
||||||
param.addProperty("file_id", tempIds.get(0));
|
param.addProperty("file_id", tempIds.get(0));
|
||||||
param.addProperty("drive_id", cache.getDrive().getDriveId());
|
param.addProperty("drive_id", cache.getDrive().getDriveId());
|
||||||
|
param.addProperty("expire_sec", 900);
|
||||||
String json = oauth("openFile/getDownloadUrl", param.toString(), true);
|
String json = oauth("openFile/getDownloadUrl", param.toString(), true);
|
||||||
String url = Download.objectFrom(json).getUrl();
|
String url = Download.objectFrom(json).getUrl();
|
||||||
downloadMap.put(fileId, url);
|
downloadMap.put(fileId, url);
|
||||||
|
|
@ -375,7 +376,7 @@ public class AliYun {
|
||||||
param.addProperty("file_id", tempIds.get(0));
|
param.addProperty("file_id", tempIds.get(0));
|
||||||
param.addProperty("drive_id", cache.getDrive().getDriveId());
|
param.addProperty("drive_id", cache.getDrive().getDriveId());
|
||||||
param.addProperty("category", "live_transcoding");
|
param.addProperty("category", "live_transcoding");
|
||||||
param.addProperty("url_expire_sec", "14400");
|
param.addProperty("url_expire_sec", 900);
|
||||||
String json = oauth("openFile/getVideoPreviewPlayInfo", param.toString(), true);
|
String json = oauth("openFile/getVideoPreviewPlayInfo", param.toString(), true);
|
||||||
return Preview.objectFrom(json).getVideoPreviewPlayInfo();
|
return Preview.objectFrom(json).getVideoPreviewPlayInfo();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
@ -462,7 +463,7 @@ public class AliYun {
|
||||||
private static boolean isExpire(String url) {
|
private static boolean isExpire(String url) {
|
||||||
String expires = new UrlQuerySanitizer(url).getValue("x-oss-expires");
|
String expires = new UrlQuerySanitizer(url).getValue("x-oss-expires");
|
||||||
if (TextUtils.isEmpty(expires)) return false;
|
if (TextUtils.isEmpty(expires)) return false;
|
||||||
return Long.parseLong(expires) - getTimeStamp() <= 60;
|
return Long.parseLong(expires) - getTimeStamp() <= 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static long getTimeStamp() {
|
private static long getTimeStamp() {
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
8b94f251e1af6b67e1ee86cb151cda70
|
d363d6ddea1cbc73ce7addcae613605e
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue