Skip to content

Commit

Permalink
extractor 21.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Isayso committed Aug 3, 2021
1 parent a723979 commit 9b7c284
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 100 deletions.
183 changes: 93 additions & 90 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ android {
compileSdkVersion 30
buildToolsVersion '30.0.3'


defaultConfig {
applicationId "org.schabi.newpipe"
resValue "string", "app_name", "NewPipe"
minSdkVersion 19
targetSdkVersion 30
versionCode 972
versionCode 974
versionName "19.9.13 Isayso Fork"
multiDexEnabled true //Isayso

multiDexEnabled true

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true

Expand All @@ -29,7 +30,6 @@ android {

buildTypes {
debug {
multiDexEnabled true
debuggable true

// suffix the app id and the app name with git branch name
Expand All @@ -48,6 +48,7 @@ android {

// Keep the release build type at the end of the list to override 'archivesBaseName' of
// debug build. This seems to be a Gradle bug, therefore
// TODO: update Gradle version
release {
minifyEnabled true
shrinkResources false // disabled to fix F-Droid's reproducible build
Expand All @@ -61,16 +62,24 @@ android {
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
// suppress false warning ("Resource IDs will be non-final in Android Gradle Plugin version
// 5.0, avoid using them in switch case statements"), which affects only library projects
disable 'NonConstantResourceId'
}

compileOptions {
// Flag to enable support for the new language APIs
// >23 Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled false

sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
encoding 'utf-8'
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}

// Required and used only by groupie
androidExtensions {
experimental = true
Expand All @@ -79,53 +88,33 @@ android {
sourceSets {
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
}

buildFeatures {
viewBinding true
}

}

/*ext {
icepickVersion = '3.2.0'
ext {
checkstyleVersion = '8.32'
stethoVersion = '1.5.1'
leakCanaryVersion = '2.2'
exoPlayerVersion = '2.11.6'
androidxLifecycleVersion = '2.2.0'
androidxRoomVersion = '2.2.5'
groupieVersion = '2.8.0'
markwonVersion = '4.3.1'
checkstyleVersion = '8.38'

androidxLifecycleVersion = '2.2.0'
androidxRoomVersion = '2.3.0'
androidxLifecycleVersion = '2.2.0' //Isayso do not change
androidxRoomVersion = '2.2.5'

icepickVersion = '3.2.0'
exoPlayerVersion = '2.12.3'
exoPlayerVersion = '2.11.6' //Isayso do not change
googleAutoServiceVersion = '1.0-rc7'
groupieVersion = '2.8.1'
markwonVersion = '4.6.0'
groupieVersion = '2.8.0'
markwonVersion = '4.3.1'

leakCanaryVersion = '2.5'
leakCanaryVersion = '2.2'
stethoVersion = '1.5.1'
mockitoVersion = '3.6.0'
}*/

ext {
icepickVersion = '3.2.0'
checkstyleVersion = '8.38'
stethoVersion = '1.5.1'
leakCanaryVersion = '2.2'
exoPlayerVersion = '2.11.8' //do not change
androidxLifecycleVersion = '2.2.0' //do not change
androidxRoomVersion = '2.3.0'
groupieVersion = '2.8.0'
markwonVersion = '4.3.1'
googleAutoServiceVersion = '1.0-rc7'
}

configurations {
checkstyle
//ktlint
ktlint
}

checkstyle {
Expand Down Expand Up @@ -153,100 +142,120 @@ task runCheckstyle(type: Checkstyle) {
}
}

//task runKtlint(type: JavaExec) {
// main = "com.pinterest.ktlint.Main"
// classpath = configurations.ktlint
// args "src/**/*.kt"
//}
def outputDir = "${project.buildDir}/reports/ktlint/"
def inputFiles = project.fileTree(dir: "src", include: "**/*.kt")

task runKtlint(type: JavaExec) {
inputs.files(inputFiles)
outputs.dir(outputDir)
main = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "src/**/*.kt"
}

//task formatKtlint(type: JavaExec) {
// main = "com.pinterest.ktlint.Main"
// classpath = configurations.ktlint
// args "-F", "src/**/*.kt"
//}
task formatKtlint(type: JavaExec) {
inputs.files(inputFiles)
outputs.dir(outputDir)
main = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "-F", "src/**/*.kt"
}

afterEvaluate {
preDebugBuild.dependsOn runCheckstyle //, runKtlint
preDebugBuild.dependsOn runCheckstyle, runKtlint
}

dependencies {
// coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.1'
/** Desugaring **/
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'

//Isayso false warning:
//implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.10"
//V959
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}"
/** NewPipe libraries **/
// You can use a local version by uncommenting a few lines in settings.gradle
// Or you can use a commit you pushed to GitHub by just replacing TeamNewPipe with your GitHub
// name and the commit hash with the commit hash of the (pushed) commit you want to test
// This works thanks to JitPack: https://jitpack.io/
implementation 'com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751'
implementation 'com.github.TeamNewPipe:NewPipeExtractor:v0.21.8'


/** Third-party libraries **/
// Instance state boilerplate elimination
implementation "frankiesardo:icepick:${icepickVersion}"
kapt "frankiesardo:icepick-processor:${icepickVersion}"

checkstyle 'com.puppycrawl.tools:checkstyle:8.38'
// ktlint 'com.pinterest:ktlint:0.39.0'
/** Checkstyle **/
checkstyle "com.puppycrawl.tools:checkstyle:${checkstyleVersion}"
ktlint "com.pinterest:ktlint:0.35.0"

/** Kotlin **/
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"



debugImplementation "com.facebook.stetho:stetho:${stethoVersion}"
debugImplementation "com.facebook.stetho:stetho-okhttp3:${stethoVersion}"

debugImplementation "com.squareup.leakcanary:leakcanary-android:${leakCanaryVersion}"
implementation "com.squareup.leakcanary:leakcanary-object-watcher-android:2.5"
implementation "com.squareup.leakcanary:leakcanary-object-watcher-android:${leakCanaryVersion}"

debugImplementation "androidx.multidex:multidex:2.0.1"

testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:3.6.0'

androidTestImplementation "androidx.test.ext:junit:1.1.3"
/** AndroidX **/
implementation "androidx.appcompat:appcompat:1.1.0"
implementation "androidx.preference:preference:1.1.1"
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation "androidx.cardview:cardview:1.0.0"
implementation "androidx.constraintlayout:constraintlayout:1.1.3"

implementation "androidx.lifecycle:lifecycle-livedata:${androidxLifecycleVersion}"
implementation "androidx.lifecycle:lifecycle-viewmodel:${androidxLifecycleVersion}"
implementation "androidx.lifecycle:lifecycle-extensions:${androidxLifecycleVersion}"

implementation "androidx.room:room-runtime:${androidxRoomVersion}"
implementation "androidx.room:room-rxjava2:${androidxRoomVersion}"
kapt "androidx.room:room-compiler:${androidxRoomVersion}"

/** Testing **/
testImplementation 'junit:junit:4.13'
testImplementation 'org.mockito:mockito-core:3.3.3'

androidTestImplementation "androidx.test.ext:junit:1.1.1"
androidTestImplementation "androidx.room:room-testing:${androidxRoomVersion}"
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0', {
androidTestImplementation "androidx.test.espresso:espresso-core:3.2.0", {
exclude module: 'support-annotations'
}

implementation 'com.github.TeamNewPipe:NewPipeExtractor:v0.21.6'

implementation "com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751"

// HTML parser
implementation "org.jsoup:jsoup:1.13.1"

implementation 'com.squareup.okhttp3:okhttp:4.9.0'
implementation "com.squareup.okhttp3:okhttp:3.12.11"

// Media player
implementation "com.google.android.exoplayer:exoplayer:${exoPlayerVersion}"
implementation "com.google.android.exoplayer:extension-mediasession:${exoPlayerVersion}"

implementation "com.google.android.material:material:1.4.0"

implementation 'androidx.appcompat:appcompat:1.3.1'
implementation "androidx.preference:preference-ktx:1.1.1"
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation "androidx.cardview:cardview:1.0.0"
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'

implementation "androidx.lifecycle:lifecycle-livedata-ktx:${androidxLifecycleVersion}"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${androidxLifecycleVersion}"
implementation "androidx.lifecycle:lifecycle-extensions:${androidxLifecycleVersion}"

implementation "androidx.room:room-runtime:${androidxRoomVersion}"
implementation "androidx.room:room-rxjava2:${androidxRoomVersion}"
kapt "androidx.room:room-compiler:${androidxRoomVersion}"
implementation "com.google.android.material:material:1.1.0"

implementation "com.xwray:groupie:${groupieVersion}"
implementation "com.xwray:groupie-kotlin-android-extensions:${groupieVersion}"

implementation "de.hdodenhof:circleimageview:3.1.0"
implementation "com.nostra13.universalimageloader:universal-image-loader:1.9.5"

implementation "io.noties.markwon:core:4.6.0"
implementation "io.noties.markwon:linkify:4.6.0"
implementation "io.noties.markwon:core:${markwonVersion}"
implementation "io.noties.markwon:linkify:${markwonVersion}"

implementation "com.nononsenseapps:filepicker:4.2.1"

implementation "ch.acra:acra-core:5.7.0"
implementation "ch.acra:acra-core:5.5.0"

implementation "io.reactivex.rxjava2:rxjava:2.2.19"
implementation "io.reactivex.rxjava2:rxandroid:2.1.1"
implementation "com.jakewharton.rxbinding2:rxbinding:2.2.0"

implementation "org.ocpsoft.prettytime:prettytime:5.0.1.Final"
implementation "org.ocpsoft.prettytime:prettytime:4.0.5.Final"
}

static String getGitWorkingBranch() {
Expand All @@ -264,9 +273,3 @@ static String getGitWorkingBranch() {
return ""
}
}

allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,9 @@ public void showSnackBarError(final Throwable exception, final UserAction userAc
public void showSnackBarError(final List<Throwable> exception, final UserAction userAction,
final String serviceName, final String request,
@StringRes final int errorId) {
return; //Isayso
/* if (DEBUG) {
return; //Isayso
/*
if (DEBUG) {
Log.d(TAG, "showSnackBarError() called with: "
+ "exception = [" + exception + "], userAction = [" + userAction + "], "
+ "request = [" + request + "], errorId = [" + errorId + "]");
Expand All @@ -292,6 +293,7 @@ public void showSnackBarError(final List<Throwable> exception, final UserAction
}
ErrorActivity.reportError(getContext(), exception, MainActivity.class, rootView,
ErrorActivity.ErrorInfo.make(userAction, serviceName, request, errorId));*/
ErrorActivity.ErrorInfo.make(userAction, serviceName, request, errorId));
*/
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,9 @@ public void handleResult(@NonNull final StreamInfo info) {
relatedStreamsLayout.setVisibility(View.VISIBLE);
}
}

//pushToStack(serviceId, url, name);

animateView(thumbnailPlayButton, true, 200);
videoTitleTextView.setText(name);

Expand Down Expand Up @@ -1361,7 +1364,7 @@ protected boolean onError(final Throwable exception) {
return true;
}

//Isayso
//Isayso int errorId = exception instanceof YoutubeStreamExtractor.DecryptException
int errorId = exception instanceof YoutubeStreamExtractor.DeobfuscateException
? R.string.youtube_signature_decryption_error
: exception instanceof ExtractionException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ public MediaSource resolve(@NonNull final StreamInfo info) {
final Format textFormat = Format.createTextSampleFormat(null, mimeType,
SELECTION_FLAG_AUTOSELECT,
PlayerHelper.captionLanguageOf(context, subtitle));
//MB
//Isayso final MediaSource textSource = dataSource.getSampleMediaSourceFactory()
// .createMediaSource(Uri.parse(subtitle.getURL()), textFormat, TIME_UNSET);
final MediaSource textSource = dataSource.getSampleMediaSourceFactory()
.createMediaSource(Uri.parse(subtitle.getUrl()), textFormat, TIME_UNSET);
mediaSources.add(textSource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ public static void handleGeneralException(final Context context, final int servi
final String optionalErrorMessage) {
final Handler handler = new Handler(context.getMainLooper());

//Isayso
handler.post(() -> {
if (exception instanceof ReCaptchaException) {
Toast.makeText(context, R.string.recaptcha_request_toast, Toast.LENGTH_LONG).show();
Expand All @@ -294,6 +293,7 @@ public static void handleGeneralException(final Context context, final int servi
} else if (exception instanceof ContentNotSupportedException) {
Toast.makeText(context, R.string.content_not_supported, Toast.LENGTH_LONG).show();
} else {
//Isayso int errorId = exception instanceof YoutubeStreamExtractor.DecryptException
int errorId = exception instanceof YoutubeStreamExtractor.DeobfuscateException
? R.string.youtube_signature_decryption_error
: exception instanceof ParsingException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ private void resolveStream() throws IOException, ExtractionException, HttpError
}
}
break;
case 's': //MB
case 's':
for (SubtitlesStream subtitles : mExtractor.getSubtitles(mRecovery.format)) {
String tag = subtitles.getLanguageTag();
if (tag.equals(mRecovery.desired) && subtitles.isAutoGenerated() == mRecovery.desired2) {
url = subtitles.getUrl();
url = subtitles.getUrl(); //Isayso
break;
}
}
Expand Down
5 changes: 4 additions & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@
<module name="AvoidStarImport"/>
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<module name="UnusedImports">
<property name="severity" value="warning"/>
</module>


<!-- Checks for Size Violations. -->
<!-- See https://checkstyle.org/config_sizes.html -->
Expand Down
Loading

0 comments on commit 9b7c284

Please sign in to comment.