effigies / BitTornado

UNMAINTAINED - John Hoffman's fork of the original bittorrent
Other
150 stars 44 forks source link

Error creating announcers #36

Closed effigies closed 8 years ago

effigies commented 8 years ago

Via @yang502 in #34:

Now I using the master branch on Python3.5.2 , and updated my local Stream.py file. I can run the tracker successfull.

My torrent file is:

metainfo file.: VMGL_3D_win7.img.torrent
info hash.....: 263b90dc18c5a0c53d07d9c3e7335b4d0d84062c
file name.....: VMGL_3D_win7.img
file size.....: 720764928 (1374 * 524288 + 393216)
announce url..: http://172.21.36.99:6969/announce

But when I want to download the torrent file ,it shows as follows:

ERROR:
http seed url not http: 
saving:         VMGL_3D_win7.img (687.4 MB)
percent done:   0.0
time left:      
download to:    /root/BitTornado/VMGL_3D_win7.img
download rate:  
upload rate:    
share rating:   
seed status:    
peer status:    
Traceback (most recent call last):
  File "btdownloadheadless.py", line 224, in <module>
    run(sys.argv[1:])
  File "btdownloadheadless.py", line 192, in run
    dow.startRerequester()
  File "/root/BitTornado/BitTornado/Client/download_bt1.py", line 578, in startRerequester
    announcers = urls_to_announcers(tracker_urls, **kwargs)
  File "/root/BitTornado/BitTornado/Client/Announce.py", line 436, in urls_to_announcers
    for tier in trackerlist]
  File "/root/BitTornado/BitTornado/Client/Announce.py", line 436, in <listcomp>
    for tier in trackerlist]
  File "/root/BitTornado/BitTornado/Client/Announce.py", line 435, in <listcomp>
    return [[Announcer(url, *args, **kwargs) for url in tier]
  File "/root/BitTornado/BitTornado/Client/Announce.py", line 98, in __new__
    return cls.subclasses[scheme](tracker_url, port, *args, **kwargs)
KeyError: ''
effigies commented 8 years ago

Is that the full output from btshowmetainfo? And would it be possible to get a copy of this .torrent file?

What it looks like is that there's an 'announce-list' key in your dictionary with a null value. Which we should probably still deal with properly, but it will be hard to target a fix without an example file.

yang502 commented 8 years ago

I make my bt file like this :+1: python ./btmakemetafile.py http://172.21.36.99:6969/announce /root/VMGL_3D_win7.img

the full out from btshowmetainfo:

[root@bogon BitTornado]# python btshowmetainfo.py /root/VMGL_3D_win7.img.torrent btshowmetainfo 20130326 - decode BitTorrent metainfo files

metainfo file.: VMGL_3D_win7.img.torrent info hash.....: 263b90dc18c5a0c53d07d9c3e7335b4d0d84062c file name.....: VMGL_3D_win7.img file size.....: 720764928 (1374 * 524288 + 393216) announce url..: http://172.21.36.99:6969/announce announce-list.: http seeds....: comment.......: Is there somthing wrong with my .torrent file?

effigies commented 8 years ago

Yes. The announce-list, httpseeds and comment showing up indicates that they're present in the file, which they shouldn't be, if empty.

This looks like a bug I introduced trying to be clever in how to create metainfo dictionaries, but it does give the opportunity to make sure we can handle badly-formed .torrent files.

Can you try the issue_36 branch? I think it should resolve all of these issues.

yang502 commented 8 years ago

I am using the issue_36 on python3.5.2.

》》bt file info

[root@bogon BitTornado]# python btshowmetainfo.py /root/VMGL_3D_win7.img.torrent 
btshowmetainfo 20130326 - decode BitTorrent metainfo files

metainfo file.: VMGL_3D_win7.img.torrent
info hash.....: 263b90dc18c5a0c53d07d9c3e7335b4d0d84062c
file name.....: VMGL_3D_win7.img
file size.....: 720764928 (1374 * 524288 + 393216)
announce url..: http://172.21.136.99:6969/announce

》》run tracker

[root@bogon BitTornado]# python bttrack.py --port 6969 --dfile dstate 
**warning** crypto library not installed, cannot completely verify encrypted peers
172.21.136.99 - - [06/Aug/2016:16:36:52] "GET /announce?left=720764928&port=18341&key=b%2770UizQ%3D%3D%27&supportcrypto=0&peer_id=T041-----eX8sgZK8tCc&info_hash=%26%3B%90%DC%18%C5%A0%C5%3D%07%D9%C3%E73%5BM%0D%84%06%2C&downloaded=0&compact=1&requirecrypto=0&uploaded=0 HTTP/1.1" 200 56 "-" "BitTornado/T-0.4.1"
172.21.136.99 - - [06/Aug/2016:17:06:52] "GET /announce?left=720764928&port=18341&key=b%2770UizQ%3D%3D%27&supportcrypto=0&peer_id=T041-----eX8sgZK8tCc&info_hash=%26%3B%90%DC%18%C5%A0%C5%3D%07%D9%C3%E73%5BM%0D%84%06%2C&downloaded=0&compact=1&requirecrypto=0&uploaded=0 HTTP/1.1" 200 56 "-" "BitTornado/T-0.4.1"
172.21.5.78 - - [06/Aug/2016:17:11:02] "GET /announce?left=720764928&uploaded=0&supportcrypto=0&key=b%27clbueQ%3D%3D%27&info_hash=%26%3B%90%DC%18%C5%A0%C5%3D%07%D9%C3%E73%5BM%0D%84%06%2C&requirecrypto=0&compact=1&port=16199&peer_id=T041-----pJqwO6SOHPW&downloaded=0 HTTP/1.1" 200 56 "-" "BitTornado/T-0.4.1"

》》btdownload

saving:         VMGL_3D_win7.img (687.4 MB)
percent done:   0.0
time left:      
download to:    /root/bit_new/BitTornado/VMGL_3D_win7.img
download rate:  0.0 kB/s
upload rate:    0.0 kB/s
share rating:   0.000   (0.0 MB up / 0.0 MB down)
seed status:    0 seen now, plus 0.000 distributed copies
peer status:    0 seen now, 0.0% done at 0.0 kB/s

I can't download the file. Iit just reflash the download infos quickly.

effigies commented 8 years ago

It looks like you're able to load the file correctly and aren't producing bad Announces anymore. Merging.

Latest report looks like #23, so further discussion on this can move over there. I'll update it with my current understanding.

yang502 commented 8 years ago

I can't download the file in my seeder machine/tracker machine or anthoer machine. Is that mean I didn't share the file via the .torrent file?

effigies commented 8 years ago

No, I believe the issue is that btdownloadheadless is failing to seed properly. Which I think is the problem in #23, so I moved discussion there.