miguelfreitas / twister-html

twister HTML + Javascript User Interface
MIT License
229 stars 138 forks source link

Adding webtorrent support #354

Open Nullifer opened 8 years ago

Nullifer commented 8 years ago

I think it would be really cool to add webtorrent support, and add a lot of features to build a model that can compete with youtube. People would be able to upload videos and it would show up on the feed to everyone who is following them, people would be able to look at the videos on some one's profile (original uploads, shares (seeds), and maybe even comment on videos by using something sort of like a #hashtag, except referencing a specific video rather than a topic. End users would be able to help host content by sharing on their own profile and select how long to help seed it for.

majestrate commented 8 years ago

webtorrent is probably not needed since twister is already built atop bittorrent

Nullifer commented 8 years ago

@majestrate Webtorrent lets you stream torrents as opposed to just downloading then playing.

slr commented 8 years ago

Webtorrent lets you stream torrents as opposed to just downloading then playing.

libtorrent doesn't prevent to do the same.

anyway I don't see why file attaching (videos is just particular case of that) should be implemented here and not in twister core.

Nullifer commented 8 years ago

@slr Yeah torrent file attaching would be pretty cool. If that happens it would be nice to have an embedded video player that can play those attachments, which is what I thought webtorrent was built for, streaming torrents into an embedded video player.

majestrate commented 8 years ago

webtorrent is a bittorrent client for thenweb browser that uses bittorrent wire protocol over webrtc. it could be cool to use it but not sure where it'd go since twisterd is already a bittorrent client and we use a separate dht from mainline. On Apr 29, 2016 1:58 AM, "Nullifer" notifications@github.com wrote:

@slr https://github.com/slr Yeah torrent file attaching would be pretty cool. If that happens it would be nice to have an embedded video player that can play those attachments, which is what I thought webtorrent was built for, streaming torrents into an embedded video player.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/miguelfreitas/twister-html/issues/354#issuecomment-215632873

miguelfreitas commented 8 years ago

yes, our bittorrent client is heavily patched and we would need another copy of libtorrent in order to be compatible with standard torrent again at twister-core level.

the webtorrent idea is interesting and probably easier to get working. given we now have the ability to encode long urls into special posts, we could easily share magnet links. does webtorrent support magnetic links?

if we include webtorrent though we must have it disabled by default. my university, for example, bans people using bittorrent and some users in twister-devel expressed their feeling against sharing content from other people without explicit settings.

majestrate commented 8 years ago

also something to think about, tor browser doesn't do webrtc, (nor does my browser) as it leaks ip info regardless of proxy settings.

miguelfreitas commented 8 years ago

good point. but not a showstopper imho. one may always copy-paste the torrent url somewhere else.

Tschaul commented 8 years ago

There are plenty of options for filesharing. I don't see what twister has to offer here. If its only about integration of existing technologies, that is clearly the job of the clients. A url is all it needs for that.

I think Twister should rather focus on being a lightweight and highly available messaging and publishing platform, where the rest of the web can easily hook into.

sorry to be so negative

Nullifer commented 8 years ago

@miguelfreitas Webtorrent does indeed support magnet urls. Also, I don't think it should be disabled by default, but a prompt when setting up your client whether to have it enabled, disabled, or click to play mode. Which would also of course be in settings. Btw, how is using webtorrent much different than the bittorrent in twister? Why does one get you banned but not the other? @Tschaul

There are plenty of options for filesharing. I don't see what twister has to offer here.

Find me a decentralized version of youtube that works using torrents. What I'm saying is the infrastructure twister has in place would make for a great content sharing platform. The content that is shared shouldn't only be text, and you should be able to help host a video that you liked by seeding and/or sharing it like you can on twitter.

If its only about integration of existing technologies, that is clearly the job of the clients. A url is all it needs for that.

Your right it is the client's job thats why I opened this issue on the client's github (twister-html).

I think Twister should rather focus on being a lightweight and highly available messaging and publishing platform, where the rest of the web can easily hook into.

Being able to play videos from magnet links from the client won't harm this goal, but will even help it if we can get content creators to join the platform.

@majestrate I'd imagine the webtorrent support just goes in the client and remains separate from the twister bittorrent client. Maybe in the long term you'd merge them or fork webtorrent and customize it so then we'd only need one bittorrent client? Idk whats most optimal

Also another feature suggestion: allow people to tag easily accessible payment/credit info onto the video posts. Maybe we can create a platform that is more sustainable and favorable to content creators and sharing than youtube. Also you could tag and search for videos using hashtags, and filter what type of content your looking for (text, videos, audio only etc.)

I'll probably come up with a proposal with a full list of features and exactly how they'd work soon, and link it here.

miguelfreitas commented 8 years ago

@Nullifer i have actually been blocked a couple of times for using twister at my work (PUC-Rio university). their IDS system indeed detected twister as bittorrent but i've provided them with twister papers to show it is a research project they shouldn't block. afaik they've updated their IDS fingerprints.

still i don't know what would happen if one inadvertently opens a web page with webtorrent. would his machine get blocked for that? sounds stupid policy to me, but it is not unlikely.

miguelfreitas commented 8 years ago

btw, i agree with your idea: clicking in magnet link would ask user about enabling webtorrent support or not (which would be available from setup page as well).

Nullifer commented 8 years ago

@miguelfreitas How will we know what to do with magnet urls? Can we override the default action to take when you click a magnet url? How do we know to open a video player instead of a torrent client? Do we have users select what type of content the torrent is, and have clients decide that way?

miguelfreitas commented 8 years ago

@Nullifer i think we should store mime types along with urls we have shortened. this way we may know beforehand a magnet link is a video, or image etc (provided it was attached using twister).

miguelfreitas commented 8 years ago

initial webtorrent support added to twister-html, blaster branch. give it a try!

Nullifer commented 8 years ago

@miguelfreitas awesome, thank you : )

feross commented 8 years ago

Awesome! Going to check this out.

ghost commented 8 years ago

This is working, but it's a bit confusing that the "shortened URL" dialog shows up, and it's also confusing that just pasting in the magnet link directly doesn't work. (I managed to somehow end up uploading the file but not actually putting in the shortened URL, assuming it was attached because how the file input is laid out, putting the URL into a separate twist, and when that didn't work, re-shortening the magnet: URL, which finally worked.) EDIT: Further note: The "how the file input is laid out" bit is sort of Firefox's fault - it shows a "Browse" button and the name, which suggests it's already attached unless you read between the lines a little...