Skip to main content

Warning: count(): Parameter must be an array or an object that implements Countable in C:\home\site\wwwroot\gs\plugins\i18n_navigation\frontend.class.php on line 219

Autologin to private trackers

Make a file named grtlogin.sh inside /home/username directory. Inside the file put the following lines making the necessary changes to use your credentials.

#!/bin/sh
curl -b /tmp/cookies.txt --user-agent Mozilla/4.0 http://www.thegt.net/login.php -c /tmp/cookies.txt -d "username=<Type your username here>&password=<Type your password here>&take_login=1"  http://www.thegt.net/browse.php -vL > /dev/null

Open the terminal and execute the following command to make /home/username/grtlogin.sh executable: sudo chmod +x /home/username/grtlogin.sh

Comments:
You can execute the above script without the #!/bin/sh inside the terminal to find out what is being downloaded.
If you remove the "> /dev/null", you will see the source code of the downloaded pages.
The above script uses curl to login to login.php and then download browse.php.

After we have tested our script we should make a cron job to set it run occasionally.

  1. Execute the following command: crontab -e
  2. After the last line paste:
    */5 * * * * /home/username/grtlogin.sh
  3. Press Ctrl+Ο and then Enter to save, Ctrl+X to close the editor.

Now, the script should run every 5 minutes.

Note: Cron can dispatch an email for every result it gets from the cron jobs. If you execute mail you can review all the sent mail. Because the grtlogin.sh returns a result every 5 minutes it could be very annoying. It would be better then to use for grtlogin.sh the following code instead:

curl -b /tmp/cookies.txt --user-agent Mozilla/4.0 http://www.thegt.net/login.php -c /tmp/cookies.txt -d "username=<Type your username here>&password=<Type your password here>&take_login=1"  http://www.thegt.net/browse.php -SsL > /dev/null

With the above script, curl and mail won't return anything unless there was some kind of error such as "server not found". Unfortunately, unsuccessful logins can't be logged.