Commit Graph

187 Commits

Author SHA1 Message Date
Isira Seneviratne 3dc1adb69e Add helper methods for adding PendingIntent mutability. 2022-11-07 17:12:22 +05:30
Isira Seneviratne 697b8411df Use Okio's ByteString. 2022-08-13 08:27:55 +05:30
litetex 99104fc11d
Clean up pre-Lollipop checks 2022-07-13 19:02:24 +02:00
AudricV 210834fbe9
Add support of other delivery methods than progressive HTTP (in the player only)
Detailed changes:

- External players:

  - Add a message instruction about stream selection;
  - Add a message when there is no stream available for external players;
  - Return now HLS, DASH and SmoothStreaming URL contents, in addition to progressive HTTP ones.

- Player:

  - Support DASH, HLS and SmoothStreaming streams for videos, whether they are content URLs or the manifests themselves, in addition to progressive HTTP ones;
  - Use a custom HttpDataSource to play YouTube contents, based of ExoPlayer's default one, which allows better spoofing of official clients (custom user-agent and headers (depending of the client used), use of range and rn (set dynamically by the DataSource) parameters);
  - Fetch YouTube progressive contents as DASH streams, like official clients, support fully playback of livestreams which have ended recently and OTF streams;
  - Use ExoPlayer's default retries count for contents on non-fatal errors (instead of Integer.MAX_VALUE for non-live contents and 5 for live contents).

- Download dialog:

  - Add message about support of progressive HTTP streams only for downloading;
  - Remove several duplicated code and update relevant usages;
  - Support downloading of contents with an unknown media format.

- ListHelper:

  - Catch NumberFormatException when trying to compare two video streams between them.

- Tests:

  - Update ListHelperTest and StreamItemAdapterTest to fix breaking changes in the extractor.

- Other places:

  - Fixes deprecation of changes made in the extractor;
  - Improve some code related to the files changed.

- Issues fixed and/or improved with the changes:

  - Seeking of PeerTube HLS streams (the duration shown was the one from the stream duration and not the one parsed, incomplete because HLS streams are fragmented MP4s with multiple sidx boxes, for which seeking is not supported by ExoPlayer) (the app now uses the HLS manifest returned for each quality, in the master playlist (not fetched and computed by the extractor));
  - Crash when loading PeerTube streams with a separated audio;
  - Lack of some streams on some YouTube videos (OTF streams);
  - Loading times of YouTube streams, after a quality change or a playback start;
  - View count of YouTube ended livestreams interpreted as watching count (this type of streams is not interpreted anymore as livestreams);
  - Watchable time of YouTube ended livestreams;
  - Playback of SoundCloud HLS-only tracks (which cannot be downloaded anymore because the workaround which was used is being removed by SoundCloud, so it has been removed from the extractor).
2022-06-17 22:00:22 +02:00
Isira Seneviratne 23c1fc3544 Remove unnecessary compat method calls. 2022-05-10 07:45:01 +05:30
litetex 102c05e927 FIx breaking changes 2022-03-26 21:21:07 +01:00
Spinhit 483dc06ecb
Add confirmation button before deleting all files.
Co-authored-by: TiA4f8R <74829229+TiA4f8R@users.noreply.github.com>
2022-03-02 11:31:52 +01:00
TobiGr 37b8a9375f Small improvements to code quality and readability
Add annotations to methods and parameters.
Replace Jetbrains' @NotNull with Androidx' @NonNull annotatiation.
Make class variables static if possible.
Use constants for some Strings.
Simplify if conditions.
2021-12-21 20:55:41 +01:00
litetex b21d231e3a
Merge pull request #7452 from litetex/show-alert-when-file-manager-not-found
Show an alert-dialog when no appropriate file-manager was found
2021-12-14 20:01:02 +01:00
Stypox 397f93b079
Prevent exception from being serialized in ErrorInfo
The wrong @Decorator was put in the wrong place to mark the throwable fieldd as transient, now this is fixed and the exception is not serialized. So if a non-serializable throwable is passed, that's not an issue, since it's not going to be serialized. The need for EnsureExceptionSerializable is also gone.
2021-12-04 10:36:36 +01:00
Stypox 81f740d409
Replace ErrorActivity with ErrorUtil 2021-12-04 10:36:36 +01:00
litetex b2323859e5 Refactoring + deduplicated code 2021-11-28 14:07:45 +01:00
litetex 68e7fcf8ee Fixed typos 2021-11-27 23:39:17 +01:00
litetex f78983b16b Show an alert/dialog when no appropriate file-manager was found 2021-11-27 15:52:54 +01:00
Stypox a555aab3e7
Merge pull request #7024 from Stypox/string-fixes
Never use ``android.R.string``s; remove unused ``add`` string
2021-08-31 12:00:07 +02:00
Tobi 0e6668636d
Merge pull request #6986 from litetex/fix-build-problems-update-kotlin
Fix build problems and updated kotlin
2021-08-30 21:20:45 +02:00
Stypox 039bd5d413
Rename string finish to ok, as its content was "OK" 2021-08-30 16:36:57 +02:00
Agnieszka C 43e91ae4ae
Added plural forms for download related strings (#6930)
Co-authored-by: Tobi <TobiGr@users.noreply.github.com>
2021-08-29 13:28:01 +02:00
litetex b061423847 Changed package as the old one is deprecated 2021-08-26 18:09:27 +02:00
Stypox 1822d21676
Fix NullPointerException when checking if storage exists 2021-07-27 11:36:14 +02:00
Stypox a9e21a35ea
Delete pending missions with invalid storage 2021-07-21 10:52:04 +02:00
TacoTheDank 02b0909829 Fix onActivityResult deprecation in MissionsFragment 2021-06-20 14:14:54 -04:00
TiA4f8R a79badd783
Adress requested changes and try some cleanup in handleUrl method of InternalUrlsHandler class 2021-06-11 12:12:06 +02:00
TiA4f8R d6decc05d7
Move some classes to a new subpackage and adress requested changes
Rename URLHandler and KoreUtil classes to InternalUrlsHandler and KoreUtils.
Move InternalUrlsHandler, KoreUtils, TextLinkfier, ShareUtils classes to external_communication subpackage.
Remove unused param showPreviewText in shareText method of ShareUtils class.
Add initial work to be able to display an image preview of the content shared (not for downloads).
Use a better regular expression to parse timestamps in plain text descriptions.
2021-06-11 12:12:02 +02:00
TiA4f8R d85afd6435
Initial work to add the image of the content in the share sheet
Also do some fixes when sharing a file in downloads and some improvements in JavaDocs of ShareUtils class.
2021-06-11 12:12:00 +02:00
TiA4f8R 9e9d1a04e4
Fix toast shown when falling back to Google Play Store URL and the action of Open with Kodi button in the player
Add a boolean param, showToast, in ShareUtils.openIntentInApp and only show toast "No app on your device can open this" if this boolean is true.
Fix the action of play with Kodi button by applying the fix provided in #5599 (adding the flag Intent.FLAG_ACTIVITY_NEW_TASK to the intent in NavigationHelper.playWithKore method).
Do also some cleanup in viewWithFileProvider and shareFile methods of MissionAdapter class.
2021-06-11 12:11:56 +02:00
Stypox 2a99e0e435
Reimplement storing backup import/export path
#6319 and #6402 were reverted before adding SAF changes, and have been readded at the end of SAF changes
2021-06-08 10:41:24 +02:00
Stypox 21b8df0375
Check if file really exists before asking user to overwrite it 2021-06-08 10:40:45 +02:00
Stypox 114dc8ffa0
Pass mime type so that SAF treats file extension correctly 2021-06-08 10:40:45 +02:00
wb9688 1164ea52f9
Move Stored(File|Directory)Helper into NewPipe 2021-06-08 10:40:44 +02:00
wb9688 0f75024e03
Support SAF properly 2021-06-08 10:40:44 +02:00
TobiGr f583dd47ac Annotate StoredFileHelper.createSAF() as NonNull 2021-06-05 16:34:22 +02:00
TobiGr abc354f516 Use reqireContext(), requireActivity() instead of getters 2021-06-05 16:13:12 +02:00
ix5 38ed07caa7 Downloader: Deleter: Dismiss previous Snackbars
Bug:
In Downloader view, while deleting items, Snackbars at the
bottom of the UI keep queuing up. You need to wait for all
of them to dismiss themselves for files to actually be
deleted. If you close NewPipe before all snackbars are
dismissed, your files will not be deleted and show up again
next time you start NewPipe.

Fix:
When running append(), trigger the commit() action
immediately and cancel all delayed callbacks for commit().

This prevents Snackbars from stacking up in reverse order.

Fixes: https://github.com/TeamNewPipe/NewPipe/issues/5660
2021-05-04 19:44:09 +02:00
TacoTheDank e75d0de135 Migrate rest of AlertDialogs to AppCompat 2021-04-04 10:26:38 -04:00
krlvm fd14c8cdce
Fix Dark elements in Light Theme 2021-03-27 17:46:05 +03:00
Stypox 463dd8ea74
Completely remove return activity, now outdated 2021-03-12 23:21:54 +01:00
Stypox c43bca6007
Add report/solve-recaptcha button in error panel
It will be shown even when nothing could be loaded not due to a network error, and the user can choose to ignore or report it.

Also improve error reporting arguments
Also completely refactor error activity
Also improve some code here and there
2021-03-12 23:21:49 +01:00
Stypox 553b80164b
Move all error-related classes into error package 2021-03-07 17:49:28 +01:00
TiA4f8R 79e98db3bd
Apply the requested changes and little improvements
Apply the requested changes, use ShareUtils.shareText to share an stream in the play queue and optimize imports for Java files, using Android Studio functionality.

Apply the requested changes and do little improvements
Apply the requested changes, use ShareUtils.shareText to share an stream in the play queue and optimize imports for Java files, using Android Studio functionality.
2021-01-16 13:23:42 +01:00
TiA4f8R a57fd69fb4
External sharing improvements
Improve NewPipe's share on some devices + fix crash when no browser is set on some devices

Catching ActivityNotFoundException when trying to open the default browser
Use an ACTION_CHOOSER intent and put as an extra intent the intent to
open an URI / share an URI when no default app is set.

Add a LinkHelper class which set a custom action when clicking web links
in the description of a content. This class also helps to implement a confirmation dialog when trying to open web links in an external app.
2021-01-16 13:23:06 +01:00
Isira Seneviratne 14a2171035 Use Objects.requireNonNull(). 2021-01-02 09:36:33 +05:30
Isira Seneviratne 0fe3fe7594 Use ServiceCompat.stopForeground(). 2020-12-19 16:52:17 +05:30
Isira Seneviratne 917f459569 Use a notification instead of a ProgressDialog in MissionAdapter. 2020-12-13 05:21:38 +05:30
Tobias Groza db9f20a22f
Merge pull request #4961 from TeamNewPipe/lint
Fix some Lint errors
2020-12-07 11:19:01 +01:00
Stypox b66047e084
Fix ktlint errors 2020-11-22 14:03:10 +01:00
Stypox f0ca916432
Update most dependencies 2020-11-22 14:03:10 +01:00
TobiGr 7a8dab2d58 Fix typos 2020-11-22 10:39:00 +01:00
TobiGr 6f3dfad550 Fix Lint: Inconsistent line separators 2020-11-22 10:16:27 +01:00
Isira Seneviratne 95333d37c8 Use try-with-resources. 2020-11-21 13:47:13 +05:30