The branch, dharma has been updated
       via  ab72ec3ad84696ed92183261c0623ccd632efcd5 (commit)
       via  0d7f26725718a625571cf451dd5ec2c0e1fb272f (commit)
      from  5d26709831bd4cb667619fcc1461d4ba4d431fe3 (commit)

- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=ab72ec3ad84696ed92183261c0623ccd632efcd5

commit ab72ec3ad84696ed92183261c0623ccd632efcd5
Author: amet <[email protected]>
Date:   Sun Dec 25 21:20:29 2011 +0400

    [script.xbmc.subtitles] -v 2.5.16
    
    - fix: Subscenter service version 1.3 - Fixed null values in website 
dictionary, thx orivar
    - fix: Subdivix, thx Enric Godes

diff --git a/script.xbmc.subtitles/addon.xml b/script.xbmc.subtitles/addon.xml
index 53f5dcc..f510cb2 100644
--- a/script.xbmc.subtitles/addon.xml
+++ b/script.xbmc.subtitles/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="script.xbmc.subtitles"
        name="XBMC Subtitles"
-       version="2.5.15"
+       version="2.5.16"
        provider-name="Amet, mr_blobby">
   <requires>
     <import addon="xbmc.python" version="1.0"/>
diff --git a/script.xbmc.subtitles/changelog.txt 
b/script.xbmc.subtitles/changelog.txt
index a685d01..efede87 100644
--- a/script.xbmc.subtitles/changelog.txt
+++ b/script.xbmc.subtitles/changelog.txt
@@ -1,3 +1,7 @@
+2.5.16
+- fix: Subscenter service version 1.3 - Fixed null values in website 
dictionary, thx orivar
+- fix: Subdivix, thx Enric Godes
+
 2.5.15
 - fixed: Subcenter, thx orivar
 
diff --git a/script.xbmc.subtitles/resources/lib/services/Subdivx/service.py 
b/script.xbmc.subtitles/resources/lib/services/Subdivx/service.py
index 2caa84e..5a8d459 100644
--- a/script.xbmc.subtitles/resources/lib/services/Subdivx/service.py
+++ b/script.xbmc.subtitles/resources/lib/services/Subdivx/service.py
@@ -36,7 +36,7 @@ subtitle_pattern =  
"<div\sid=\"buscador_detalle_sub\">(.+?)</div><div\sid=\"bus
 def getallsubs(searchstring, languageshort, languagelong, file_original_path, 
subtitles_list):
     page = 1
     if languageshort == "es":
-        url = main_url + "index.php?accion=5&masdesc=&oxdown=1&pg=" + 
str(page) + "&buscar=" + urllib.quote_plus(searchstring)
+        url = main_url + "index.php?accion=5&masdesc=&oxfecha=2&pg=" + 
str(page) + "&buscar=" + urllib.quote_plus(searchstring)
 
     content = geturl(url)
     log( __name__ ,"%s Getting '%s' subs ..." % (debug_pretext, languageshort))
@@ -61,7 +61,7 @@ def getallsubs(searchstring, languageshort, languagelong, 
file_original_path, su
             log( __name__ ,"%s Subtitles found: %s (id = %s)" % 
(debug_pretext, filename, id))
             subtitles_list.append({'rating': str(downloads), 'no_files': 
no_files, 'filename': filename, 'sync': sync, 'id' : id, 'server' : server, 
'language_flag': 'flags/' + languageshort + '.gif', 'language_name': 
languagelong})
         page = page + 1
-        url = main_url + "index.php?accion=5&masdesc=&oxdown=1&pg=" + 
str(page) + "&buscar=" + urllib.quote_plus(searchstring)
+        url = main_url + "index.php?accion=5&masdesc=&oxfecha=2&pg=" + 
str(page) + "&buscar=" + urllib.quote_plus(searchstring)
         content = geturl(url)
 
     # Bubble sort, to put syncs on top
diff --git a/script.xbmc.subtitles/resources/lib/services/Subscenter/service.py 
b/script.xbmc.subtitles/resources/lib/services/Subscenter/service.py
index 7473991..d7fbc51 100644
--- a/script.xbmc.subtitles/resources/lib/services/Subscenter/service.py
+++ b/script.xbmc.subtitles/resources/lib/services/Subscenter/service.py
@@ -2,11 +2,12 @@
 
 
#===============================================================================
 # Subscenter.org subtitles service.
-# Version: 1.2
+# Version: 1.3
 #
 # Change log:
 # 1.1 - Fixed downloading of non-Hebrew subtitles.
 # 1.2 - Added key field for download URL
+# 1.3 - Fixed null values in website dictionary (changed to None)
 #
 # Created by: Ori Varon
 
#===============================================================================
@@ -76,6 +77,8 @@ def 
getAllSubtitles(subtitlePageID,languageList,subtitlesList):
     toExec = "foundSubtitles = "+subtitlePage[tempStart+len("subtitles_groups 
= "):tempEnd]
     # Remove junk at the end of the line
     toExec = toExec[:toExec.rfind("}")+1]
+    # Replace "null" with "None"
+    toExec = toExec.replace("null","None")
     exec(toExec)
     log( __name__ ,"Built webpage dictionary")
     for language in foundSubtitles.keys():

http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=0d7f26725718a625571cf451dd5ec2c0e1fb272f

commit 0d7f26725718a625571cf451dd5ec2c0e1fb272f
Author: amet <[email protected]>
Date:   Sun Dec 25 21:19:30 2011 +0400

    [script.transmission] -v 0.6.1
    
    * Add torrent button now supports various search sites as well as adding 
locally downloaded .torrent files

diff --git a/script.transmission/addon.xml b/script.transmission/addon.xml
index c8e4c59..d910300 100644
--- a/script.transmission/addon.xml
+++ b/script.transmission/addon.xml
@@ -1,11 +1,12 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="script.transmission"
        name="Transmission"
-       version="0.6.0"
+       version="0.6.1"
        provider-name="Correl Roush">
   <requires>
     <import addon="xbmc.python" version="1.0"/>
     <import addon="script.module.simplejson" version="2.0.9"/>
+    <import addon="script.module.beautifulsoup" version="3.0.8" />
   </requires>
   <extension point="xbmc.python.script"
              library="default.py" />
@@ -13,9 +14,9 @@
     <summary lang="en">A client for the popular Transmission BitTorrent 
application</summary>
     <summary lang="hu">A népszerű Transmission Bittorrent alkalmazás 
vezérlése</summary>
     <summary lang="ca">Un client de Transmission, la popular aplicació de 
Bittorrent</summary>
-    <description>Currently, Transmission-XBMC supports viewing, adding, 
removing, starting and stopping torrents. More advanced features may be added 
in future releases.</description>
+    <description lang="en">Currently, Transmission-XBMC supports viewing, 
adding, removing, starting and stopping torrents. More advanced features may be 
added in future releases.</description>
     <description lang="hu">Jelenleg a Transmission-XBMC képes megnézni, 
hozzáadni, elkezdeni, és megállítani a torrenteket. További fejlesztések 
várhatók a jövőben.</description>
-    <description>Actualment, Transmission-XBMC permet veure, afegir, eliminar, 
iniciar i parar torrents. En futures versions de l'aplicació s'haniran afegint 
opcions més avançades.</description>
+    <description lang="ca">Actualment, Transmission-XBMC permet veure, afegir, 
eliminar, iniciar i parar torrents. En futures versions de l'aplicació 
s'haniran afegint opcions més avançades.</description>
     <platform>all</platform>
   </extension>
 </addon>
diff --git a/script.transmission/changelog.txt 
b/script.transmission/changelog.txt
index 7e491c5..6cfc2f3 100644
--- a/script.transmission/changelog.txt
+++ b/script.transmission/changelog.txt
@@ -1,3 +1,6 @@
+Version 0.6.1
+       * Add torrent button now supports various search sites as well as adding
+         locally downloaded .torrent files
 Version 0.6.0
        * Added icons to buttons (submitted by [email protected])
        * Added Russian language support (submitted by [email protected])
diff --git a/script.transmission/resources/language/English/strings.xml 
b/script.transmission/resources/language/English/strings.xml
index bcd03a4..208966f 100644
--- a/script.transmission/resources/language/English/strings.xml
+++ b/script.transmission/resources/language/English/strings.xml
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <strings>
     <string id="0">Transmission</string>
-    
+
     <string id="1">Connecting to Transmission</string>
     <string id="2">Transmission Error</string>
     <string id="3">Open settings dialog?</string>
-    
+
     <!-- Buttons -->
     <string id="101">Add</string>
     <string id="102">Remove</string>
@@ -14,7 +14,18 @@
     <string id="105">Pause All</string>
     <string id="106">Start All</string>
     <string id="107">Exit</string>
-    
+
+    <!-- Adding / Search -->
+    <string id="200">Browse for torrent file</string>
+    <string id="201">Search BTJunkie.org</string>
+    <string id="202">Search ThePirateBay.org</string>
+    <string id="203">Search Mininova.org</string>
+    <string id="204">Search Torrentreactor.net</string>
+    <string id="290">Searching...</string>
+    <string id="291">No results found</string>
+    <string id="292">Could not connect to search site</string>
+    <string id="293">Could not download torrent data</string>
+
     <!-- Settings -->
     <string id="1000">RPC Settings</string>
     <string id="1001">Host</string>
diff --git a/script.transmission/resources/lib/gui.py 
b/script.transmission/resources/lib/gui.py
index 3ca68e6..a528d11 100644
--- a/script.transmission/resources/lib/gui.py
+++ b/script.transmission/resources/lib/gui.py
@@ -4,10 +4,12 @@
 import os
 import sys
 import base64
+import urllib2
 import xbmc
 import xbmcgui
 from basictypes.bytes import Bytes
 from repeater import Repeater
+import search
 
 _ = sys.modules[ "__main__" ].__language__
 __settings__ = sys.modules[ "__main__" ].__settings__
@@ -39,7 +41,6 @@ class TransmissionGUI(xbmcgui.WindowXMLDialog):
         except:
             p.close()
             self.close()
-            d = xbmcgui.Dialog()
             (type, e, traceback) = sys.exc_info()
 
             message = _(9000) # Unexpected error
@@ -49,17 +50,17 @@ class TransmissionGUI(xbmcgui.WindowXMLDialog):
                         message = _(9002) # Invalid auth
                     else:
                         message = _(9001) # Unable to connect
-                if d.yesno(_(2), message, _(3)):
+                if xbmcgui.Dialog().yesno(_(2), message, _(3)):
                     __settings__.openSettings()
             elif type is ValueError:
                 # In python 2.4, urllib2.HTTPDigestAuthHandler will barf up a 
lung
                 # if auth fails and the server wants non-digest authentication
                 message = _(9002) # Invalid auth
-                if d.yesno(_(2), message, _(3)):
+                if xbmcgui.Dialog().yesno(_(2), message, _(3)):
                     __settings__.openSettings()
             else:
                 message = _(9000) # Unexpected error
-                d.ok(_(2), message)
+                xbmcgui.Dialog().ok(_(2), message)
 
             return False
         p.close()
@@ -107,14 +108,53 @@ class TransmissionGUI(xbmcgui.WindowXMLDialog):
         list = self.getControl(20)
         if (controlID == 11):
             # Add torrent
-            d = xbmcgui.Dialog()
-            filename = d.browse(1, _(0), 'files', '.torrent')
-            try:
-                f = open(filename, 'r')
-                data = base64.b64encode(f.read())
-                self.transmission.add(data)
-            except:
-                pass
+            engines = [
+                (_(200), None),
+                (_(201), search.BTJunkie),
+                (_(202), search.TPB),
+                (_(203), search.Mininova),
+                (_(204), search.TorrentReactor),
+            ]
+            selected = xbmcgui.Dialog().select(_(0), [i[0] for i in engines])
+            if selected < 0:
+                return
+            engine = engines[selected][1]
+            if not engine:
+                filename = xbmcgui.Dialog().browse(1, _(0), 'files', 
'.torrent')
+                try:
+                    f = open(filename, 'r')
+                    data = base64.b64encode(f.read())
+                    self.transmission.add(data)
+                except:
+                    pass
+            else:
+                kb = xbmc.Keyboard('', engines[selected][0])
+                kb.doModal()
+                if not kb.isConfirmed():
+                    return
+                terms = kb.getText()
+                p = xbmcgui.DialogProgress()
+                p.create(_(0), _(290))
+                try:
+                    results = engine().search(terms)
+                except:
+                    p.close()
+                    xbmcgui.Dialog().ok(_(0), _(292))
+                    return
+                p.close()
+                if not results:
+                    xbmcgui.Dialog().ok(_(0), _(291))
+                    return
+                selected = xbmcgui.Dialog().select(_(0), ['[S:%d L:%d] %s' % 
(t['seeds'], t['leechers'], t['name']) for t in results])
+                if selected < 0:
+                    return
+                try:
+                    f = urllib2.urlopen(results[selected]['url'])
+                    data = base64.b64encode(f.read())
+                    self.transmission.add(data)
+                except:
+                    xbmcgui.Dialog().ok(_(0), _(293))
+                    return
         if (controlID == 12):
             # Remove selected torrent
             item = list.getSelectedItem()
@@ -130,7 +170,6 @@ class TransmissionGUI(xbmcgui.WindowXMLDialog):
             # Start selected torrent
             item = list.getSelectedItem()
             if item:
-                t = int(item.getProperty('TorrentID'))
                 self.transmission.start(int(item.getProperty('TorrentID')))
         if (controlID == 15):
             # Stop all torrents

-----------------------------------------------------------------------

Summary of changes:
 script.transmission/addon.xml                      |    7 +-
 script.transmission/changelog.txt                  |    3 +
 .../resources/language/English/strings.xml         |   17 +++-
 script.transmission/resources/lib/gui.py           |   65 +++++++++++---
 script.transmission/resources/lib/search.py        |   94 ++++++++++++++++++++
 script.xbmc.subtitles/addon.xml                    |    2 +-
 script.xbmc.subtitles/changelog.txt                |    4 +
 .../resources/lib/services/Subdivx/service.py      |    4 +-
 .../resources/lib/services/Subscenter/service.py   |    5 +-
 9 files changed, 178 insertions(+), 23 deletions(-)
 create mode 100644 script.transmission/resources/lib/search.py


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to