Peertube: Magnet links for direct download

Created on 9 Jun 2018  Â·  15Comments  Â·  Source: Chocobozzz/PeerTube

MediaGoblin and Vimeo (sometimes) have a button for downloading the video instead of streaming it, which is helpful for people with older computers, or patchy net connections, or who want to download it while they have free wifi, for watching at a time when they don't. It seems me that in keeping with the torrent-based streaming method of PeerTube, the way to do direct downloads would be to provide a magnet link and a web seed (or 3), allowing users to download a video with their BitTorrent client. This way, as with the WebTorrent streaming, users aren't just putting a strain on the server when they download, they can also contribute back to helping other users download popular videos.

If and when desktop BitTorrent clients start to become WebTorrent compatible, this would be a simple way for a user to help stream a video they really like to the PeerTube network too. They would download the video with the magnet link, and then seed it as normal, helping others user watch it on PeerTube or download it via the magnet link.

Type

Most helpful comment

There is already a notion of magnet URI in the codebase to switch between resolutions in the player. It should be pretty straightforward to add it to the download modal :)

All 15 comments

There is already a notion of magnet URI in the codebase to switch between resolutions in the player. It should be pretty straightforward to add it to the download modal :)

I think the torrent file is enough (magnet could be outdated), so closing this issue :)

@Chocobozzz

I think the torrent file is enough

Users are accustomed to: click a link, download begins. Magent links provide a similar UX for torrents.
Introducing another app into the UX is challenging enough for some people (it wasn't for the copywars, the browser would have a minimal torrent client built in to its download system). Making them manually handle a metadata file, and figure out how to import it into that app, degrades the UX even more.

magnet could be outdated

Sorry, I don't understand what this means in this context. Can you expand on it?

closing this issue

I know if feels satisfying to close issues, and keep your workspace tidy, but I'm not certain this issue is actually resolved to everyone's satisfaction, or the best possible outcome for your app.

I guess we should investigate how to update the magnet link, then.

It's just if the video file changed, the info hash changed and it could take some minutes/hours to spread the info in the federation.

Couldn't we fetch it directly to the originating instance?

Let me know if the implementation in 5511da6 covers what you had in mind @strypey

Thanks @Chocobozzz and @rigelk for your work on this. I will do some testing when I get back from the UK and get back to you.

@rigelk ok so the magnet link option is there and it successfully launched a torrent download in my desktop client (Transmisson). So far so good. I've been waiting a while though, and my client hasn't managed to actually get beyond "downloading metadata", and is still on "0% done". This normally only takes 30 secs to 1 min.

A couple of comments on UX. Having a magnet link as a radio button threw me. It's a link, and on any other torrent site magnet links either look like normal web links (with the words "download" or something) or a magnet icon. Also, I know it's only one extra click, but why put it on the download modal, when it could be a small magnet icon (or "download this video via BitTorrent" link) directly under the video box? It would also be great to have a magnet link with each video on search pages.

This may seem peripheral to your main project goals. But my hope is that one day I'll be able to download from PT with a desktop (or mobile) torrent client, and still be part of the swarm that is seeding to people watching the video on PT sites via WebTorrent. I've been following the discussions on Transmission supporting WebTorrent, and while there are some serious technical issues to work through, I think people really understand the potential value for users now, and the will is there to find a way.

I'll let @Chocobozzz answer on the magnet link debug. But do you have any logs on the Transmission side that are of relevance?

As for the UX, the radio button is there because the rest of the modal behaved that way. This was a quick implementation, not a good one. I will happily improve it when I have time. The download button, on the other hand, is hidden because some people think it encourages people to pirate videos (whatever that means). It's a middle ground to not have to add an option to hide it. The same kind of concern did happen with the import feature for instance…

This may seem peripheral to your main project goals. But my hope is that one day I'll be able to download from PT with a desktop (or mobile) torrent client, and still be part of the swarm that is seeding to people watching the video on PT sites via WebTorrent.

Let me assure you it is not peripheral. We are following the same discussions and having the same hopes. However the WebTorrent community doesn't master WebRT so they cannot help the Transmission community (among others), which (IMHO) are not trying hard enough on WebRTC implementation (which is itself is quite complex). Add the fact people only have limited time to work on these issues and you get the current situation. What is sad is that the WebTorrent folks are (again IMHO) losing time on trying to switch to WebSocket. A leading implementation example using a c library like rawrtc would come a long way to help both projects go forth, I think.

Rigel Kent wrote:

do you have any logs on the Transmission side that are of relevance?

Where would I find that? Sorry, always more to learn ;)

This was a quick implementation, not a good one. I will happily improve it when I have time.

Awesome. I'll keep an eye on it.

The download button, on the other hand, is hidden because some people think it encourages people to pirate videos (whatever that means).

OK.If there is somewhere else that this is being discussed among PT
devs, users, and video publishers, please link me. I'd like to learn
more.

On the fact of it though, this seems like a compromise that serves
nobody. Downloads are not prevented, and UX quality is reduced. I'm
guessing that some video publishers want the benefits of WebTorrent,
without allowing users to download their videos? Maybe the best thing is
to tell them honestly that there is no reliable way to prevent anything
published into a torrent swarm from being downloaded, and if they're not
willing to accept that as the trade-off for the free bandwidth PT users
are providing, they should use something else?

What is sad is that the WebTorrent folks are (again IMHO) losing time on trying to switch to WebSocket.

This is drifting OT, but the Transmission people (and possibly others)
have said a number of times that WebSockets would be easier for them to
implement than WebRTC. I think it's great that somebody spent some time
thinking about what would be required for that, and that the WebTorrent
team have had some discussion about it. Maybe it's dead end, but maybe
in the process of exploring it, some things will be discovered that help
solve the problem in another way. Innovation always works by throwing a
lot of stuff at the wall and seeing what sticks ;)

@strypey I have improved a bit the UX in bb5d74289b858fae04975477a9572b57ee6237c5 - WDYT?

If you still have trouble with the magnet link downloads, better open a new issue about it, it's easier for us to track (I almost forgot about that one because it was closed) :)

I tested this with the video here:
https://video.deadsuperhero.com/videos/watch/f72b9305-faf9-443d-9594-673efafceb9f

I think it would be better if the modal closes when I click 'download' (it didn't on Firefox on MacOS). Otherwise, my thoughts are pretty much the same as what I said here:
https://github.com/Chocobozzz/PeerTube/issues/639#issuecomment-418850272

As indicated above, I have opened a new issue about the magnet link not working for me. I note that there is an issue #1436 related to the download modal not closing when the user clicks 'download'.

I'd still like to argue for a magnet icon appearing directly under the player window on the video page as the default UI for PT. There could be an option in the settings available to instance admins that removes this from all videos on their instance by unchecking an 'allow video downloads' check box. A similar option could be available for channel admins to do the same for all videos on their channel, and also an option to remove the magnet icon on some videos only.

It makes sense to me that such an option not only removes the magnet icon, but the ability to download videos in general. If an admin or video publisher wants users to be able to download their videos, why would they want to force them to use a direct download instead of a torrent? This would only prevent users from helping seed the download to subsequent users who download the same video, and increase the bandwidth costs of the instance.

Again, if this is being discussed elsewhere (in English), I'm happy to give my input there rather than here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

XenonFiber picture XenonFiber  Â·  3Comments

kabo picture kabo  Â·  3Comments

milleniumbug picture milleniumbug  Â·  3Comments

XenonFiber picture XenonFiber  Â·  3Comments

filmaidykai picture filmaidykai  Â·  3Comments