GithubHelp home page GithubHelp logo

storrent's Introduction


Storrent is a Scala library for dealing with BitTorrent.

It's made so you can embed it in whatever application you'd like, get scrape count for Torrents (see how popular they are), and download torrent files.

The library, when compiled, can also be used as a command line Bittorrent Client ( in the fashion of rtorrent or ctorrent )


Examples

Metainfo

To get a Torrent metainfo:

import com.submarinerich.storrent.Torrent

var t = Torrent.fromURL("http://releases.ubuntu.com/11.10/ubuntu-11.10-server-amd64.iso.torrent")

Console.log("Torrent Name"+t.name)

Console.log("Torrent cread by "+t.createdBy)

Console.log("info hash "+t.info_hash_hex)

for( tracker <- t.announceList )
  Console.log(" tracker: "+tracker)

for( file <- t.files )
  Console.log(" file: "+file)

You can also get a torrent from a local file:

var t = Torrent.fromFile("Downloads/localUbuntuTorrent.torrent")

Programmatic Downloading

To download (programmatically):

import com.submarinerich.storrent.{Torrent,TorrentClient}

def displayUpdate( f : Double ) : Unit = log.info("percentage downloaded: "+"%03.02f".format(f)+"% (of 100%) ")

var t = Torrent.fromURL("http://releases.ubuntu.com/11.10/ubuntu-11.10-server-amd64.iso.torrent")

var downloadingTo = "download/"

var tc = new TorrentClient(t.get)(downloadingTo)

tc.download(displayUpdate)

tc.cleanupResources

Scraping

As a scraper :

see src/test/scala/TrackerScrapeTestSuite.scala:24
for now it's a little more complicated than the others and requires netty/a thread sleep

Command Line

To download (via command line)

first install (assumes macports, maven, rake, scala29)

sudo rake install

then run:

storrent http://releases.ubuntu.com/11.10/ubuntu-11.10-server-amd64.iso.torrent ~/Downloads/

Features

Known Issues

  • No seeding (yet).
  • It's a little slower than I'd like, but it's still in alpha.

Roadmap

  • Seeding
  • DHT Bittorrent Protocol Extension Implementation
  • Location Aware Protocol Extension Implementation

storrent's People

Stargazers

Miguel Aranha Baldi Horlle avatar Sergei Lukianov avatar

Watchers

James Cloos avatar Zoltan Orban avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.