From f60f2c56ad1b92f406433176cd0c226924beac4a Mon Sep 17 00:00:00 2001 From: Chris Bellew Date: Tue, 31 Jan 2017 09:54:19 -0800 Subject: [PATCH] Get correct url for decryption js when it doesn't include https://youtube.com. For #49. --- .../businessobjects/VideoStream/ParseStreamMetaData.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/free/rm/skytube/businessobjects/VideoStream/ParseStreamMetaData.java b/app/src/main/java/free/rm/skytube/businessobjects/VideoStream/ParseStreamMetaData.java index 8c9f373377..0ca77505fd 100644 --- a/app/src/main/java/free/rm/skytube/businessobjects/VideoStream/ParseStreamMetaData.java +++ b/app/src/main/java/free/rm/skytube/businessobjects/VideoStream/ParseStreamMetaData.java @@ -99,6 +99,10 @@ public String init(String videoId) throws Exception { JSONObject ytAssets = jsonObj.getJSONObject("assets"); String playerUrl = ytAssets.getString("js"); + + if(!playerUrl.contains("youtube.com")) { + playerUrl = "https://youtube.com" + playerUrl; + } if (playerUrl.startsWith("//")) { playerUrl = "https:" + playerUrl; }