Beispiel #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)
 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)
    (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")]

    if tdef.get_bitrate() == None:
        print >>sys.stderr, "Provided torrent file has no bitrate information. Exiting."
        sys.exit(1)

    BITRATE = tdef.get_bitrate()
    print >>sys.stderr, "Calculated bitrate is %d" % BITRATE
Beispiel #4
0
    (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")]

    if tdef.get_bitrate() == None:
        print >> sys.stderr, "Provided torrent file has no bitrate information. Exiting."
        sys.exit(1)

    BITRATE = tdef.get_bitrate()
    print >> sys.stderr, "Calculated bitrate is %d" % BITRATE