Skip to content

Reconnect

Jonas edited this page Apr 29, 2016 · 2 revisions

Term

The term “Reconnect” means the delink and rebuild of the Internet connection. In this way you get a new IP-Adress from your Internet-Provider, thus means that the Filehoster does not recognize you anymore and you don`t have to take waiting time between the Downloads.

Reconnect-Methods

The Reconnect-Method is standardly loaded from the reconnect.sh, that you need to create in the pyload directory

The Method is generally a shell script containing CURL commands asking to your routers to reset the Internet connection.

For many routers you only need some curl commands in the script, you find them for many routers here: http://reconnect.thau-ex.de/zyxel/

Location of script

The reconnect script can be anywhere !

pyload will first check if the config value of “Method” corresponds to an existing file (= full path e.g. /home/user/scripts/reconnect.sh). If it failed, pyload will do a second check where it appends the pyload directory path (e.g. /opt/pyload/) before the value of the “Method” e.g. ”./reconnect.sh” → ”/opt/pyload/./reconnect.sh”.

The dot (in default configuration) represents the pyload directory where pyLoadCore.py is.

Example of Method configuration:

  • /home/user/script/reconnect.sh: Full path to reconnect.sh script in directory /home/user/script
  • ./reconnect.sh: Relative path to reconnect.sh script in the pyload directory.

Triggering of reconnect

pyload constantly checks if a reconnect is required. pyload triggers a reconnect (=calls the reconnect script) only if these conditions are satisfied:

  1. The reconnect option is activated
  2. The reconnect time is statisfied
  3. All threads (= current downloads) are waiting for a reconnect. A thread is marked “Want to reconnect” if the plugin did it. Example: Megaupload plugin handles message “You reached the download limit” and marks the active download as “Want to reconnect”
  4. The reconnect script exists

If all conditions statisfy, the following sequence is executed:

  1. the hook “before reconnect”
  2. the reconnect script
  3. the hook “after reconnect” is executed.

Reconnect time

“Start” and “End” configuration values define a range of time in which a reconnect can occur.

Three solutions:

  • IN range: If Start value is lesser than End value (e.g. Start=7:00; End=10:00) then the reconnect occurs only if the current time (time when the reconnect conditions are checked) is within the range [Start-End]. Occurs if current time is between 7:00 and 10:00. E.g.: 9:30

  • OUT range: If Start value is greater than End value (e.g. Start=10:00; End=7:00) then the reconnect occurs only if the current time (time when the reconnect conditions are checked) is NOT within the range [Start-End]. Occurs if current time is NOT between 7:00 and 10:00. E.g.: 5:30

  • ALWAYS: if Start value is equals to End value (e.g.: Start=0:00; End=0:00) then the reconnect can occur. The current time is not checked.

FAQ

What's going on if a reconnect “needs” to be triggered and there are still working downloads ? pyload waits than all downloads are finished before triggering? Or does not care and the downloads will restart ?

A condition of the reconnect is: All threads must be in state “Want to reconnect”. If at least one thread does not have the state “Want to reconnect” then the reconnect does not occur.

Clone this wiki locally