add remote torrent from IPAD

somus1735

Member
May 25, 2018
833
0
16
Im migrating from transmission to rtorrent in raspberry pi due to better cpu usage, much more features, stability and other advantages...

My only missfunction over transmission is to "add torrents from ipad".

I have get the code of bookmarklet for transmission (supported on Safari), and modify it with rutorrent webui...
Thats the code you have to paste on a safari bookmark you create (please, remember you need to change ip address "192.168.1.7" with your own)...

Code:
javascript:(function()%7Bvar%20versionNum%20=%20%220.8%22;var%20serverAddress%20=%20%22192.168.1.7%22;function%20LipoCookie()%7Bvar%20sCookie%20=%22%22;var%20aCookie%20=%20document.cookie.split(/;%5B%5Cs%5CxA0%5D*/);if%20(aCookie%20!=%20%22%22)%7Bfor%20(var%20i=0;%20i%20%3C%20aCookie.length;%20i++)%7Bif%20(aCookie%5Bi%5D.search(/(%5E__utm%7C%5E__qc)/)%20==%20-1)%7BsCookie%20=%20sCookie%20+%20aCookie%5Bi%5D%20+%20%27;%20%27;%7D%7D%7DsCookie=sCookie.replace(/;%5Cs+$/,%22%22);return%20sCookie;%7Dvar%20cookieString%20=%20LipoCookie();var%20a=document.getElementsByTagName(%27a%27);for(var%20i=0,j=a.length;i%3Cj;i++)%7Bvar%20linkurl%20=%20a%5Bi%5D.href;var%20testUrl%20=%20linkurl.substring(linkurl.lastIndexOf(%27/%27)%20+%201,%20linkurl.length);var%20testResult%20=%20testUrl.search(/(%5C.torrent$)/i);if%20(testResult%20==%20-1)%7Bvar%20testResult%20=%20linkurl.search(/(magnet:%5C?%7C%5C/get%7C%5C/download%7C%5C/dl%7C%5C/torrent)/i);%7Dif%20(testResult%20!=%20-1)%7Ba%5Bi%5D.setAttribute(%27target%27,%27_blank%27);a%5Bi%5D.setAttribute(%27href%27,%22http://%22%20+%20serverAddress%20+%20%22/php/addtorrent.php?url=%22%20+%20encodeURIComponent(linkurl)%20+%20%22&:COOKIE:%22%20+%20encodeURIComponent(cookieString)%20);var%20img=document.createElement(%27img%27);img.setAttribute(%27class%27,%20%27new-window%27);img.setAttribute(%27src%27,%27data:image/gif;base64,%27+%27R0lGODlhEAAMALMLAL66tBISEjExMdTQyBoaGjs7OyUlJWZmZgAAAMzMzP///////wAAAAAAAAAAAAAA%27+%27ACH5BAEAAAsALAAAAAAQAAwAAAQ/cMlZqr2Tps13yVJBjOT4gYairqohCTDMsu4iHHgwr7UA/LqdopZS%27+%27DBBIpGG5lBQH0GgtU9xNJ9XZ1cnsNicRADs=%27);img.setAttribute(%27style%27,%27width:16px!important;height:12px!important;border:none!important;%27);a%5Bi%5D.appendChild(img);%7D%7D%7D)();

When you are browsing (safari) over torrent sites, when you press the bookmark button (i.e named "torrent2ru") , the code put a little link for each torrent link, and pressing this... it send it to the rutorrent running in the raspberry.

This little code could be a simple solution for other webbrowsers that support bookmarklets but no plugins/extensions.

Now, please helpme to improve... Could be great to apply tags and download_dirs, and have diferent bookmarks for i.e tvshows, movies, other... (if you use xbmc you know why I want this...)
 

dsouvik215

Member
May 25, 2018
896
0
16
Hello.
I have succesfully used this bookmarket (without cookies) with rutorrent....

Im going to post a more standar configuration code (rutorrent web uri).
Please remember change IP address of your sever (in red). Copy from here and paste on ipad safari bookmark...

javascript:(function()%7Bvar%20versionNum%20=%20%220.8%22;var%20serverAddress%20=%20%22192.168.1.7%22;function%20LipoCookie()%7Bvar%20sCookie%20=%22%22;var%20aCookie%20=%20document.cookie.split(/;%5B%5Cs%5CxA0%5D*/);if%20(aCookie%20!=%20%22%22)%7Bfor%20(var%20i=0;%20i%20%3C%20aCookie.length;%20i++)%7Bif%20(aCookie%5Bi%5D.search(/(%5E__utm%7C%5E__qc)/)%20==%20-1)%7BsCookie%20=%20sCookie%20+%20aCookie%5Bi%5D%20+%20%27;%20%27;%7D%7D%7DsCookie=sCookie.replace(/;%5Cs+$/,%22%22);return%20sCookie;%7Dvar%20cookieString%20=%20LipoCookie();var%20a=document.getElementsByTagName(%27a%27);for(var%20i=0,j=a.length;i%3Cj;i++)%7Bvar%20linkurl%20=%20a%5Bi%5D.href;var%20testUrl%20=%20linkurl.substring(linkurl.lastIndexOf(%27/%27)%20+%201,%20linkurl.length);var%20testResult%20=%20testUrl.search(/(%5C.torrent$)/i);if%20(testResult%20==%20-1)%7Bvar%20testResult%20=%20linkurl.search(/(magnet:%5C?%7C%5C/get%7C%5C/download%7C%5C/dl%7C%5C/torrent)/i);%7Dif%20(testResult%20!=%20-1)%7Ba%5Bi%5D.setAttribute(%27target%27,%27_blank%27);a%5Bi%5D.setAttribute(%27href%27,%22http://%22%20+%20serverAddress%20+%20%22/rutorrent/php/addtorrent.php?url=%22%20+%20encodeURIComponent(linkurl)%20+%20%22&:COOKIE:%22%20+%20encodeURIComponent(cookieString)%20);var%20img=document.createElement(%27img%27);img.setAttribute(%27class%27,%20%27new-window%27);img.setAttribute(%27src%27,%27data:image/gif;base64,%27+%27R0lGODlhEAAMALMLAL66tBISEjExMdTQyBoaGjs7OyUlJWZmZgAAAMzMzP///////wAAAAAAAAAAAAAA%27+%27ACH5BAEAAAsALAAAAAAQAAwAAAQ/cMlZqr2Tps13yVJBjOT4gYairqohCTDMsu4iHHgwr7UA/LqdopZS%27+%27DBBIpGG5lBQH0GgtU9xNJ9XZ1cnsNicRADs=%27);img.setAttribute(%27style%27,%27width:16px!important;height:12px!important;border:none!important;%27);a%5Bi%5D.appendChild(img);%7D%7D%7D)();


This video show howto create the bookmarklet on the ipad/iphone...
http://www.youtube.com/watch?v=Ne01euV16mY