Skip to content

Commit

Permalink
Merge pull request #2713 from mauriciocolli/compatibility-extractor
Browse files Browse the repository at this point in the history
Use new Localization and Downloader implementations from extractor
  • Loading branch information
TobiGr committed Nov 18, 2019
2 parents 577bfab + b125ff7 commit a8e326c
Show file tree
Hide file tree
Showing 22 changed files with 363 additions and 402 deletions.
3 changes: 2 additions & 1 deletion app/build.gradle
Expand Up @@ -62,7 +62,7 @@ dependencies {
exclude module: 'support-annotations'
})

implementation 'com.github.teamnewpipe:NewPipeExtractor:v0.17.4'
implementation 'com.github.TeamNewPipe:NewPipeExtractor:5c420340ceb39'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.23.0'

Expand Down Expand Up @@ -94,6 +94,7 @@ dependencies {
implementation 'io.reactivex.rxjava2:rxjava:2.2.2'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1'
implementation 'org.ocpsoft.prettytime:prettytime:4.0.1.Final'

implementation "androidx.room:room-runtime:${roomDbLibVersion}"
implementation "androidx.room:room-rxjava2:${roomDbLibVersion}"
Expand Down
3 changes: 3 additions & 0 deletions app/proguard-rules.pro
Expand Up @@ -17,6 +17,9 @@
#}

-dontobfuscate
-keep class org.schabi.newpipe.extractor.timeago.patterns.** { *; }
-keep class org.ocpsoft.prettytime.i18n.** { *; }

-keep class org.mozilla.javascript.** { *; }

-keep class org.mozilla.classfile.ClassFileWriter
Expand Down
4 changes: 2 additions & 2 deletions app/src/debug/java/org/schabi/newpipe/DebugApp.java
Expand Up @@ -15,7 +15,7 @@
import com.squareup.leakcanary.LeakDirectoryProvider;
import com.squareup.leakcanary.RefWatcher;

import org.schabi.newpipe.extractor.Downloader;
import org.schabi.newpipe.extractor.downloader.Downloader;

import java.io.File;
import java.util.concurrent.TimeUnit;
Expand All @@ -39,7 +39,7 @@ public void onCreate() {

@Override
protected Downloader getDownloader() {
return org.schabi.newpipe.Downloader.init(new OkHttpClient.Builder()
return DownloaderImpl.init(new OkHttpClient.Builder()
.addNetworkInterceptor(new StethoInterceptor()));
}

Expand Down
10 changes: 7 additions & 3 deletions app/src/main/java/org/schabi/newpipe/App.java
Expand Up @@ -21,13 +21,14 @@
import org.acra.config.ACRAConfigurationException;
import org.acra.config.ConfigurationBuilder;
import org.acra.sender.ReportSenderFactory;
import org.schabi.newpipe.extractor.Downloader;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.downloader.Downloader;
import org.schabi.newpipe.report.AcraReportSenderFactory;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.report.UserAction;
import org.schabi.newpipe.settings.SettingsActivity;
import org.schabi.newpipe.util.ExtractorHelper;
import org.schabi.newpipe.util.Localization;
import org.schabi.newpipe.util.StateSaver;

import java.io.IOException;
Expand Down Expand Up @@ -95,7 +96,10 @@ public void onCreate() {
SettingsActivity.initSettings(this);

NewPipe.init(getDownloader(),
org.schabi.newpipe.util.Localization.getPreferredExtractorLocal(this));
Localization.getPreferredLocalization(this),
Localization.getPreferredContentCountry(this));
Localization.init();

StateSaver.init(this);
initNotificationChannel();

Expand All @@ -109,7 +113,7 @@ public void onCreate() {
}

protected Downloader getDownloader() {
return org.schabi.newpipe.Downloader.init(null);
return DownloaderImpl.init(null);
}

private void configureRxJavaErrorHandler() {
Expand Down
296 changes: 0 additions & 296 deletions app/src/main/java/org/schabi/newpipe/Downloader.java

This file was deleted.

0 comments on commit a8e326c

Please sign in to comment.