The branch, dharma has been updated
       via  ef1593bdddb0d81dc20d4844a57d7b1011cc0fa3 (commit)
       via  de1a4fcad8cc87b85ac8eb4b0d92d6460a9ba345 (commit)
       via  b979ff03490d786c27a7c919aedd2554b843feb3 (commit)
      from  5a498d9ee3340ba1a15b12d9e3f4eb432a9a1c29 (commit)

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

commit ef1593bdddb0d81dc20d4844a57d7b1011cc0fa3
Author: spiff <[email protected]>
Date:   Tue Dec 6 20:48:08 2011 +0100

    [plugin.video.leafstv] initial version for dharma (0.0.3). thanks to Micah 
Galizia

diff --git a/.gitignore b/.gitignore
index ce8fd1f..596d484 100644
--- a/.gitignore
+++ b/.gitignore
@@ -84,3 +84,4 @@ plugin.video.newyorktimes/.git
 plugin.video.newyorktimes/.gitignore
 plugin.video.happymtb/.git
 plugin.video.tmz/.git
+plugin.video.leafstv/.git

http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=de1a4fcad8cc87b85ac8eb4b0d92d6460a9ba345

commit de1a4fcad8cc87b85ac8eb4b0d92d6460a9ba345
Author: spiff <[email protected]>
Date:   Tue Dec 6 20:46:46 2011 +0100

    [plugin.video.tmz] initial version (1.2.0). thanks to stacked

diff --git a/.gitignore b/.gitignore
index 443c652..ce8fd1f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -83,3 +83,4 @@ plugin.video.collegehumor/.git
 plugin.video.newyorktimes/.git
 plugin.video.newyorktimes/.gitignore
 plugin.video.happymtb/.git
+plugin.video.tmz/.git

http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=b979ff03490d786c27a7c919aedd2554b843feb3

commit b979ff03490d786c27a7c919aedd2554b843feb3
Author: spiff <[email protected]>
Date:   Tue Dec 6 20:43:48 2011 +0100

    [plugin.video.youtube] updated to version 2.1.3

diff --git a/plugin.video.youtube/YouTubeCore.py 
b/plugin.video.youtube/YouTubeCore.py
index 0440e84..75ec199 100755
--- a/plugin.video.youtube/YouTubeCore.py
+++ b/plugin.video.youtube/YouTubeCore.py
@@ -458,9 +458,10 @@ class YouTubeCore(object):
                                 self._httpLogin()
 
                         if self.__settings__.getSetting("login_info") != "":
-                               print self.__plugin__ + "returning existing 
login info: " + self.__settings__.getSetting("login_info")
                                 info = 
self.__settings__.getSetting("login_info")
-                                request.add_header('Cookie', 'LOGIN_INFO=' + 
info)
+                                SID = self.__settings__.getSetting("SID")
+                               print self.__plugin__ + "returning existing 
login info : " + info + " - " + SID
+                                request.add_header('Cookie', 'LOGIN_INFO=' + 
info + ";SID=" + SID)
                
                try:
                        con = urllib2.urlopen(request)
diff --git a/plugin.video.youtube/YouTubeLogin.py 
b/plugin.video.youtube/YouTubeLogin.py
index b258781..b087431 100755
--- a/plugin.video.youtube/YouTubeLogin.py
+++ b/plugin.video.youtube/YouTubeLogin.py
@@ -176,6 +176,7 @@ class YouTubeLogin(object):
 
                if get("new", "false") == "true":
                        self.__settings__.setSetting( "login_info", "" )
+                        self.__settings__.setSetting( "SID", "" )
                elif self.__settings__.getSetting( "login_info" ) != "":
                        self.log("returning existing login info: " + 
self.__settings__.getSetting( "login_info" ))
                        return ( self.__settings__.getSetting( "login_info" ), 
200)
@@ -197,6 +198,14 @@ class YouTubeLogin(object):
                                break;
                        fetch_options = False
 
+                       # Check if we are logged in.
+                        nick = self.parseDOM(ret["content"], "span", attrs= { 
"class": "masthead-user-username"} )
+
+                       if len(nick) > 0:
+                               self.log("Logged in. Parsing data.")
+                               status = self._getLoginInfo(ret["content"])
+                                return(ret, status)
+
                        # Click login link on youtube.com
                        newurl = self.parseDOM(ret["content"], "a", attrs = 
{"class": "end" }, ret = "href")
                        if len(newurl) > 0:
@@ -260,11 +269,6 @@ class YouTubeLogin(object):
                        ## 2-factor login finish
                        
                        if not fetch_options:
-                               # Check if we are logged in.
-                               if ret["content"].find("USERNAME', ") > 0:
-                                       logged_in = True
-                                       self.log("Logged in. Parsing data.")
-                                       break;
                                # Look for errors and return error.
                                return ( self._findErrors(ret), 303)
                
@@ -340,38 +344,54 @@ class YouTubeLogin(object):
                        return url_data
                return {}
 
+        def _getCookieInfoAsHTML(self):
+               cookie = repr(cookiejar)
+                cookie = cookie.replace("<_LWPCookieJar.LWPCookieJar[", "")
+               cookie = cookie.replace("), Cookie(version=0,", 
"></cookie><cookie ")
+               cookie = cookie.replace(")]>", "></cookie>")
+               cookie = cookie.replace("Cookie(version=0,", "<cookie ")
+                cookie = cookie.replace(", ", " ")
+                return cookie
+
        def _getLoginInfo(self, content):
                nick = ""
                status = 303
-               if content.find("USERNAME', ") > 0:
-                       nick = content[content.find("USERNAME', ") + 12:]
-                       nick = nick[:nick.find('")')]
-               
-               if nick:
-                       self.__settings__.setSetting("nick", nick)
-               else:
-                       self.log("Failed to get usename from youtube")
+               nick = self.parseDOM(content, "span", attrs= { "class": 
"masthead-user-username"} )
+
+               if len(nick) > 0 :
+                        self.__settings__.setSetting("nick", nick[0])
+                else:
+                        self.log("Failed to get usename from youtube")
 
                # Save cookiefile in settings
                self.log("Scanning cookies for login info")
                
                login_info = ""
-               cookies = repr(cookiejar)
-                       
-               if cookies.find("name='LOGIN_INFO', value='") > 0:
-                       start = cookies.find("name='LOGIN_INFO', value='") + 
len("name='LOGIN_INFO', value='")
-                       login_info = cookies[start:cookies.find("', port=None", 
start)]
-               
-               if login_info:
-                       self.__settings__.setSetting( "login_info", login_info )
+               SID = ""
+                cookies = self._getCookieInfoAsHTML()
+               login_info = self.parseDOM(cookies, "cookie", attrs = { "name": 
"LOGIN_INFO" }, ret = "value")
+                SID = self.parseDOM(cookies, "cookie", attrs = { "name": 
"SID", "domain": ".youtube.com"}, ret = "value")
+
+                if len(login_info) == 1:
+                       self.log("LOGIN_INFO: " + repr(login_info))
+                       self.__settings__.setSetting( "login_info", 
login_info[0])
+               else:
+                        self.log("Failed to get LOGIN_INFO from youtube")
+
+                if len(SID) == 1:
+                       self.log("SID: " + repr(SID))
+                        self.__settings__.setSetting( "SID", SID[0])
+               else:
+                        self.log("Failed to get SID from youtube")
+
+               if len(SID) == 1 and len(login_info) == 1:
                        status = 200
 
-               self.log("Done : " + str(status) + " - " + login_info)
+               self.log("Done : " + str(status))
                return status
 
 
        def _fetchPage(self, params={}): # This does not handle cookie timeout 
for _httpLogin
-               #params["proxy"] = "http://15aa51.info/browse.php?u=";
                get = params.get
                link = get("link")
                ret_obj = { "status": 500, "content": ""}
@@ -401,15 +421,7 @@ class YouTubeLogin(object):
                        request = urllib2.Request(link, 
urllib.urlencode(get("url_data")))
                        request.add_header('Content-Type', 
'application/x-www-form-urlencoded')
                elif get("request", "false") == "false":
-                       if get("proxy"):
-                               self.log("got proxy")
-                               request = url2request(get("proxy") + link, 
get("method", "GET"));
-                               proxy = get("proxy")
-                               proxy = proxy[:proxy.rfind("/")]
-                               request.add_header('Referer', proxy)
-                       else:
-                               self.log("got default")
-                               request = url2request(link, get("method", 
"GET"));
+                       request = url2request(link, get("method", "GET"));
 
                else:
                        self.log("got request")
diff --git a/plugin.video.youtube/addon.xml b/plugin.video.youtube/addon.xml
index 6becd62..f621780 100644
--- a/plugin.video.youtube/addon.xml
+++ b/plugin.video.youtube/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="plugin.video.youtube"
        name="YouTube"
-       version="2.1.2"
+       version="2.1.3"
        provider-name="TheCollective">
   <requires>
     <import addon="xbmc.python" version="1.0"/>
diff --git a/plugin.video.youtube/changelog.txt 
b/plugin.video.youtube/changelog.txt
index d858b88..2023f10 100644
--- a/plugin.video.youtube/changelog.txt
+++ b/plugin.video.youtube/changelog.txt
@@ -7,6 +7,9 @@
 - [YOUTUBE] Can't delete favorites (YouTube gives video id, not favorite id).
 - Download of rtmpe streams not supported.
 
+[B]Version 2.1.3[/B]
+- Fixed login.
+
 [B]Version 2.1.2[/B]
 - Fixed problem with playback caused by bad regex. 
 - Disabled most of the scrapers since they didn't work, working versions can 
be found in the current beta
diff --git a/plugin.video.youtube/default.py b/plugin.video.youtube/default.py
index 856ceb3..5bdb8cb 100644
--- a/plugin.video.youtube/default.py
+++ b/plugin.video.youtube/default.py
@@ -19,7 +19,7 @@
 import sys, xbmc, xbmcaddon, cookielib, urllib2
 
 # plugin constants
-__version__ = "2.1.2"
+__version__ = "2.1.3"
 __plugin__ = "YouTube-" + __version__
 __author__ = "TheCollective"
 __url__ = "www.xbmc.com"
diff --git a/plugin.video.youtube/resources/language/English/strings.xml 
b/plugin.video.youtube/resources/language/English/strings.xml
index a86e424..fa83f7d 100644
--- a/plugin.video.youtube/resources/language/English/strings.xml
+++ b/plugin.video.youtube/resources/language/English/strings.xml
@@ -181,4 +181,6 @@
     <string id="30621">Bad username or password</string>
     <string id="30622">Playback failed, try logging in</string>
     <string id="30623">Maximum login attempts tried.</string>
+    <string id="30627">Please provide 2-factor authentication PIN</string>
+    <string id="30628">Please provide your password</string>
 </strings>

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

Summary of changes:
 .gitignore                                         |    2 +
 .../LICENSE.txt                                    |    0
 plugin.video.leafstv/LeafsTV.py                    |  379 ++++++++++++++++++++
 plugin.video.leafstv/README                        |   10 +
 plugin.video.leafstv/addon.xml                     |   15 +
 plugin.video.leafstv/changelog.txt                 |   11 +
 plugin.video.leafstv/default.py                    |  335 +++++++++++++++++
 plugin.video.leafstv/icon.png                      |  Bin 0 -> 6858 bytes
 .../resources/language/English/strings.xml         |   51 +++
 plugin.video.leafstv/resources/settings.xml        |    4 +
 .../LICENSE.txt                                    |    0
 plugin.video.tmz/addon.xml                         |   18 +
 plugin.video.tmz/changelog.txt                     |    3 +
 plugin.video.tmz/default.py                        |  112 ++++++
 plugin.video.tmz/icon.png                          |  Bin 0 -> 108599 bytes
 .../resources/language/English/strings.xml         |    7 +
 plugin.video.youtube/YouTubeCore.py                |    5 +-
 plugin.video.youtube/YouTubeLogin.py               |   76 +++--
 plugin.video.youtube/addon.xml                     |    2 +-
 plugin.video.youtube/changelog.txt                 |    3 +
 plugin.video.youtube/default.py                    |    2 +-
 .../resources/language/English/strings.xml         |    2 +
 22 files changed, 1001 insertions(+), 36 deletions(-)
 copy {plugin.video.4players => plugin.video.leafstv}/LICENSE.txt (100%)
 create mode 100644 plugin.video.leafstv/LeafsTV.py
 create mode 100644 plugin.video.leafstv/README
 create mode 100644 plugin.video.leafstv/addon.xml
 create mode 100644 plugin.video.leafstv/changelog.txt
 create mode 100644 plugin.video.leafstv/default.py
 create mode 100644 plugin.video.leafstv/icon.png
 create mode 100644 plugin.video.leafstv/resources/language/English/strings.xml
 create mode 100644 plugin.video.leafstv/resources/settings.xml
 copy {plugin.audio.abradio.cz => plugin.video.tmz}/LICENSE.txt (100%)
 create mode 100644 plugin.video.tmz/addon.xml
 create mode 100644 plugin.video.tmz/changelog.txt
 create mode 100644 plugin.video.tmz/default.py
 create mode 100644 plugin.video.tmz/icon.png
 create mode 100644 plugin.video.tmz/resources/language/English/strings.xml


hooks/post-receive
-- 
Plugins

------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to