On certain events the scripts are executed, they receive information about event, do certain work and can communicate with NZBGet to give it instructions for further processing. NZBGet provides documented entry points for scripts. if someone stops or pauses their stream, It removes any throttle applied to the NZB downloader.The core functionality of NZBGet can be extended using extension scripts. does it set download speed to max again even though someone is still watching or does it have some kind of control via the number of streams? like it knows someone is still watching so it doesn't set it to max again.Įdit: I have now tested and it doesn't matter if someone is still watching or not. then one user decides to stop streaming and a command is sent to unthrottle. Then another user joins in and a command is sent to throttle but its throttled already so that's OK. So if there are no streams it is at max (defined by the user).ġ stream = 80% of max (or value set by the user)Ģ stream = 70% of max (or value set by the user)ģ stream = 60% of max (or value set by the user)Ĥ stream = 50% of max (or value set by the user)ĥ stream = pause downloads (or value set by the user)Īlso, not tested this but if one user starts to play something, it throttles obviously. Is there any way to get this to limit to streams rather than just play/pause/stop/resume triggers? # should this be added to a current pause or add to current pause? Help = 'Number of max streams before we reduce the speed')Ĭlient = Sab( host = p. add_argument( '-mts', '-max_transcode_sessions', action = 'store', default = max_transcode_sessions, add_argument( '-rts', '-remote_transcode_speed', action = 'store', default = remote_transcode_speed, Help = 'Max speed of your internet connection in kbits') add_argument( '-ms', '-max_speed', action = 'store', default = max_speed, Help = 'Does the the nzb client use ssl?') add_argument( '-ssl', '-ssl', action = 'store_true', default = client_ssl, add_argument( '-wd', '-webdir', action = 'store', default = client_webdir, add_argument( '-pass', '-password', action = 'store', default = client_password, add_argument( '-u', '-username', action = 'store', default = client_username, add_argument( '-api', '-apikey', action = 'store', default = client_apikey, add_argument( '-p', '-port', action = 'store', default = client_port, add_argument( '-host', '-host', action = 'store', default = client_host, Help = 'Number of minutes the client is paused') add_argument( '-t', '-time', action = 'store', default = pause_for, type = int, Help = 'notify_action argument from plexpy') add_argument( '-a', '-action', action = 'store', default = None, add_argument( '-s', '-speed', action = 'store', default = reduce_speed_to, type = int, Help = 'stream_count argument from plexpy') add_argument( '-sc', '-stream_count', action = 'store', default = 0, type = int, Help = 'Choose download client, sabznbd or nzbget') add_argument( '-c', '-client', action = 'store', default = i_use, If i_use = 'sabnzbd' and 'nzbget' not in sys. scheduleresume( mins) # convert from minutes to sec Print( "Changed speed to %s kbit \'s" % speed) url = 'http%s://%s%s:%s%sjsonrpc' % ( ssl, authstring, host, port, webdir) Print( 'Resuming downloading with sabznbd')ĭef _init_( self, username, password, host, port, ssl, webdir): request( 'mode=config&name=set_pause&value=' + str( minutes)) Print( "Pausing sabnzbd for %s minutes" % minutes) request( 'mode=config&name=speedlimit&value=' + str( speed)) Print( "Changed sabznbd speed to %s" % speed) url = 'http%s://%s:%s%sapi?output=json&apikey=%s&' % ( ssl, host, port, webdir, apikey) Nzbget_webdir = '/' # default webdir is '/' Nzbget_password = 'tegbzn6789 ' # default password Nzbget_username = 'nzbget' # Default username Sabnzbd_webdir = '/sabnzbd/' # Default is '/sabnzbd/' Max_transcode_sessions = None # Number of streams before we do something, int or None to disable Remote_transcode_speed = None # remote transcode session speed in plex or None to disable Pause_for = None # int minutes or None to disable Max_speed = 10000 # bandwidth from isp in kbits Python throttle_nzbclient.py -c sabnzbd -h 10.0.0.97 -p 8085 -api 1234 -t 60 # pauses sab for 60 minutes It can also be used as a commandline tool: No arguments will simply reduce the speed Simple script to throttle nzb clients for plexpy From jsonrpclib import jsonrpc # pip install jsonrpclib-pelix
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |