Newpipe: Direct download option in long press menu in info items

Created on 2 Mar 2019  路  5Comments  路  Source: TeamNewPipe/NewPipe

Hi.
I live in an area with bad mobile network availability and slow connections. So usually I download all videos before watching. Esp when the connection is slow it sometimes takes 2 - 3 s (and even more) to load and decode the info page. For me it would be very helpful if I could directly start the download of a video from the news / abo / channel page without first opening the corresponding info page. If that is possible without increasing the data traffic load on the overview pages. Maybe get the download link after tapping on the (future) menu entry. Without (optionally) even asking for a file name for the downloaded file if that would also take 2+ s to decode the info before asking for a file name. So newpipe downloader could do its job in the background and I could go on scrolling through the list. Just an idea.
Thx

GUI enhancement

Most helpful comment

@sleepypikachu as you can see many duplicates of this issue were closed, so yes, this is a highly requested feature ;-)
I would be ok merging this before the bigger work is ready, mostly because I am not sure if the bigger work will ever be suitable for everyone, and it will surely take some long time. So in my opinion you can go for it, thank you :-D
The implementation should be rather simple, you can take a look at the code for the "Download" action in the open/share menu.

All 5 comments

Would #2583 suit your needs?

Is their any appetite for adding this menu option apart from in the broader re-work proposed by @Stypox?

This seems like a digestible chunk that would deliver some utility now, even if later the re-work would improve it further. Happy to pick up adding this menu option if it can be assigned to me.

@sleepypikachu as you can see many duplicates of this issue were closed, so yes, this is a highly requested feature ;-)
I would be ok merging this before the bigger work is ready, mostly because I am not sure if the bigger work will ever be suitable for everyone, and it will surely take some long time. So in my opinion you can go for it, thank you :-D
The implementation should be rather simple, you can take a look at the code for the "Download" action in the open/share menu.

For reference:
https://github.com/TeamNewPipe/NewPipe/blob/6fce06906d367685bd9dd535267705834c17ccc5/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java#L489

case R.id.detail_controls_download: 
if (
PermissionHelper.checkStoragePermissions(
activity, PermissionHelper.DOWNLOAD_DIALOG_REQUEST_CODE)
)
 { this.openDownloadDialog(); } 
break;

https://github.com/TeamNewPipe/NewPipe/blob/6fce06906d367685bd9dd535267705834c17ccc5/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java#L1602

public void openDownloadDialog() { 
try { 
final DownloadDialog downloadDialog = DownloadDialog.newInstance(currentInfo); downloadDialog.setVideoStreams(sortedVideoStreams); downloadDialog.setAudioStreams(currentInfo.getAudioStreams()); downloadDialog.setSelectedVideoStream(selectedVideoStreamIndex); downloadDialog.setSubtitleStreams(currentInfo.getSubtitles()); downloadDialog.show(activity.getSupportFragmentManager(), "downloadDialog"); } catch (final Exception e) { final ErrorActivity.ErrorInfo info = ErrorActivity.ErrorInfo.make(UserAction.UI_ERROR, ServiceList.all() .get(currentInfo .getServiceId()) .getServiceInfo() .getName(), "", R.string.could_not_setup_download_menu); ErrorActivity.reportError(activity, e, activity.getClass(), activity.findViewById(android.R.id.content), info); }
 }

Reference:
Changes need to be implemented here,

https://github.com/TeamNewPipe/NewPipe/commit/8b584f3922d16b1962ab843f2d18bd588aa898a0

Thanks, have had a lot on past few weeks in day job but will try and look at this in next few weeks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Aevann picture Aevann  路  3Comments

desmonk picture desmonk  路  3Comments

android1973 picture android1973  路  3Comments

Wang-GY picture Wang-GY  路  3Comments

Hunter9888x picture Hunter9888x  路  3Comments