Stream PirateBay movies directly from CLI - guilhermepontes
======
stegosaurus
This looks like a way to break BitTorrent, as other posters have outlined.

Streaming in general (apart from via a local server) frustrates me. The entire
idea is simply a way of relinquishing control to an external body. Hard drives
are not that expensive, and patience is a virtue. I'm very happy that youtube-
dl exists, for example, because otherwise when Google disappears I'll lose a
lot of useful material I have access to at the moment.

Regardless - I'm surprised to see this here. Sci-Hub is one thing - it's an
educational resource.

Mainstream media... I just gave it up rather than pirating it. I'm not 18 any
more - my friends don't really care about the latest Marvel flick. The movie
companies have lost even my mindshare now. Books, online reading material,
educational videos, all free, all a better use of my time, all less likely to
leave me wanting a fast car like James Bond.

~~~
justsaysmthng
> because otherwise when Google disappears I'll lose a lot of useful material
> I have access to at the moment.

Could you explain that ? Why would google disappear ?

~~~
stegosaurus
Lazy language, perhaps.

Ultimately, I doubt that every piece of media that is currently on YouTube
will be available for as long as I need them. That could be a year, or it
could be fifty.

For my purposes, if a video gets taken down, it's lost forever, I probably
won't be able to find it again.

But 'Guinea Pig Noises Loud Squeaking Sounds.mp4' lives on my hard-drive
forever. ;)

I feel the same way about webpages really. wget -> it's mine until my hard-
drive and all backups die. bookmark -> it's mine until my hard-drive and all
backups die, PLUS the site goes down. Also immutable, which can be a bonus.

~~~
bduerst
But if you didn't contribute to the cost of making those guinea pig noises,
however small they may seem, you don't have the right to that access that
content infinitely.

~~~
stegosaurus
If you are interested in my views on copyright infringement, you might find
this comment useful (commenting on ad blockers).

[https://news.ycombinator.com/item?id=11422763](https://news.ycombinator.com/item?id=11422763)

It probably makes sense for me to formulate the argument properly and write it
up at some point.

In this particular instance - I'm not sure that the amount paid is relevant -
the desires of the publishers would be, which doesn't necessarily include
payment (otherwise no-one would publish under GPL). It's potentially a
violation of the ToS of YouTube - I wouldn't know, I use a commandline tool
which bypasses the web interface entirely.

Sorry Google! I'm sure you'll do OK. (Do you have a donation address? :P)

~~~
bduerst
I'm not sure how your view on ad blocking is entitling you to infinite media
consumption of IP you didn't contribute to. Advertisers didn't make these
hypothetical guinea pig sounds you like, I'm assuming.

And my views personally represent my own, not an organization, which is why I
don't hide behind a dinosaur name :)

~~~
stegosaurus
Sorry, it's the best I can do for now.

We'll have to agree to disagree. :)

~~~
bduerst
Oh come on now, I was hoping you had actually rationalized something that
wasn't self serving.

Maybe you should switch to username non-sequitursaurus :)

------
MoSal
I'm deeply concerned about popularizing torrent streaming.

A few leechers breaking "rarest-first" might not cause much harm. But if most
leechers become streamers, torrents will lose their efficiency in distributing
less-popular content.

Transmission implemented a "streaming" feature once, that didn't actually
stream. It just stopped fetching pieces "with the same rarity" randomly. They
still got too much heat for adding that not very usefull feature. And they
reverted the commits soon after.

~~~
deepnet
Unfortunately in many juristictions seeding is copyright infringement and
leeching is not.

Seeding by default sadly gets a lot of newbs into trouble - especially as
publicising IP addresses are part of the protocol.

Porn blackmail companies and MPAA agents know that seeders are low hanging
fruit.

Similarly Limewire and ilk using the downloads folder as a default share
folder is useful for the health of the network but this has led many to be
unwitting uploaders - which is what they got done for.

Jammie Thomas is a case in point, newb music fan (or her kids I recall) but
the sharing by default is what she was convicted of - for $30,000,000.

No one has ever been convicted of downloading alone - they don't bother
trying.

So seeding by default can be very cruel - sadly.

Even with that caveat, those like Jammie, brought up on Sesame Street were
taught to share and don't know how severe tne penalties can be.

That sharing is or can be wrong is now taught at a nursery level.

~~~
claudius
> Unfortunately in many juristictions seeding is copyright infringement and
> leeching is not.

At least in Germany, both leeching and seeding are copyright infringements as
soon as you upload _any_ data back into the swarm. Since leeching also does
this (though not exclusively), it is also copyright infringement. Pure
downloading is not, though, which is why streaming websites (just downloading,
no uploads) are fairly popular here.

~~~
deepnet
Yes by leech only I meant downloading alone.

Well clarified thanks.

------
dkopi
It seems a lot of the magic behind this comes from Peerflix - a node.js
library for streaming torrents.

This is mostly a CLI wrapper for searching piratebay, parsing the results, and
then streaming using peerflix.
[https://github.com/mafintosh/peerflix](https://github.com/mafintosh/peerflix)

I'm curious why thepiratebay npm package wasn't used instead:
[https://github.com/t3chnoboy/thepiratebay](https://github.com/t3chnoboy/thepiratebay)

That said, great usage of cheerio for parsing the returned HTML results. I
love how it's as simple as running JQuery like commands on the server side.

~~~
oniony
A lot of credit for most FOSS software is the various libraries and
programming languages they are built upon: I don't think you can take anything
away from this project because of it. Indeed if you take the time to look into
Peerflix's dependencies
([https://github.com/mafintosh/peerflix/blob/master/package.js...](https://github.com/mafintosh/peerflix/blob/master/package.json))
you'll see that it, too, is based upon airplay-js, parse-torrent, torrent-
stream, amongst others.

We're at a rather convenient point in time where building a program/app is an
exercise in coming up with an idea, researching the alternative components it
can be built out of and then spending the time getting them to play nicely
together. I wouldn't underestimate the amount of work that entails.

~~~
dkopi
Great point. This is definitely nice work, and it looks like a great usage of
existing tools. Did not intend to come off disregarding the effort.

------
sneak
When are we as a community going to stop cheekily "tolerating" piracy and
finally stand up against the unjust and immoral lie that is the concept of
intellectual property rights?

When you can tell me who owns the number two, I can tell you who owns a song.

It's not just "I want movies without paying" posturing. Culture is reuse and
remixing. Half of internet culture these days comes from V, from Tyler Durden,
from The Matrix, from the Terminator. Should response GIFs and image macros be
illegal?

Literally ALL use of every kind is fair use.

Creators should get paid, yes, but that does not warrant the current farce in
any way whatsoever. The "legal solutions" foisted upon us under the current
model (eg Spotify) see creators getting paid approximately the same amounts as
they did under the Napster setup.

I hate to admit it, but rms was right about the whole mess, and it was much,
much bigger than computer code.

~~~
mseebach
> When are we as a community going to stop cheekily "tolerating" piracy and
> finally stand up against the unjust and immoral lie that is the concept of
> intellectual property rights?

Probably never, and that's fine. At least not until the avalanche of
inevitability gets rolling and then it doesn't matter, and that's fine too.
That's just how real social change happens. First you get the majority on
board, then the rest is just bookkeeping.

Nobody "as a community" stopped "cheekily tolerating" casual cannabis use and
"finally stood up", but tolerance got so ubiquitous that suddenly the
"squares" were out of touch and suddenly has to "stand up" for what was
already the law -- not the other way around.

I'm pretty sure "cheekily tolerating" homosexuality also cumulatively did more
for gay rights than "standing up" did.

~~~
deepnet
A lot of people did hard time and worse to change cannabis laws and anti-gay
discrimination, voting rights, &c.

Governments change laws when there is political capital in it.

------
smoyer
Github now returns 404 (Not Found) for the linked project.

~~~
vikeri
Forked:
[https://github.com/orinocoz/pirateflix](https://github.com/orinocoz/pirateflix)

~~~
TheArcane
How do I install it without the project being registered in npm?

~~~
jdc0589
Not totally sure what you mean, but you want to install it yourself just clone
the repo, `npm install` to get all the dependencies. then, do one of:

1\. run `npm link`, which will put pirateflix in your path 2\. make src/cli.js
executable and run it directly 3\. don't make src/cli.js executable, and run
it with `node src/cli.js`

~~~
LiquidFlux
For context, the fork linked above references being able to install it using
'npm install pirateflix -g', which does not function due to pirateflix
apparently not being registered.

------
brian-armstrong
For a news site frequented by software engineers, many of whom receive six
figure salaries related to the creation and sale of software, this feels in
very bad taste. Movie staff and music artists deserve to have their copyright
respected. If you don't like it, just don't watch/listen. It's plainly simple.

~~~
jameslk
If I was still writing desktop software, I would have no problem with my
software being pirated. I'd make it difficult enough for it not be worth the
effort for anyone who can afford it, but I know that there's plenty of others
who might not be able to afford my software, who are willing to spend the time
instead cracking the software. Some kid out there might be building a future
career on cracked versions of my software. Ideally they might someday be able
to afford it and pay for it. That was certainly the case for me.

With the movie and music industry, they went the other way. They made it
difficult to buy their products and a lot easier to pirate. And now they're
the ones paying for it.

~~~
bduerst
>They made it difficult to buy their products and a lot easier to pirate. And
now they're the ones paying for it.

Historically, yes, but this has changed, hasn't it?

You can typically purchase or rent a major movie through a variety of
streaming-capable channels and mediums. I just rented _Room_ on Google play
and streamed to my TV over the weekend. If I bought it, I could download it to
my devices for offline viewing.

~~~
belorn
If you live in the US, then some of the channels are getting close to be more
convenient than go to a website designed in early 2000, figure out which link
has the content, download a program that handle BitTorrent protocol, install
it, wait for the content to download, figure out how to make a player play it,
and then watch it.

If you don't live in the US, the typical case is instead to go to the store
and look in the bin and hope to find something from two years ago, or go to
the cinema and chose one of the 10 shows available this month. The streaming
services has something like 1/10 of the lists available in the US, if they
offer anything at all.

------
andy_ppp
Hmmm. This only includes 344 different dependencies from npm. Not sure why I'm
concerned. Is this more dangerous than my webpack build? Probably not but it
certainly reminded me that convenience comes at a cost...

------
colinramsay
This doesn't work for me, because
[http://thepiratebay.se](http://thepiratebay.se) is hardcoded in the code and
that mirror is blocked in my location. I filed an issue.

[https://github.com/weslleyaraujo/pirateflix/issues/3](https://github.com/weslleyaraujo/pirateflix/issues/3)

~~~
tixzdk
Or maybe they could use [Node.js core
DNS]([https://nodejs.org/api/dns.html#dns_dns_setservers_servers](https://nodejs.org/api/dns.html#dns_dns_setservers_servers))
module to resolve the domain, setting something like
[censurfridns]([http://www.censurfridns.dk/](http://www.censurfridns.dk/)) as
a temporary server.

I think this module is very immoral, however, so I'm not going to
contribute...

~~~
staticelf
Why do you think it's immoral?

~~~
imdsm
Yea I'm wondering this too.

Now, I know that DNS can be a little bit scary when you dig into the details,
and sure, it can be a little verbose, but it's not so bad that it's immoral!

------
Dawny33
Looks like the repo has been removed. Can anyone else confirm?

~~~
akash0x53
Yeah, looks like he wasn't ready accept PR and issues.

~~~
Dawny33
Well, I thought he deleted the repo, cause he didn't like my issue :P

------
Karlozkiller
Soon after this got on HN, the source seems to have been taken down?

I 404 both on Github and npm.

~~~
dkopi
This fork is still available:
[https://github.com/orinocoz/pirateflix](https://github.com/orinocoz/pirateflix)

~~~
nacs
Slightly newer fork here (not mine):

[https://github.com/akash0x53/pirateflix](https://github.com/akash0x53/pirateflix)

------
jpgvm
I know there are a lot of people saying the breaking the rarest first rule
will be really bad for swarm health but it seems to me that with the rise of
faster connections it seems reasonable that you can stream a torrent, keeping
a reasonable buffer of a few blocks and then with any spare bandwidth download
the torrent with a standard rarest first strategy and seed whilst doing so.

That said I think purely streaming is bad for torrenting and even though it
will happen we should encourage something that is better for maintaining
health of swarm.

~~~
KMag
See my other comment here about how I implemented randomized swarming in
LimeWire in a way to still promote the health of the swarm, and suggestions
for a smarter way than I implemented in LimeWire.

Even for someone who's interested only in leeching a single streamed movie, if
the number of sources for some blocks is only one, it's still in their
rational best interest to request those single-source blocks first. Also, if
there are multiple blocks with only one source, and they assume there may be
another user using the same algorithm, it's in their rational self-interest to
download earlier blocks, but not always the next one, under the assumption
that another leecher may be grabbing the same block at the same time.

So, you end up with the probability of selecting rarest-first vs. earliest-
first as a smooth function of the number of sources for the rarest block, and
when picking amongst rarest blocks, using something close to an exponential
distribution. The best solution for the health of the network would be
selecting uniformly from the rarest chunks, but that discourages people from
participating in the swarm. Rational self-interest can lead to a solution
that's still better for the collective than a pure earliest-first chunk
request strategy. (And yes, in LimeWire, I did implement chunk selection as a
Strategy design pattern.)

------
dang
We were asked to delete this post because it might get someone in trouble. I
don't think we should delete an entire ongoing discussion, but we did remove
the URL.

------
hobarrera
Sounds a great deal like peerflix:

[https://github.com/mafintosh/peerflix](https://github.com/mafintosh/peerflix)

------
m52go
Looks like the repository is gone now.

------
xufi
I would like to use this at some point. No need to download movies now .
Though I still need music

------
a_small_island
Hoping someone will help. I'm not an engineer, but I'd like to learn a few
things. How would I set this up? Not really that interested in streaming
torrents but it looks fairly simple so I figure with a nudge I could figure it
out on my own.

~~~
marklawrutgers
I'm not sure about the original link since it 404'd before I could look at it
but if it's like the other fork up on here it seems it uses the node package
manager. So a simple method would be to install nodejs:
[https://nodejs.org/en/](https://nodejs.org/en/)

This installs npm (node package manager) for you.

Open up any Command prompt or Terminal depends on the OS you're running and
I'm sure there are lots of alternatives these are usually just the default
installed on every machine.

Run the install command which looks something like "npm install pirateflix -g"

The -g means it installs globally on the machine so you can access it in any
directory instead of just one specific folder or location.

Once that's done you can just start off each command with "pirateflix" or
"pirateflix --help" to get details of the function. It's documented on the
github under Usage and Options. Should be straight forward from here. Hardest
part is probably just knowing what npm is.

------
jolux
this repository seems to have been removed...not sure whether by GitHub or the
initial author but something happened.

------
leshow
torrentflix can do this and it also stream from more than just TPB, i've
contributed to tflix in the past.

------
rpalmaotero
Seems like the repo was deleted.

------
adnanh
It has been taken down :(

~~~
ReadToLearn
It's difficult to do this on the web:
[https://github.com/orinocoz/pirateflix](https://github.com/orinocoz/pirateflix)

------
ikeboy
It's down?

------
nazilla12
the page has just been taken down?

------
l1feh4ck
404!

------
07d046
A CLI version of Popcorn Time, published using the real life identity of the
author? Brave move.

~~~
Buge
And using a Hollywood movie as an example? If he wanted to claim "it's just a
tool, usable for anything" he should have used something like Big Buck Bunny
as the example.

~~~
amelius
This was just an example to be used by the rightholders of that movie. If you
published your own movie, you can substitute the name of your movie in the
example. :)

------
deepnet
Hundreds of thousands of ordinary people worldwide have had their lives
destroyed by this.

For enjoying art.

The War on the fans is immoral, hateful and wasteful.

Those who enact it have stolen more from artists than anyone.

~~~
dang
We detached this subthread from
[https://news.ycombinator.com/item?id=11420963](https://news.ycombinator.com/item?id=11420963)
and marked it off-topic.

~~~
deepnet
Well considering the guy took down his repo, perhaps it is at the heart of his
reasons for writing it and taking it down.

So thread detachment, ok, but it is not off topic IMHO.

Your mod intuition is mighty fine tho', so I'll stop posting this thread and
go write a book :)

------
cbeach
Dislike this kind of story appearing in HN. We're all well educated people
with high earning potential who should be capable of buying movies, not using
our talent to rip them off.

I'd hate to see HN develop a bad reputation because of stuff like this.

~~~
staticelf
I live in Sweden if you're supposed to wait you'll have to wait several months
sometimes extra to purchase content made in the US. Also, historically there
is no good way to purchase the content if you do not want to purchase a
physical disc in a shop.

Sometimes it's never available, especially english shows that is only
broadcasted on english tv channels.

~~~
belorn
If we are talking about the situation in Sweden, it must also be said that
there is a copyright tax on storage media in computers, phones and similar
devices. The tax is supposed to be there so authors get paid when people do
private copying, but DRM creates a situation where the tax money get stolen
and nothing is returned to the tax payer.

When copyright is used as an excuse to steal tax money, its hard to use
morality as an argument against non-commercial copyright infringement.

~~~
staticelf
Yes, that is truly disgusting.

This is the organisation he/she is talking about: [http://www.copyswede.se/in-
english/](http://www.copyswede.se/in-english/)

