Exemplo n.º 1
0
    def init_session(self):
        scfg = SessionStartupConfig()
        scfg.set_state_dir(tempfile.mkdtemp())
        scfg.set_listen_port(self._port)
        scfg.set_overlay(False)
        scfg.set_megacache(False)
        scfg.set_upnp_mode(simpledefs.UPNPMODE_DISABLED)
        scfg.set_dialback(False)
        scfg.set_social_networking(False)
        scfg.set_buddycast(False)
        scfg.set_crawler(False)
        scfg.set_internal_tracker(False)

        self._session = Session(scfg)
Exemplo n.º 2
0
 def init_session(self):
     scfg = SessionStartupConfig()
     scfg.set_state_dir(tempfile.mkdtemp())
     scfg.set_listen_port(self._port)
     scfg.set_overlay(False)
     scfg.set_megacache(False)
     scfg.set_upnp_mode(simpledefs.UPNPMODE_DISABLED)
     scfg.set_dialback(False)
     scfg.set_social_networking(False)
     scfg.set_buddycast(False)
     scfg.set_crawler(False)
     scfg.set_internal_tracker(False)
     
     self._session = Session(scfg)
Exemplo n.º 3
0
    parser.add_option("-d", "--directory", dest="directory", default="vodclient")
    parser.add_option("-p", "--port", type="int", dest="port", default=5000)
    parser.add_option("-t", "--torrent", dest="torrent", default=None)
    parser.add_option("-x", "--dlrate", type="int", dest="dlrate", default=128)
    parser.add_option("-y", "--ulrate", type="int", dest="ulrate", default=128)
    parser.add_option("-l", "--logfile", dest="logfile", default=None)

    (options, args) = parser.parse_args()

    print >>sys.stderr, "download rate is: %i" % options.dlrate
    
    __TORRENT_FILE__ = options.torrent
    __LOGFILE__ = options.logfile or 'vodclient.log'

    scfg = SessionStartupConfig()
    scfg.set_state_dir(tempfile.mkdtemp())
    scfg.set_listen_port(options.port)
    scfg.set_overlay(False)
    scfg.set_megacache(False)
    scfg.set_upnp_mode(simpledefs.UPNPMODE_DISABLED)
    scfg.set_dialback(False)
    scfg.set_social_networking(False)
    scfg.set_buddycast(False)
    scfg.set_crawler(False)
    scfg.set_internal_tracker(False)

    s = Session(scfg)

    tdef = TorrentDef.load(__TORRENT_FILE__)
# tdef.get_tracker() returns the announce-url; we must omit the "announce" part
    tracker_url = tdef.get_tracker()[:tdef.get_tracker().find("announce")]
Exemplo n.º 4
0
                      default="vodclient")
    parser.add_option("-p", "--port", type="int", dest="port", default=5000)
    parser.add_option("-t", "--torrent", dest="torrent", default=None)
    parser.add_option("-x", "--dlrate", type="int", dest="dlrate", default=128)
    parser.add_option("-y", "--ulrate", type="int", dest="ulrate", default=128)
    parser.add_option("-l", "--logfile", dest="logfile", default=None)

    (options, args) = parser.parse_args()

    print >> sys.stderr, "download rate is: %i" % options.dlrate

    __TORRENT_FILE__ = options.torrent
    __LOGFILE__ = options.logfile or 'vodclient.log'

    scfg = SessionStartupConfig()
    scfg.set_state_dir(tempfile.mkdtemp())
    scfg.set_listen_port(options.port)
    scfg.set_overlay(False)
    scfg.set_megacache(False)
    scfg.set_upnp_mode(simpledefs.UPNPMODE_DISABLED)
    scfg.set_dialback(False)
    scfg.set_social_networking(False)
    scfg.set_buddycast(False)
    scfg.set_crawler(False)
    scfg.set_internal_tracker(False)

    s = Session(scfg)

    tdef = TorrentDef.load(__TORRENT_FILE__)
    # tdef.get_tracker() returns the announce-url; we must omit the "announce" part
    tracker_url = tdef.get_tracker()[:tdef.get_tracker().find("announce")]