Kodi Community Forum
Win HOW-TO get uTorrent to tell XBMC to update its library - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Tips, tricks, and step by step guides (https://forum.kodi.tv/forumdisplay.php?fid=110)
+--- Thread: Win HOW-TO get uTorrent to tell XBMC to update its library (/showthread.php?tid=87472)

Pages: 1 2 3 4 5 6 7 8


RE: [WINDOWS] HOW-TO get uTorrent to tell XBMC to update its library - crimsonfury - 2012-10-18

(2012-08-05, 03:33)achaw Wrote: Someone else are losing xbmc focus when the script es executed?

PS: I response myself, is a utorrent problem....when a toorrent is added xbmc lose focus...

What is the fix for this?

I have utorrent use the commands to open winrar and unrar all of my tv shows in their folders and then Sickbeard scans the download folder and grabs all shows and info and renames and sorts to the correct show folder elsewhere. It all works great, except....

Every time utorrent uses winrar it automatically minimizes XBMC.... How do I make XBMC full control with no minimizing or what cmd can I add to utorrent?


RE: [WINDOWS] HOW-TO get uTorrent to tell XBMC to update its library - bboo - 2012-11-02

Can i use this without using all those labels and "move completed to" options? Can i just tell XBMC to update itself once a torrent finishes downloading?


RE: [WINDOWS] HOW-TO get uTorrent to tell XBMC to update its library - watzen - 2012-11-03

(2012-11-02, 21:18)bboo Wrote: Can i use this without using all those labels and "move completed to" options? Can i just tell XBMC to update itself once a torrent finishes downloading?

Yes, but you need to edit out the parts that refer to updating a specific directory, the script gets a lot simpler that way:

Haven't tried this, but it should work. Just add the file in run on completed torrent. No parameters needed
Code:
Dim objSvrHTTP
Dim connectionString
Dim JSONstring
Dim xbmcConnection
Set objSvrHTTP = CreateObject("MSXML2.XMLHTTP")

On Error Resume Next
'edit this line to work with your setup
xbmcConnection = "http://xbmc:xbmc@localhost/jsonrpc?request="

'if the first argument is -U (for update) then it performs the update procedure and sends a notification to xbmc.
if WScript.Arguments.Item(0) = "-U" then
    'Send a command to xbmc that tells it to update
    JSONstring = URLEncode(Replace("{''jsonrpc'':''2.0'',''method'':''VideoLibrary.Scan'',''id'':1}","''",Chr(34)))
    connectionString =  xbmcConnection & JSONstring
    WScript.Sleep 1000 * 10
    objSvrHTTP.open "GET", connectionString, False
    objSvrHTTP.send    
End if

Function URLEncode(ByVal str)
Dim strTemp, strChar
Dim intPos, intASCII
strTemp = ""
strChar = ""
For intPos = 1 To Len(str)
  intASCII = Asc(Mid(str, intPos, 1))
  If intASCII = 32 Then
   strTemp = strTemp & "+"
  ElseIf ((intASCII < 123) And (intASCII > 96)) Then
   strTemp = strTemp & Chr(intASCII)
  ElseIf ((intASCII < 91) And (intASCII > 64)) Then
   strTemp = strTemp & Chr(intASCII)
  ElseIf ((intASCII < 58) And (intASCII > 47)) Then
   strTemp = strTemp & Chr(intASCII)
  Else
   strChar = Trim(Hex(intASCII))
   If intASCII < 16 Then
    strTemp = strTemp & "%0" & strChar
   Else
    strTemp = strTemp & "%" & strChar
   End If
  End If
Next
URLEncode = strTemp
End Function

As some may notice in the above post is that I've replaced the HTTP-API code that is now depreciated in the latest nightly builds of xbmc. I have replaced it with JSON requests instead. The original post has been updated with a new version.


RE: [WINDOWS] HOW-TO get uTorrent to tell XBMC to update its library - bboo - 2012-11-05

Thanks for that! I'm really new to all this so i would appreciate some more assistance. Which lines exactly do i need to change and how?



RE: [WINDOWS] HOW-TO get uTorrent to tell XBMC to update its library - Calleja - 2013-01-07

The script stopped working for Frodo, it seems Sad

Any updates we could apply?


RE: HOW-TO get uTorrent to tell XBMC to update its library - zilexa - 2013-01-29

why use a 3rd program like Sickbeard or Couchpotato if uTorrent can handle everything (scanning rssfeed for new eps, downloading them to the right folders) and ping XBMC when a torrent is finished?


RE: HOW-TO get uTorrent to tell XBMC to update its library - Calleja - 2013-01-29

(2013-01-29, 01:45)zilexa Wrote: why use a 3rd program like Sickbeard or Couchpotato if uTorrent can handle everything (scanning rssfeed for new eps, downloading them to the right folders) and ping XBMC when a torrent is finished?

I can't get utorrent to ping XBMC since Frodo, though



RE: HOW-TO get uTorrent to tell XBMC to update its library - User 158657 - 2013-02-20

The api for the web interface has changed, all we can do is wait for somone to come along and update the script for Frodo Smile


RE: HOW-TO get uTorrent to tell XBMC to update its library - Pillzbury - 2013-02-20

My version of this script works on frodo. It is based on this script, but I've changed it around a bit. Details here:
http://forum.xbmc.org/showthread.php?tid=120615

Also, watzens version on the first page was updated back in November with support for frodo.