Beispiel #1
0
    def get(self):
        chk = _check.web(self)
        if not chk[0]:
            self.write(self.application._pyrtL.loginHTML(chk[1]))
            return
        elif chk[0] and chk[1]:
            self.set_cookie(
                "sess_id",
                self.application._pyrtL.sendCookie(self.request.remote_ip))

        view = self.get_argument("view", None)
        sortby = self.get_argument("sortby", None)
        reverse = self.get_argument("reverse", None)

        if not view or view not in [
                "main", "started", "stopped", "complete", "incomplete",
                "hashing", "seeding", "active"
        ]:
            view = "main"
        if not sortby:
            sortby = "none"

        handler = torrentHandler.Handler()

        torrentList = self.application._pyrtRT.getTorrentList2(view)
        self.write(handler.torrentHTML(torrentList, sortby, view, reverse))
        self.set_header("Cache-Control", "no-cache")
Beispiel #2
0
 def __init__(self, conf=config.Config(), RT=None, aliases=None):
     self.Config = conf
     if not RT:
         self.RT = rtorrent.rtorrent(self.Config.get("rtorrent_socket"))
     else:
         self.RT = RT
     self.handler = torrentHandler.Handler()
     self.aliases = aliases
Beispiel #3
0
    def get(self):
        view = self.get_argument("view", None)
        sortby = self.get_argument("sortby", None)
        reverse = self.get_argument("reverse", None)

        if not view or view not in [
                "main", "started", "stopped", "complete", "incomplete",
                "hashing", "seeding", "active"
        ]:
            view = "main"
        if not sortby:
            sortby = "none"

        handler = torrentHandler.Handler()

        torrentList = self.application._pyrtRT.getTorrentList2(view)
        self.write(handler.torrentHTML(torrentList, sortby, view, reverse))
        self.set_header("Cache-Control", "no-cache")
Beispiel #4
0
 def __init__(self, conf=config.Config(), RT=None, Log=None, Sockets=None, Aliases=None, DLHandler=None):
     self.config = conf
     if not RT:
         self.RT = rtorrent.rtorrent(self.config.get("rtorrent_socket"))
     else:
         self.RT = RT
     self.handler = torrentHandler.Handler()
     self.login = login.Login(conf=self.config)
     self.log = Log
     self.sockets = Sockets
     self.aliases = Aliases
     self.downloadHandler = DLHandler
     self.public_commands = {
         "get_torrent_info" : Handle(self.get_torrent_info, ["torrent_id"], ["html"]),
         "get_info_multi" : Handle(self.get_info_multi, ["view"], ["sortby", "reverse", "drop_down_ids"]),
         "get_torrent_row" : Handle(self.get_torrent_row, ["torrent_id"]),
         "pause_torrent" : Handle(self.pause_torrent, ["torrent_id"]),
         "stop_torrent" : Handle(self.stop_torrent, ["torrent_id"]),
         "start_torrent" : Handle(self.start_torrent, ["torrent_id"]),
         "remove_torrent" : Handle(self.remove_torrent, ["torrent_id"]),
         "delete_torrent" : Handle(self.delete_torrent, ["torrent_id"]),
         "hash_torrent" : Handle(self.hash_torrent, ["torrent_id"]),
         "get_file" : Handle(self.get_file, ["torrent_id", "filepath"]),
         "upload_torrent_socket" : Handle(self.upload_torrent_socket, ["torrent"], ["start"]),
         "upload_torrent" : Handle(self.upload_torrent, [], ["torrent", "start"]),
         "get_feeds" : Handle(self.get_feeds),
         "start_batch" : Handle(self.start_batch, ["torrentIDs"]),
         "pause_batch" : Handle(self.pause_batch, ["torrentIDs"]),
         "stop_batch" : Handle(self.stop_batch, ["torrentIDs"]),
         "remove_batch" : Handle(self.remove_batch, ["torrentIDs"]),
         "delete_batch" : Handle(self.delete_batch, ["torrentIDs"]),
         "get_tracker_favicon" : Handle(self.get_tracker_favicon, ["torrent_id"]),
         "verify_conf_value" : Handle(self.verify_conf_value, ["key", "value"]),
         "set_config_multiple" : Handle(self.set_config_multiple, ["keys","values"]),
         "get_refresh_rate" : Handle(self.getRefreshRate),
         "move_tracker" : Handle(self.moveTracker, ["url", "target_alias"]),
         "download_file" : Handle(self.downloadGen, ["torrentID", "path"]),
     }
Beispiel #5
0
 def __init__(self, login, log, remoteStorage):
     self.LOGIN = login
     self.LOG = log
     self.STORE = remoteStorage
     self.HANDLER = torrentHandler.Handler()
     self.METHODS = {
         "get_sources" : self.get_sources,
         "get_source_single" : self.get_source_single,
         "set_source" : self.set_source,
         "start_bot" : self.start_bot,
         "stop_bot" : self.stop_bot,
         "get_filters" : self.get_filters,
         "add_filter" : self.add_filter,
         "remove_filter" : self.remove_filter,
         "get_rss" : self.get_rss,
         "add_rss" : self.add_rss,
         "remove_rss" : self.remove_rss,
         "enable_rss" : self.enable_rss,
         "disable_rss" : self.disable_rss,
         "add_rss_filter" : self.add_rss_filter,
         "remove_rss_filter" : self.remove_rss_filter,
         "get_rss_single" : self.get_rss_single,
         "get_rss_filters" : self.get_rss_filters,
     }