diff --git a/.idea/caches/gradle_models.ser b/.idea/caches/gradle_models.ser
index 3add12d..2a2f3b6 100644
Binary files a/.idea/caches/gradle_models.ser and b/.idea/caches/gradle_models.ser differ
diff --git a/app/build.gradle b/app/build.gradle
index 61c079b..e905ada 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -6,8 +6,8 @@ android {
applicationId "com.htetznaing.xgetterexample"
minSdkVersion 17
targetSdkVersion 28
- versionCode 4
- versionName "1.4"
+ versionCode 5
+ versionName "1.5"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
diff --git a/app/release/app-release.apk b/app/release/app-release.apk
index 7709293..15a2b39 100644
Binary files a/app/release/app-release.apk and b/app/release/app-release.apk differ
diff --git a/app/release/output.json b/app/release/output.json
index dccaa98..d171dd0 100644
--- a/app/release/output.json
+++ b/app/release/output.json
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":4,"versionName":"1.4","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":5,"versionName":"1.5","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
\ No newline at end of file
diff --git a/app/src/main/java/com/htetznaing/xgetterexample/MainActivity.java b/app/src/main/java/com/htetznaing/xgetterexample/MainActivity.java
index 4ee9e88..4b045cd 100644
--- a/app/src/main/java/com/htetznaing/xgetterexample/MainActivity.java
+++ b/app/src/main/java/com/htetznaing/xgetterexample/MainActivity.java
@@ -7,7 +7,6 @@
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
-import android.view.ContextThemeWrapper;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@@ -16,6 +15,8 @@
import android.widget.TextView;
import android.widget.Toast;
+import com.htetznaing.xgetter.OkRuLinks;
+import com.htetznaing.xgetter.VkLinks;
import com.htetznaing.xgetter.XGetter;
import com.htetznaing.xgetterexample.Player.MyExoPlayer;
@@ -50,6 +51,22 @@ public void onFbTaskCompleted(String sd, String hd) {
} else done(null, null, null, false, true);
}
+ @Override
+ public void onOkRuTaskCompleted(OkRuLinks okRuLinks) {
+ progressDialog.dismiss();
+ if (okRuLinks.getHD()!=null){
+ done(okRuLinks.getHD(),null,null,false,false);
+ } else done(null, null, null, false, true);
+ }
+
+ @Override
+ public void onVkTaskComplete(VkLinks vkLinks) {
+ progressDialog.dismiss();
+ if (vkLinks.getUrl720()!=null){
+ done(vkLinks.getUrl720(),null,null,false,false);
+ } else done(null, null, null, false, true);
+ }
+
@Override
public void onError() {
progressDialog.dismiss();
@@ -93,7 +110,7 @@ public void vidcloud(View view) {
}
public void rapidvideo(View view) {
- letGo("https://www.rapidvideo.com/v/FY1NF585GW");
+ letGo("https://www.rapidvideo.com/v/FW5M4CBTFF");
}
public void gdrive(View view) {
@@ -112,6 +129,14 @@ public void mediafire(View view) {
letGo("http://www.mediafire.com/file/dd00f818ybeu83x/");
}
+ public void okru(View view) {
+ letGo("https://ok.ru/video/1246547348046");
+ }
+
+ public void vk(View view) {
+ letGo("https://vk.com/video-94920838_456240508");
+ }
+
public boolean checkInternet() {
boolean what = false;
CheckInternet checkNet = new CheckInternet(this);
@@ -218,6 +243,9 @@ public void showAbout() {
"SendVid\n" +
"VidCloud\n" +
"MegaUp\n" +
+ "Mediafire\n" +
+ "VK\n" +
+ "Ok.Ru" +
"\n" +
"Github Repo => https://github.com/KhunHtetzNaing/xGetter";
View view = getLayoutInflater().inflate(R.layout.done, null);
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 3ec9aa5..3e9decf 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -46,8 +46,8 @@
android:layout_height="match_parent">
@@ -93,6 +93,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
+
+
+
+
+
diff --git a/xgetter/build.gradle b/xgetter/build.gradle
index a73caeb..7ef5815 100644
--- a/xgetter/build.gradle
+++ b/xgetter/build.gradle
@@ -1,15 +1,15 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
group='com.htetznaing'
-version='1.4'
+version='1.5'
android {
compileSdkVersion 26
defaultConfig {
minSdkVersion 17
targetSdkVersion 26
- versionCode 4
- versionName "1.4"
+ versionCode 5
+ versionName "1.5"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -30,4 +30,5 @@ dependencies {
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.volley:volley:1.1.1'
+ implementation 'org.apache.commons:commons-lang3:3.8.1'
}
\ No newline at end of file
diff --git a/xgetter/src/main/java/com/htetznaing/xgetter/OkRuLinks.java b/xgetter/src/main/java/com/htetznaing/xgetter/OkRuLinks.java
new file mode 100644
index 0000000..0045569
--- /dev/null
+++ b/xgetter/src/main/java/com/htetznaing/xgetter/OkRuLinks.java
@@ -0,0 +1,85 @@
+package com.htetznaing.xgetter;
+
+public class OkRuLinks {
+ String url;
+ String mobile144px;
+ String lowest240px;
+ String low360px;
+ String sd480px;
+ String HD;
+ String FullHD;
+ String quad2K;
+ String ultra4K;
+
+ public String getUrl() {
+ return url;
+ }
+
+ public String getMobile144px() {
+ return mobile144px;
+ }
+
+ public String getLowest240px() {
+ return lowest240px;
+ }
+
+ public String getLow360px() {
+ return low360px;
+ }
+
+ public String getSd480px() {
+ return sd480px;
+ }
+
+ public String getHD() {
+ return HD;
+ }
+
+ public String getFullHD() {
+ return FullHD;
+ }
+
+ public String getQuad2K() {
+ return quad2K;
+ }
+
+ public String getUltra4K() {
+ return ultra4K;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public void setMobile144px(String mobile144px) {
+ this.mobile144px = mobile144px;
+ }
+
+ public void setLowest240px(String lowest240px) {
+ this.lowest240px = lowest240px;
+ }
+
+ public void setLow360px(String low360px) {
+ this.low360px = low360px;
+ }
+
+ public void setSd480px(String sd480px) {
+ this.sd480px = sd480px;
+ }
+
+ public void setHD(String HD) {
+ this.HD = HD;
+ }
+
+ public void setFullHD(String fullHD) {
+ FullHD = fullHD;
+ }
+
+ public void setQuad2K(String quad2K) {
+ this.quad2K = quad2K;
+ }
+
+ public void setUltra4K(String ultra4K) {
+ this.ultra4K = ultra4K;
+ }
+}
diff --git a/xgetter/src/main/java/com/htetznaing/xgetter/VkLinks.java b/xgetter/src/main/java/com/htetznaing/xgetter/VkLinks.java
new file mode 100644
index 0000000..dcaceb0
--- /dev/null
+++ b/xgetter/src/main/java/com/htetznaing/xgetter/VkLinks.java
@@ -0,0 +1,45 @@
+package com.htetznaing.xgetter;
+
+public class VkLinks {
+ String url240,url360,url480,url720,url1080;
+
+ public String getUrl240() {
+ return url240;
+ }
+
+ public void setUrl240(String url240) {
+ this.url240 = url240;
+ }
+
+ public String getUrl360() {
+ return url360;
+ }
+
+ public void setUrl360(String url360) {
+ this.url360 = url360;
+ }
+
+ public String getUrl480() {
+ return url480;
+ }
+
+ public void setUrl480(String url480) {
+ this.url480 = url480;
+ }
+
+ public String getUrl720() {
+ return url720;
+ }
+
+ public void setUrl720(String url720) {
+ this.url720 = url720;
+ }
+
+ public String getUrl1080() {
+ return url1080;
+ }
+
+ public void setUrl1080(String url1080) {
+ this.url1080 = url1080;
+ }
+}
diff --git a/xgetter/src/main/java/com/htetznaing/xgetter/XGetter.java b/xgetter/src/main/java/com/htetznaing/xgetter/XGetter.java
index 8bdf804..c8d9c80 100644
--- a/xgetter/src/main/java/com/htetznaing/xgetter/XGetter.java
+++ b/xgetter/src/main/java/com/htetznaing/xgetter/XGetter.java
@@ -18,6 +18,11 @@
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.HashMap;
@@ -30,7 +35,7 @@
* By
* Khun Htetz Naing
* Repo => https://github.com/KhunHtetzNaing/xGetter
- * Openload,Google Drive,Google Photos,MediafireStreamango,StreamCherry,Mp4Upload,RapidVideo,SendVid,VidCloud,MegaUp Stream/Download URL Finder!
+ * Openload,Google Drive,Google Photos,MediafireStreamango,StreamCherry,Mp4Upload,RapidVideo,SendVid,VidCloud,MegaUp,VK,Ok.Ru Stream/Download URL Finder!
*
*/
@@ -49,6 +54,8 @@ public class XGetter {
private final String gphoto = "https?:\\/\\/(photos.google.com)\\/(u)?\\/?(\\d)?\\/?(share)\\/.+(key=).+";
private final String fb = "(?:https?://)?(?:www.|web.|m.)?facebook.com/(?:video.php\\?v=\\d+|photo.php\\?v=\\d+|\\?v=\\d+)|\\S+/videos/((\\S+)/(\\d+)|(\\d+))/?";
private final String mediafire = "https?:\\/\\/(www\\.)?(mediafire)\\.[^\\/,^\\.]{2,}\\/(file)\\/.+";
+ private final String okru = "https?:\\/\\/(www\\.)?(ok)\\.[^\\/,^\\.]{2,}\\/(video)\\/.+";
+ private final String vk = "https?:\\/\\/(www\\.)?vk\\.[^\\/,^\\.]{2,}\\/video\\-.+";
public XGetter(Context view) {
this.context = view;
@@ -60,6 +67,7 @@ private void init() {
webView.addJavascriptInterface(new xJavascriptInterface(), "xGetter");
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setDomStorageEnabled(true);
+
webView.setWebViewClient(new WebViewClient() {
@Override
@@ -82,7 +90,6 @@ public void onDownloadStart(String url, String userAgent, String contentDisposit
webView.setWebChromeClient(new WebChromeClient() {
@Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
- System.out.println(consoleMessage.message());
return super.onConsoleMessage(consoleMessage);
}
});
@@ -134,10 +141,11 @@ private void letFuck(WebView view) {
"YyhkYXRhKSkgIT09IG51bGwpIHsKICAgICAgICAgICAgICAgIHhHZXR0ZXIuZnVjayhtWzFdKTsK\n" +
"ICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0pOwp9IGVsc2UgaWYgKHdpbmRvdy5sb2NhdGlv\n" +
"bi5ob3N0ID09ICdkcml2ZS5nb29nbGUuY29tJykgewogICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5\n" +
- "SWQoJ3VjLWRvd25sb2FkLWxpbmsnKS5jbGljaygpOwp9CgovKgpTdXBwb3J0ZWQgU2l0ZXMKPT4g\n" +
- "T3BlbmxvYWQgKEFsbCBkb21haW5zKQo9PiBGcnVpdFN0cmVhbXMgKFN0cmVhbWNoZXJyeSxTdHJl\n" +
- "YW1hbmdvIGFuZCBldGMuLikKPT4gTXA0VXBsb2FkCj0+IFJhcGlkVmlkZW8KPT4gU2VuZFZpZAo9\n" +
- "PiBNZWdhVXAKPT4gVmlkQ2xvdWQgKEFsbCBkb21haW5zKQoqLw==";
+ "SWQoJ3VjLWRvd25sb2FkLWxpbmsnKS5jbGljaygpOwp9Ci8qClN1cHBvcnRlZCBTaXRlcwo9PiBP\n" +
+ "cGVubG9hZCAoQWxsIGRvbWFpbnMpCj0+IEZydWl0U3RyZWFtcyAoU3RyZWFtY2hlcnJ5LFN0cmVh\n" +
+ "bWFuZ28gYW5kIGV0Yy4uKQo9PiBNcDRVcGxvYWQKPT4gUmFwaWRWaWRlbwo9PiBTZW5kVmlkCj0+\n" +
+ "IE1lZ2FVcAo9PiBWaWRDbG91ZCAoQWxsIGRvbWFpbnMpCj0+IE1lZGlhZmlyZQo9PiBHb29nbGUg\n" +
+ "UGhvdG9zCj0+IEdvb2dsZSBEcml2ZQo9PiBPay5SdQoqLw==";
view.loadUrl("javascript:(function() {" +
"var parent = document.getElementsByTagName('head').item(0);" +
"var script = document.createElement('script');" +
@@ -152,8 +160,7 @@ public void find(String url) {
init();
boolean fb = false;
boolean run = false;
- boolean mfire = false, oload = false;
-
+ boolean mfire = false, oload = false,isOkRu = false,isVk=false;
if (check(openload, url)) {
//Openload
run = true;
@@ -193,6 +200,9 @@ public void find(String url) {
} else if (check(rapidvideo, url)) {
//rapidvideo
run = true;
+ if (url.contains("/e/")){
+ url = url.replace("/e/","/v/");
+ }
} else if (check(gphoto, url)) {
//gphotos
run = true;
@@ -208,6 +218,12 @@ public void find(String url) {
//mediafire
run = true;
mfire = true;
+ } else if (check(okru,url)){
+ run = true;
+ isOkRu = true;
+ } else if (check(vk,url)){
+ run = true;
+ isVk = true;
}
if (run) {
@@ -219,6 +235,10 @@ public void find(String url) {
mfire(url);
} else if (oload) {
openload(url);
+ } else if (isOkRu) {
+ okru(url);
+ } else if (isVk){
+ vk(url);
} else {
webView.loadUrl(url);
}
@@ -368,6 +388,10 @@ public interface OnTaskCompleted {
void onFbTaskCompleted(String sd, String hd);
+ void onOkRuTaskCompleted(OkRuLinks okRuLinks);
+
+ void onVkTaskComplete(VkLinks vkLinks);
+
void onError();
}
@@ -457,6 +481,143 @@ public Map getHeaders() throws AuthFailureError {
}
}
+ public void okru(String url) {
+ init();
+ if (url != null) {
+ StringRequest request = new StringRequest(Request.Method.GET, url, new Response.Listener() {
+ private String getJson(String html){
+ final String regex = "data-options=\"(.*?)\"";
+ final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE);
+ final Matcher matcher = pattern.matcher(html);
+ if (matcher.find()) {
+ return matcher.group(1);
+ }
+ return null;
+ }
+
+ @Override
+ public void onResponse(String response) {
+ String json = getJson(response);
+ json = StringEscapeUtils.unescapeHtml4(json);
+ try {
+ json = new JSONObject(json).getJSONObject("flashvars").getString("metadata");
+ JSONArray jsonArray = new JSONObject(json).getJSONArray("videos");
+ OkRuLinks okRuLinks = new OkRuLinks();
+ for (int i=0;i getHeaders() throws AuthFailureError {
+ Map headers = new HashMap<>();
+ headers.put("User-agent", agent);
+ return headers;
+ }
+ };
+
+ Volley.newRequestQueue(context).add(request);
+ }
+ }
+
+ public void vk(String url) {
+ init();
+ if (url != null) {
+ StringRequest request = new StringRequest(Request.Method.GET, url, new Response.Listener() {
+
+ private String get(String regex,String html){
+ final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE);
+ final Matcher matcher = pattern.matcher(html);
+ if (matcher.find()) {
+ return matcher.group(1);
+ }
+ return null;
+ }
+
+ @Override
+ public void onResponse(String response) {
+ String json = get("al_video.php', ?(\\{.*])",response);
+ json = get("\\}, ?(.*)",json);
+
+ try {
+ VkLinks vkLinks = new VkLinks();
+ String x240="url240",x360="url360",x480="url480",x720="url720",x1080="url1080";
+ JSONObject object = new JSONArray(json).getJSONObject(4).getJSONObject("player").getJSONArray("params").getJSONObject(0);
+ if (object.has(x240)){
+ vkLinks.setUrl240(object.getString(x240));
+ }
+
+ if (object.has(x360)){
+ vkLinks.setUrl360(object.getString(x360));
+ }
+
+ if (object.has(x480)){
+ vkLinks.setUrl480(object.getString(x480));
+ }
+
+ if (object.has(x720)){
+ vkLinks.setUrl720(object.getString(x720));
+ }
+
+ if (object.has(x1080)){
+ vkLinks.setUrl1080(object.getString(x1080));
+ }
+
+ onComplete.onVkTaskComplete(vkLinks);
+ } catch (JSONException e) {
+ e.printStackTrace();
+ onComplete.onError();
+ }
+ }
+ }, new Response.ErrorListener() {
+ @Override
+ public void onErrorResponse(VolleyError error) {
+ onComplete.onError();
+ }
+ }) {
+
+ @Override
+ public Map getHeaders() throws AuthFailureError {
+ Map headers = new HashMap<>();
+ headers.put("User-agent", agent);
+ return headers;
+ }
+ };
+
+ Volley.newRequestQueue(context).add(request);
+ }
+ }
private String getLongEncrypt(String string) {
final String regex = "]*>([^<]*)<\\/p>";