Commit graph

187 commits

Author SHA1 Message Date
Isira Seneviratne
0ca88d029e Add helper methods for adding PendingIntent mutability. 2022-11-07 17:12:22 +05:30
Isira Seneviratne
38aaa7163b Use Okio's ByteString. 2022-08-13 08:27:55 +05:30
litetex
4a4ca3c18e Clean up pre-Lollipop checks 2022-07-13 19:02:24 +02:00
AudricV
f7d2975ad1 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
37fdd548c9 Remove unnecessary compat method calls. 2022-05-10 07:45:01 +05:30
litetex
670b3de057 FIx breaking changes 2022-03-26 21:21:07 +01:00
Spinhit
c515fd1da0 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
778f57b422 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
3ecaf66e1a 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
9ac1add14c 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
5583f71a8e Replace ErrorActivity with ErrorUtil 2021-12-04 10:36:36 +01:00
litetex
625ffba8b7 Refactoring + deduplicated code 2021-11-28 14:07:45 +01:00
litetex
273e0e7f06 Fixed typos 2021-11-27 23:39:17 +01:00
litetex
9285958b4f Show an alert/dialog when no appropriate file-manager was found 2021-11-27 15:52:54 +01:00
Stypox
bde378618d 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
0c8bd5416a 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
14ebb41264 Rename string finish to ok, as its content was "OK" 2021-08-30 16:36:57 +02:00
Agnieszka C
a34805ea3a 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
9ecec58bbc Changed package as the old one is deprecated 2021-08-26 18:09:27 +02:00
Stypox
12e6ef4bce Fix NullPointerException when checking if storage exists 2021-07-27 11:36:14 +02:00
Stypox
ad32343421 Delete pending missions with invalid storage 2021-07-21 10:52:04 +02:00
TacoTheDank
029e29ffa6 Fix onActivityResult deprecation in MissionsFragment 2021-06-20 14:14:54 -04:00
TiA4f8R
63966a1c2f Adress requested changes and try some cleanup in handleUrl method of InternalUrlsHandler class 2021-06-11 12:12:06 +02:00
TiA4f8R
a23dff74a3 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
1d615df928 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
c3a6a2755e 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
2d92f18471 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
d920c7c1ea Check if file really exists before asking user to overwrite it 2021-06-08 10:40:45 +02:00
Stypox
3399ed2b30 Pass mime type so that SAF treats file extension correctly 2021-06-08 10:40:45 +02:00
wb9688
995264e5e2 Move Stored(File|Directory)Helper into NewPipe 2021-06-08 10:40:44 +02:00
wb9688
4e133a3599 Support SAF properly 2021-06-08 10:40:44 +02:00
TobiGr
e00fe9af0e Annotate StoredFileHelper.createSAF() as NonNull 2021-06-05 16:34:22 +02:00
TobiGr
d0a76d7e60 Use reqireContext(), requireActivity() instead of getters 2021-06-05 16:13:12 +02:00
ix5
393491281e 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
7640aa85c3 Migrate rest of AlertDialogs to AppCompat 2021-04-04 10:26:38 -04:00
krlvm
a8de222577 Fix Dark elements in Light Theme 2021-03-27 17:46:05 +03:00
Stypox
22c92f1fb3 Completely remove return activity, now outdated 2021-03-12 23:21:54 +01:00
Stypox
0ea6b4928c 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
bb398189d6 Move all error-related classes into error package 2021-03-07 17:49:28 +01:00
TiA4f8R
e44495af9a 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
d2cb003585 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
55c770cd1b Use Objects.requireNonNull(). 2021-01-02 09:36:33 +05:30
Isira Seneviratne
da095794a4 Use ServiceCompat.stopForeground(). 2020-12-19 16:52:17 +05:30
Isira Seneviratne
288a9ce2af Use a notification instead of a ProgressDialog in MissionAdapter. 2020-12-13 05:21:38 +05:30
Tobias Groza
2796608428 Merge pull request #4961 from TeamNewPipe/lint
Fix some Lint errors
2020-12-07 11:19:01 +01:00
Stypox
57c28a9a9c Fix ktlint errors 2020-11-22 14:03:10 +01:00
Stypox
34dd7c0fbf Update most dependencies 2020-11-22 14:03:10 +01:00
TobiGr
397ca000e3 Fix typos 2020-11-22 10:39:00 +01:00
TobiGr
40d32034dd Fix Lint: Inconsistent line separators 2020-11-22 10:16:27 +01:00
Isira Seneviratne
a2500345d6 Use try-with-resources. 2020-11-21 13:47:13 +05:30