Skip to content

Commit

Permalink
Fix build due to jcentre shutdown, use forked versions of ExoPlayer a…
Browse files Browse the repository at this point in the history
…nd groupie library

2. update extractor to fix comments not showing
3. update youtube regex in extractor to fetch webm audio streams
4. remember playback adjustment step size
5. fix: the best audio track should always be selected when downloading video (YouTube)

Co-Authored-By: ktprograms <[email protected]>
Co-Authored-By: InfinityLoop1308 <[email protected]>
  • Loading branch information
3 people committed Nov 10, 2024
1 parent 8c998d1 commit ef87bad
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 24 deletions.
34 changes: 22 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
minSdkVersion 19
//noinspection ExpiredTargetSdkVersion
targetSdkVersion 29
versionCode 980
versionName "0.19.9.6"
versionCode 981
versionName "0.19.9.7"

multiDexEnabled true

Expand Down Expand Up @@ -50,12 +50,17 @@ android {
// debug build. This seems to be a Gradle bug, therefore
// TODO: update Gradle version
release {
if (System.properties.containsKey('packageSuffix')) {
applicationIdSuffix System.getProperty('packageSuffix')
resValue "string", "app_name", "NewPipe " + System.getProperty('packageSuffix')
archivesBaseName = 'NewPipe_' + System.getProperty('packageSuffix')
}
applicationIdSuffix "Zing"
resValue "string", "app_name", "NewPipe " + "Zing"
archivesBaseName = 'app'
minifyEnabled true
shrinkResources true // could be disabled to fix F-Droid's reproducible build
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
archivesBaseName = 'app'
applicationIdSuffix ".Zing"
resValue "string", "app_name", "NewPipe " + "Zing"
}
}

Expand Down Expand Up @@ -96,10 +101,10 @@ ext {
icepickVersion = '3.2.0'
stethoVersion = '1.5.1'
leakCanaryVersion = '2.5'
exoPlayerVersion = '2.11.8'
exoPlayerVersion = 'r2.11.8'
androidxLifecycleVersion = '2.2.0'
androidxRoomVersion = '2.2.5'
groupieVersion = '2.8.1'
groupieVersion = '2.9.1'
markwonVersion = '4.6.0'
googleAutoServiceVersion = '1.0-rc7'
}
Expand Down Expand Up @@ -167,7 +172,8 @@ dependencies {
// 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.ShareASmile:NewPipeExtractor:8787d1879dc7f1f8a2145f282ef16ee1103bbe7e'
//implementation 'com.github.ShareASmile.NewPipeExtractor:NewPipeExtractor:v0.22.7.3'
implementation 'com.github.ShareASmile:NewPipeExtractor:c6ffd3764c53b34d38961ed7f9a09d274dd9c5a0'

/** Third-party libraries **/
// Instance state boilerplate elimination
Expand All @@ -182,16 +188,20 @@ dependencies {
implementation "com.squareup.okhttp3:okhttp:3.12.13"

// Media player
implementation "com.google.android.exoplayer:exoplayer:${exoPlayerVersion}"
implementation "com.google.android.exoplayer:extension-mediasession:${exoPlayerVersion}"
implementation "com.github.ShareASmile.ExoPlayer:library-core:${exoPlayerVersion}"
implementation "com.github.ShareASmile.ExoPlayer:library-dash:${exoPlayerVersion}"
implementation "com.github.ShareASmile.ExoPlayer:library-hls:${exoPlayerVersion}"
implementation "com.github.ShareASmile.ExoPlayer:library-smoothstreaming:${exoPlayerVersion}"
implementation "com.github.ShareASmile.ExoPlayer:library-ui:${exoPlayerVersion}"
implementation "com.github.ShareASmile.ExoPlayer:extension-mediasession:${exoPlayerVersion}"

// Metadata generator for service descriptors
compileOnly "com.google.auto.service:auto-service-annotations:${googleAutoServiceVersion}"
kapt "com.google.auto.service:auto-service:${googleAutoServiceVersion}"

// Manager for complex RecyclerView layouts
implementation "com.xwray:groupie:${groupieVersion}"
implementation "com.xwray:groupie-kotlin-android-extensions:${groupieVersion}"
implementation "com.github.ShareASmile.groupie:groupie:${groupieVersion}"
implementation "com.github.ShareASmile.groupie:groupie-kotlin-android-extensions:${groupieVersion}"

// Circular ImageView
implementation "de.hdodenhof:circleimageview:3.1.0"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public class PlaybackParameterDialog extends DialogFragment {
private boolean initialSkipSilence = DEFAULT_SKIP_SILENCE;
private double tempo = DEFAULT_TEMPO;
private double pitch = DEFAULT_PITCH;
private double stepSize = DEFAULT_STEP;

@Nullable
private SeekBar tempoSlider;
Expand Down Expand Up @@ -127,7 +126,6 @@ public void onCreate(@Nullable final Bundle savedInstanceState) {

tempo = savedInstanceState.getDouble(TEMPO_KEY, DEFAULT_TEMPO);
pitch = savedInstanceState.getDouble(PITCH_KEY, DEFAULT_PITCH);
stepSize = savedInstanceState.getDouble(STEP_SIZE_KEY, DEFAULT_STEP);
}
}

Expand All @@ -139,7 +137,6 @@ public void onSaveInstanceState(final Bundle outState) {

outState.putDouble(TEMPO_KEY, getCurrentTempo());
outState.putDouble(PITCH_KEY, getCurrentPitch());
outState.putDouble(STEP_SIZE_KEY, getCurrentStepSize());
}

/*//////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -177,7 +174,6 @@ private void setupControlViews(@NonNull final View rootView) {
setupTempoControl(rootView);
setupPitchControl(rootView);

setStepSize(stepSize);
setupStepSizeSelector(rootView);
}

Expand Down Expand Up @@ -265,6 +261,10 @@ private void setupSkipSilenceControl(@NonNull final View rootView) {
}

private void setupStepSizeSelector(@NonNull final View rootView) {
setStepSize(PreferenceManager
.getDefaultSharedPreferences(requireContext())
.getFloat(getString(R.string.adjustment_step_key), (float) DEFAULT_STEP));

TextView stepSizeOnePercentText = rootView.findViewById(R.id.stepSizeOnePercent);
TextView stepSizeFivePercentText = rootView.findViewById(R.id.stepSizeFivePercent);
TextView stepSizeTenPercentText = rootView.findViewById(R.id.stepSizeTenPercent);
Expand Down Expand Up @@ -307,7 +307,10 @@ private void setupStepSizeSelector(@NonNull final View rootView) {
}

private void setStepSize(final double stepSize) {
this.stepSize = stepSize;
PreferenceManager.getDefaultSharedPreferences(requireContext())
.edit()
.putFloat(getString(R.string.adjustment_step_key), (float) stepSize)
.apply();

if (tempoStepUpText != null) {
tempoStepUpText.setText(getStepUpPercentString(stepSize));
Expand Down Expand Up @@ -466,10 +469,6 @@ private double getCurrentPitch() {
return pitchSlider == null ? pitch : strategy.valueOf(pitchSlider.getProgress());
}

private double getCurrentStepSize() {
return stepSize;
}

private boolean getCurrentSkipSilence() {
return skipSilenceCheckbox != null && skipSilenceCheckbox.isChecked();
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/settings_keys.xml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
<string name="main_page_content_key" translatable="false">main_page_content</string>
<string name="enable_playback_resume_key" translatable="false">enable_playback_resume</string>
<string name="enable_playback_state_lists_key" translatable="false">enable_playback_state_lists</string>
<string name="adjustment_step_key">adjustment_step_key</string>
<string name="playback_unhook_key" translatable="false">playback_unhook_key</string>
<string name="playback_speed_key" translatable="false">playback_speed_key</string>
<string name="playback_pitch_key" translatable="false">playback_pitch_key</string>
Expand Down
2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ buildscript {
ext.kotlin_version = '1.4.10'
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
Expand All @@ -18,7 +17,6 @@ buildscript {

allprojects {
repositories {
jcenter()
google()
mavenCentral()
maven { url "https://jitpack.io" }
Expand Down

0 comments on commit ef87bad

Please sign in to comment.