diff --git a/.gitignore b/.gitignore
index 09cade508..62f840669 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@
/captures
.idea/gradle.xml
.idea/misc.xml
+/app/app.iml
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
deleted file mode 100644
index 1bbc21dc2..000000000
--- a/.idea/gradle.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 1a3eaffb4..000000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 6564d52db..94a25f7f4 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
index 6bcbd4f70..d9a86a57c 100644
--- a/app/.gitignore
+++ b/app/.gitignore
@@ -1,3 +1,3 @@
.gitignore
/build
-app/app.iml
+app.iml
diff --git a/app/app.iml b/app/app.iml
deleted file mode 100644
index eefc8deb7..000000000
--- a/app/app.iml
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- generateDebugAndroidTestSources
- generateDebugSources
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index 5e17108de..fb41271d9 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -8,8 +8,8 @@ android {
applicationId "org.schabi.newpipe"
minSdkVersion 15
targetSdkVersion 23
- versionCode 5
- versionName "0.5.0"
+ versionCode 6
+ versionName "0.6.0"
}
buildTypes {
release {
diff --git a/app/src/main/java/org/schabi/newpipe/ActionBarHandler.java b/app/src/main/java/org/schabi/newpipe/ActionBarHandler.java
index c46a617b6..b9bef5cfd 100644
--- a/app/src/main/java/org/schabi/newpipe/ActionBarHandler.java
+++ b/app/src/main/java/org/schabi/newpipe/ActionBarHandler.java
@@ -104,11 +104,9 @@ public class ActionBarHandler {
}
} else if(preferedFormat.equals("m4a")){
for(VideoInfo.AudioStream s : audioStreams) {
- Log.d(TAG, MediaFormat.getMimeById(s.format) + " : " + Integer.toString(s.bandwidth));
if(s.format == MediaFormat.M4A.id &&
(audioStream == null || audioStream.bandwidth > s.bandwidth)) {
audioStream = s;
- Log.d(TAG, "last choosen");
}
}
}
@@ -125,15 +123,8 @@ public class ActionBarHandler {
defaultPreferences = PreferenceManager.getDefaultSharedPreferences(activity);
inflater.inflate(R.menu.videoitem_detail, menu);
- MenuItem playItem = menu.findItem(R.id.menu_item_play);
- MenuItem shareItem = menu.findItem(R.id.menu_item_share);
MenuItem castItem = menu.findItem(R.id.action_play_with_kodi);
- MenuItemCompat.setShowAsAction(playItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS
- | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
- MenuItemCompat.setShowAsAction(shareItem, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM
- | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
-
castItem.setVisible(defaultPreferences
.getBoolean(activity.getString(R.string.showPlayWidthKodiPreference), false));
@@ -143,9 +134,6 @@ public class ActionBarHandler {
public boolean onItemSelected(MenuItem item) {
int id = item.getItemId();
switch(id) {
- case R.id.menu_item_play:
- playVideo();
- return true;
case R.id.menu_item_share:
if(!videoTitle.isEmpty()) {
Intent intent = new Intent();
@@ -235,7 +223,6 @@ public class ActionBarHandler {
}
public void downloadVideo() {
- Log.d(TAG, "bla");
if(!videoTitle.isEmpty()) {
String videoSuffix = "." + MediaFormat.getSuffixById(videoStreams[selectedStream].format);
String audioSuffix = "." + MediaFormat.getSuffixById(audioStream.format);
@@ -321,7 +308,7 @@ public class ActionBarHandler {
}
});
builder.create().show();
- Log.d(TAG, "Either no Streaming player for audio was installed, or something important crashed:");
+ Log.e(TAG, "Either no Streaming player for audio was installed, or something important crashed:");
e.printStackTrace();
}
}
diff --git a/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java b/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java
index 81a8aec33..d05f721a2 100644
--- a/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java
+++ b/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java
@@ -253,10 +253,9 @@ public class PlayVideoActivity extends AppCompatActivity {
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
- } else {
- getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
- WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
+ getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
+ WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
private void adjustMediaControlMetrics() {
diff --git a/app/src/main/java/org/schabi/newpipe/youtube/YoutubeExtractor.java b/app/src/main/java/org/schabi/newpipe/youtube/YoutubeExtractor.java
index 2b7fbf8e4..d6b4bb835 100644
--- a/app/src/main/java/org/schabi/newpipe/youtube/YoutubeExtractor.java
+++ b/app/src/main/java/org/schabi/newpipe/youtube/YoutubeExtractor.java
@@ -289,7 +289,8 @@ public class YoutubeExtractor implements Extractor {
.text();
// Extracting the date itself from header
- videoInfo.upload_date = matchGroup1("([A-Za-z]{3}\\s[\\d]{1,2},\\s[\\d]{4}$)", videoInfo.upload_date);
+ videoInfo.upload_date =
+ matchGroup1("([0-9]{2}\\.[0-9]{2}\\.[0-9]{4})", videoInfo.upload_date);
// description
videoInfo.description = doc.select("p[id=\"eow-description\"]").first()
@@ -459,12 +460,13 @@ public class YoutubeExtractor implements Extractor {
try {
decryptionFuncName = matchGroup1("\\.sig\\|\\|([a-zA-Z0-9$]+)\\(", playerCode);
- String functionPattern = "(function " + decryptionFuncName.replace("$", "\\$") + "\\([a-zA-Z0-9_]*\\)\\{.+?\\})";
+ String functionPattern = "(var "+ decryptionFuncName.replace("$", "\\$") +"=function\\([a-zA-Z0-9_]*\\)\\{.+?\\})";
decryptionFunc = matchGroup1(functionPattern, playerCode);
+ decryptionFunc += ";";
helperObjectName = matchGroup1(";([A-Za-z0-9_\\$]{2})\\...\\(", decryptionFunc);
- String helperPattern = "(var " + helperObjectName.replace("$", "\\$") + "=\\{.+?\\}\\};)function";
+ String helperPattern = "(var " + helperObjectName.replace("$", "\\$") + "=\\{.+?\\}\\};)";
helperObject = matchGroup1(helperPattern, playerCode);
} catch (Exception e) {
@@ -477,13 +479,13 @@ public class YoutubeExtractor implements Extractor {
return decryptionCode;
}
- private String decryptSignature(String encryptedSig, String decryptoinCode) {
+ private String decryptSignature(String encryptedSig, String decryptionCode) {
Context context = Context.enter();
context.setOptimizationLevel(-1);
Object result = null;
try {
ScriptableObject scope = context.initStandardObjects();
- context.evaluateString(scope, decryptoinCode, "decryptionCode", 1, null);
+ context.evaluateString(scope, decryptionCode, "decryptionCode", 1, null);
Function decryptionFunc = (Function) scope.get("decrypt", scope);
result = decryptionFunc.call(context, scope, scope, new Object[]{encryptedSig});
} catch (Exception e) {
@@ -501,7 +503,7 @@ public class YoutubeExtractor implements Extractor {
return mat.group(1);
}
else {
- Log.e(TAG, "failed to find pattern \""+pattern+"\"");
+ Log.e(TAG, "failed to find pattern \""+pattern+"\"inside of \""+input+"\"");
new Exception("failed to find pattern \""+pattern+"\"").printStackTrace();
return "";
}
diff --git a/app/src/main/java/org/schabi/newpipe/youtube/YoutubeSearchEngine.java b/app/src/main/java/org/schabi/newpipe/youtube/YoutubeSearchEngine.java
index 7d9631ac2..18bbf4337 100644
--- a/app/src/main/java/org/schabi/newpipe/youtube/YoutubeSearchEngine.java
+++ b/app/src/main/java/org/schabi/newpipe/youtube/YoutubeSearchEngine.java
@@ -64,7 +64,6 @@ public class YoutubeSearchEngine implements SearchEngine {
//if we've been passed a valid language code, append it to the URL
if(languageCode.length() > 0) {
//assert Pattern.matches("[a-z]{2}(-([A-Z]{2}|[0-9]{1,3}))?", languageCode);
- Log.i(TAG, "URI: \""+builder+"\"");
site = Downloader.download(url, languageCode);
}
else {
diff --git a/app/src/main/res/drawable/ic_file_download_black.png b/app/src/main/res/drawable/ic_file_download_black.png
new file mode 100644
index 000000000..8c83bffa7
Binary files /dev/null and b/app/src/main/res/drawable/ic_file_download_black.png differ
diff --git a/app/src/main/res/layout/fragment_videoitem_detail.xml b/app/src/main/res/layout/fragment_videoitem_detail.xml
index 22fc077d8..698883608 100644
--- a/app/src/main/res/layout/fragment_videoitem_detail.xml
+++ b/app/src/main/res/layout/fragment_videoitem_detail.xml
@@ -214,7 +214,7 @@