mafintosh / torrent-stream

The low level streaming torrent engine that peerflix uses
MIT License
1.95k stars 226 forks source link

private trackers #81

Closed smolleyes closed 10 years ago

smolleyes commented 10 years ago

hi

can we have small infos on why peerflix or torrent-stream can t use private trackers?

just tried acestream and it play everything! private trackers or not

thanks :)

mafintosh commented 10 years ago

what is needed to support private trackers?

Kureev commented 10 years ago

i think the problem not only in private trackers, because for a some reason i have ~86 peers and can't start stream torrent. No idea why. Subj: i also tried to stream a torrent from the private tracker (soap4.me) but still nothing: it discovers a tracker, but unable to download.

smolleyes commented 10 years ago

ola

yup same problem everything seems ok but do not start downloading (t411.me torrents for exemple)

i had one working but veryyyyyy slow download...

thanks :)

Kureev commented 10 years ago

@smolleyes It seems i found a solution. I tried the @feross torrent-discovery and it works like a charm. Try to discover peers with it and add to torrent-stream engine by engine.connect. I'll try to fork TS tomorrow and replace libs/peer-discovery by torrent-discovery library. Stay tuned ;)

For comparison: torrent-discovery finds 80+ peers vs libs/peer-discovery ~ 30 peers.

P.S. I'm not sure it's related to private server, but for slow download and other related stuff (peers not discovered etc) it works great!

mafintosh commented 10 years ago

@Kureev w00t

smolleyes commented 10 years ago

ok i ll try your fork but i m sure mafintosh can fix it too :+1:

mafintosh commented 10 years ago

@Kureev let me know if you need help. Would very much like to add torrent-discovery

feross commented 10 years ago

awesome that you want to add torrent-discovery. should be a straightforward swap. the api is very similar.

smolleyes commented 10 years ago

yup

what s up with your fork Kureev :p ?

Kureev commented 10 years ago

@smolleyes I'm at work, I'll start as soon as I get home (in hour)

smolleyes commented 10 years ago

hello

ok thanks :)

smolleyes commented 10 years ago

dont know if acestream is open source but it s very impressive... can stream any torrent very fast

Kureev commented 10 years ago

yesterday i took a look into torrent-stream and peer-discovery library. First of all, i want to say, that i successfully replaced it by torrent-discovery, but it's still slow and i can't understand why. If i include torrent-discovery separately, it works fast and good, but within torrent-stream it works as standard peer-discovery.

@mafintosh , @feross could you explain how it can be? (I'll try to share my code a bit later)

smolleyes commented 10 years ago

hello

thanks for your work kureev :)

any idears on this problem @mafintosh , @feross ?

thanks !

Kureev commented 10 years ago

@smolleyes now i'm thinking that problem not in the peer-discovery library itself. Now the best variant for me was to add bittorrent-discovery separately. While torrent-stream fires "ready" state, i just create an instance of bittorrent-discovery and add it peers from it to TS by ts.connect method. Working like a charm. If @mafintosh can help me with my question, i'll try to fix my issues and try to implement it again.

Kureev commented 10 years ago

Okay, i have a couple of news here:

Now i'll try to ask a question about some details to finish my implementation of torrent-discovery:

    exit:     143
    timedOut: true
    command:  "/usr/local/Cellar/node/0.10.28/bin/node basic.js"

As far as i can fix this issues, i'll create a nice PR :3

smolleyes commented 10 years ago

waiting for this ! :dancer:

Kureev commented 10 years ago

@smolleyes but i'm not sure, that it'll help you to download from private trackers. I'd like to implement it, but i have no idea what i need to do for this. Now (even if i'll make a PR) it wouldn't allow you to download private torrents...

smolleyes commented 10 years ago

i think it will help as some torrents start downlaoding but very very slowly so it s not blocked... (i wish..)

and acestream open them all ... thanks anyway it will help many users :p

mafintosh commented 10 years ago

@Kureev I not completely sure what you mean with all your points but I think you should just open the pull request and we can discuss the changes there :)

Kureev commented 10 years ago

@mafintosh sure, but it's not finished as i think. But anyway, it can be a good start point for discussion.

smolleyes commented 10 years ago

hello

any news on this ? :)

smolleyes commented 10 years ago

seems that all this torrents i can t open or download are working very well with torrent-mount Oo!

mafintosh commented 10 years ago

@smolleyes huh. try using an older version of torrent-stream to see if that is better (torrent-mount is a bit behind)

smolleyes commented 10 years ago

thanks @mafintosh i ll try it now, what s the module you use to parse local or http torrents files?

smolleyes commented 10 years ago

hummm shame on me after reading my code i have torrent-stream included but it only use peerflix so i don t think torrent-stream is the probelm

i ll try my torrents with torrent-stream only

smolleyes commented 10 years ago

hi @mafintosh / @Kureev

so same problem with torrent-stream

i let a test torrent for you i just know that with acestream the otrrent is downloading normally (it s x265 file)

http://www.ubukey.fr/test-t411.torrent

let me know if you can download/stream it with peerflix or torrent-stream please :(

THANKS

Kureev commented 10 years ago

Just tried peerflix http://www.ubukey.fr/test-t411.torrent --vlc

Works fine for me, @smolleyes

But i can't play it, because it's encoded

smolleyes commented 10 years ago

damn Oo

cd /tmp sudo npm install -g peerflix

peerflix http://www.ubukey.fr/test-t411.torrent --vlc

->

0.0/s from 0/0 peers tream/bf25957fcf8ee568f8db376b2439839cfacf14a5
info path /tmp/torrent-stream/bf25957fcf8ee568f8db376b2439839cfacf14a5
info downloaded 0.0 and uploaded 0.0 in 149s with 0 hotswaps

Kureev commented 10 years ago

@smolleyes Are you sure, that nothing blocks your tcp/udp ports and etc? Because i have no idea why it can works with acestream and don't work with peerflix for you.

smolleyes commented 10 years ago

i don t have firewall or anything like that so don t think so, really strange

smolleyes commented 10 years ago

strange, if i connect to my vpn it works (slowly but works)... Oo

Kureev commented 10 years ago

So, the problem is not in the code.

smolleyes commented 10 years ago

yes but why it works with alll other torrent client Oo (deluge/acestream etc)

smolleyes commented 10 years ago

we have a complete os on our adsl box with my isp, it have a torrent client too and torrent works too directly on it, completely lost

smolleyes commented 10 years ago

seems working with dmz enabled ... strange

lperennou commented 9 years ago

hello guys,

I still have the problems of peerflix only finding 1 peer with a private tracker. It finds much more on opened trackers. Do you have any ideas why ?

smolleyes commented 9 years ago

hi

if you use read-torrent to parse your torrent, try passing the raw object to torrent-stream not the torrent

exemple:

rTorrent(link, function(err, torrent, raw) {

do not pass torrent but raw to torrent-stream... it fixed the problem for me

++

Le 18/08/2015 00:09, lperennou a écrit :

hello guys,

I still have the problems of peerflix only finding 1 peer with a private tracker. It finds much more on opened trackers. Do you have any ideas why ?

— Reply to this email directly or view it on GitHub https://github.com/mafintosh/torrent-stream/issues/81#issuecomment-131979049.

lperennou commented 9 years ago

Thank you for the answer @smolleyes . I was trying to use peerflix with the command line on Linux. But I can't send the output of read-torrent to peerflix this way, right ? I tried :

read-torrent my.torrent > mytorrent peerflix mytorrent --vlc

Should I write a nodejs program to read the torrent file and launch peeflix like you advised ?

pastudan commented 7 years ago

In my case, the tracker that I use block certain torrent clients from receiving peers. I'd reach out to your tracker's admins and ask that they whitelist peerflix, but in the meantime a way of testing is to spoof the peer id and user agent. Be careful doing this as most have rules that prohibit this. They also needed a parameter called left, which is how many bytes you have remaining to download.

You might want to modify the torrent-stream library to take in a peerId and userAgent from your opts, like this:

  var discovery = peerDiscovery({
    port: DEFAULT_PORT,
    announce: opts.trackers,
    infoHash: link.infoHash, // as hex string or Buffer
    peerId: new Buffer(opts.id),  // as hex string or Buffer
    dht: false, // use dht? optionally, this can be an `opts` object, or a DHT instance to use (can be reused for multiple torrents)
    userAgent: opts.userAgent, // User-Agent header for http requests
    tracker: {
      getAnnounceOpts: function () {
        return {
          // key: '' // I don't know what this is for, but my client sent it when I watched it connect to a tracker. Doesn't seem to be needed by my tracker though
          compact: '1',
          supportcrypto: '1',
          event: 'started',
          uploaded: '0',
          downloaded: '0',
          left: link.length,
        }
      }
    }
  })

Hope this helps