TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
29.46k stars 2.95k forks source link

Integrate with BitTorrent? #11220

Open stokebreakup opened 3 days ago

stokebreakup commented 3 days ago

Checklist

Feature description

Should we support BiTtorrent network protocol for low speed devices and poor download connections?

Why do you want this feature?

If we deeply analyze the issues(https://github.com/TeamNewPipe/NewPipe/issues/3382, https://github.com/TeamNewPipe/NewPipe/issues/5325), we will see that there is an infrastructure and server problem (which decentralized network protocols can help or serve and are in this context as a partial, intermediate solution). In short, because this would "allow efficient backup, storage and sharing"

Additional information

Discussions about technology are always problematic. For example, I had thought about talking about the previous issue, but they might think it's off topic and mark me as spam And I thought opening an issue here would be interesting to try to see how to solve this problem in another way(but it's also problematic, because people would find it off-topic too). What's more, in my humble opinion (this is within the scope of the app's design which is already p2p. although it doesn't natively support BitTorrent. You could download YouTube files with NewPipe and then manually convert to torrent file. In other words, I would need two applications and two internet connections for something that, if it were in the core, would help a lot.)

Another way to solve this (https://github.com/TeamNewPipe/NewPipe/issues/3382, https://github.com/TeamNewPipe/NewPipe/issues/5325) would be to include rclone (rclone syncs across different clouds, after the user provides the password, you can check on the client side the connection type for the video format type. Because if the user wants a low resolution video because of the internet, he/she can query his Google Drive for the corresponding video format. Google Drive also has a certain way to check the file format and internet connection, and thus download a certain format if there are any upload and download restrictions).

The problem with the first and second solutions is who will pay the bill (the community with a private server for this, just like YouTube does. Or the user with an account on a hosting service for this.) In my opinion this doesn't make much sense when you are a user outside of YouTube (because as a YouTube user, all of this is implemented easily and independently with the New Pipe app). There are good reasons or use cases for this that we don't always talk about. Here are some interesting possible use cases: 1. I would like to share my NewPipe videos to several people, so that they share part of the file, but not the entire video. And this type of algorithm could be used here. How can I do this without being connected to the internet or how can I restrict access to it? 2. Another good reason is that I can guarantee backup with certain integrity, storage and instant copies. How can I have external copies if there is no background wrapper with rclone for this? 3. Another advantage is that it allows only those who use the app to have this feature. Which is good in the commercial sense of the word. Wouldn't it make sense to have a paid synchronization feature for those who want to help keep the code running and for those who work or contribute to it in a financial and commercial sense? 4. A great reason is to reduce storage space to have more videos stored. Why can't we guarantee the integrity of file downloads? 5. You can sync between devices remotely or locally. Why aren't there ways to sync files and devices?

opusforlife2 commented 2 days ago

It's not exactly clear what you want. You've provided an alogorithm and its many possible uses. But what is the end result you're looking for? What purpose is the app currently not serving?

stokebreakup commented 2 days ago

It's not exactly clear what you want.

no? ("you've provided an alogorithm and its many possible uses.") When the user does not trust a person or when he/she does not pay the bill, there is a third way (which is the middle ground between the first and second way). In this case, p2p and BitTorrent. In the p2p case (this is done manually by NewPipe) it is already programmed and works well. What I request is an automatic way(BitTorrent), where different users share legal files for which they have permission and means to do so instead of manually. And it could be a good thing or a bad thing, but it needs more people to evaluate it.

perhaps this could contribute positively to these issues: Support for Variable Resolution Based on Internet Speed, Sync between devices. In p2p networks, everyone is "partially a server". Understand server (who actually serves, shares or stores information. Or who consults, extracts, transfers or backs up this or that information). In p2p technical terminology, there are five categories of servers (peers, seeds, trackers, indexers, dhts). Peers are people who want to download things, trackers are used to find peers and seeds. Indexers (store torrent files for seeds and peers), seeds are those that have the full file or those that share the full file. DHT are servers that distribute file information (hashs).

But what is the end result you're looking for?

That is, instead of depending on third-party APIs, plugins or central servers (use a decentralized p2p network). This could be useful in bad internet connections or internet reconnections that have something restricted that the user does not have access or control over. If this is not a good thing to achieve, see the NewPipe description: - "NewPipe has been created with the purpose of getting the original YouTube experience on your smartphone without annoying ads and questionable permissions." I like NewPipe, but I feel like it's missing something(p2p file download connection is missing).

What purpose is the app currently not serving?

video sharing, backup and efficient storage. my issue was whether it would be interesting for newpipe to be a p2p client (there may be a level of compatibility in libretorrent(https://github.com/proninyaroslav/libretorrent) and NewPipe software (both use GPL license, both work on mobile operating systems such as Android)).

maybe this would be expensive and laborious (unless the community New Pipe want to release a version of New Pipe Plus that implements private sync for this, where the user has video backup and can manage the video format from another device). And it is expensive because you have to have hosting, server, DNS, authentication, etc. Unless this is done through a private sync on an official server of this (which would justify or exemplify why it is expensive and laborious, and why it was done).

opusforlife2 commented 2 days ago

video sharing

There's a share button.

backup

Newpipe has a backup feature, both for subscriptions and the entire database and settings.

efficient storage

Storage efficiency depends on video and audio codecs. Newpipe cannot do anything about that. If you're facing storage issues download lower resolutions/smaller files.

whether it would be interesting for newpipe to be a p2p client

Why does it need to be?

stokebreakup commented 2 days ago

There's a share button.

yes.

Newpipe has a backup feature, both for subscriptions and the entire database and settings.

yes.

Storage efficiency depends on video and audio codecs. Newpipe cannot do anything about that. If you're facing storage issues download lower resolutions/smaller files.

yes. And it is in this context that I am speaking. Could this be done automated? (for example, suppose I downloaded a high definition video and another low definition video. After downloading these videos, convert them to a torrent file. Then I search for low and high resolution files on a network similar to YouTube, but offline, p2p).

ps: YouTube has a way to check the video format based on the client's internet connection type. In the case of NewPipe, I have to do this manually for each video. What I'm asking is if there is any way to make this less work and costly.

Why does it need to be?

good question. The advantage of this is that downloading a video on a BitTorrent p2p network is faster than uploading it (which in this case is not what I want). I want to download videos quickly because I have download and upload restrictions. The p2p architecture emerged for poor internet connections in terms of downloading. What I'm asking for is a way to download, share and store videos in a p2p way.

This is optional for the user, and is useful for users who have poor internet connections or cell phones that do not work with certain video formats. Another advantage is that it could be possible to check the corresponding video format according to the network connection, but without a server for this.

ps: The only way I see would be for New Pipe to be a p2p BitTorrent client (that way one or more users download the file in low or high resolution and as they share and store it in torrent, it would be much more correct to just have a filter of torrent files with a certain resolution by type of internet connection). There are indexers, trackers, seeds, peers or dht servers that can query this.

that would be good?

opusforlife2 commented 14 hours ago

Could this be done automated?

There is already an issue for speed-based variable resolution.

What I'm asking for is a way to download, share and store videos in a p2p way.

I'm pretty sure that's out of scope for Newpipe. P2P is a massive feature that will need prior expertise and constant maintenance. Still, let's see what the devs say.

stokebreakup commented 8 hours ago

There is already an issue for speed-based variable resolution.

but the issue didn't talk or suggest about p2p, BitTorrent. And that's why I requested it here as a use case or even wondering if this could contribute or help that issue (so much so that I was talking here about something similar (whether for backup, storage or even sharing) to try to improve the download of the video connection).

The problem with this is that there is no way to do this without having a server. Basically, you have a container with different video resolutions, so you will need all the different quality videos already converted on your hosting server(which is something YouTube already does, so why reinvent the wheel?).

I'm pretty sure that's out of scope for Newpipe.

yes.

P2P is a massive feature that will need prior expertise and constant maintenance.

yes. And beyond that, there is always another variable. the problem with this is that many people use BitTorrent for piracy, even when the programmer and creator of the network protocol intended it to be used for legal sharing (like Linux ISOs, public and copyrighted music) and not for piracy. Bittorrent downloads regardless of the video and audio codec, it (the protocol) is responsible for downloading in small quantities and distributing it on the network. The only problem I have with the BitTorrent network protocol is that it is neither private nor secure, and it is understandable, because when you download something, there is always someone listening and seeing what you are downloading and who you are downloading it with (in other words, it is only a problem if you consider it to be a problem). And a good part of some game viruses circulated through p2p with BitTorrent.

Still, let's see what the devs say.

ok.