Hi.
I've had the same problem and solved it. Apparently youtube changed its
javascript code again.

The patch is attached, it applies to the debian source-package in lenny
(ver. 0.4.18-1).

i.e.:
 apt-get builddep clive
 apt-get source clive
 patch -p0 -i clive_0.4.18.patch
 cd clive-0.4.18
 dpkg-buildpackage

[disclaimer: I didn't read the full source, so I patched both files
parse.py and parse.py.in, without knowing which one would be the
important one.]
diff -Naur clive-0.4.18/debian/changelog ../clive-0.4.18/debian/changelog
--- clive-0.4.18/debian/changelog	2009-08-19 19:46:02.000000000 +0200
+++ clive-0.4.18/debian/changelog	2009-08-19 19:45:26.000000000 +0200
@@ -1,3 +1,9 @@
+clive (0.4.18-1fix1) unstable; urgency=low
+
+  * Fixed youtube page style change.
+
+ -- Thomas Kremer <>  Wed, 19 Aug 2009 19:45:09 +0200
+
 clive (0.4.18-1) unstable; urgency=low
 
   * New upstream release:
diff -Naur clive-0.4.18/src/clive/parse.py ../clive-0.4.18/src/clive/parse.py
--- clive-0.4.18/src/clive/parse.py	2008-07-15 20:09:55.000000000 +0200
+++ clive-0.4.18/src/clive/parse.py	2009-08-19 19:38:19.000000000 +0200
@@ -139,16 +139,21 @@
             if lookup in ldata:
                 raise CliveError('error: ' + errmsg)
         try:
+            #video_id = \
+            #    self._parse_from_to(data, 'video_id=', '&', skip_from=1)
+            #video_id = video_id.replace("'", "")
             video_id = \
-                self._parse_from_to(data, 'video_id=', '&', skip_from=1)
-            video_id = video_id.replace("'", "")
+                self._parse_from_to(data, '"video_id": ', ',', skip_from=1)
+            video_id = video_id.replace('"', "")
             if len(video_id) == 0: raise CliveError()
         except:
             raise CliveError('error: extraction url (&video_id) not found')
 		
         try:
-            t = self._parse_from_to(data, '&t=', '&', skip_from=1)
-            t = t.replace("'", "")
+            #t = self._parse_from_to(data, '&t=', '&', skip_from=1)
+            #t = t.replace("'", "")
+            t = self._parse_from_to(data, '"t": ', ',', skip_from=1)
+            t = t.replace('"', "")
             if len(t) == 0: raise CliveError()
         except:
             raise CliveError('error: extraction url (&t) not found')
diff -Naur clive-0.4.18/src/clive/parse.py.in ../clive-0.4.18/src/clive/parse.py.in
--- clive-0.4.18/src/clive/parse.py.in	2008-07-15 19:57:59.000000000 +0200
+++ clive-0.4.18/src/clive/parse.py.in	2009-08-19 19:40:06.000000000 +0200
@@ -139,16 +139,21 @@
             if lookup in ldata:
                 raise CliveError('error: ' + errmsg)
         try:
+            #video_id = \
+            #    self._parse_from_to(data, 'video_id=', '&', skip_from=1)
+            #video_id = video_id.replace("'", "")
             video_id = \
-                self._parse_from_to(data, 'video_id=', '&', skip_from=1)
-            video_id = video_id.replace("'", "")
+                self._parse_from_to(data, '"video_id": ', ',', skip_from=1)
+            video_id = video_id.replace('"', "")
             if len(video_id) == 0: raise CliveError()
         except:
             raise CliveError('error: extraction url (&video_id) not found')
 		
         try:
-            t = self._parse_from_to(data, '&t=', '&', skip_from=1)
-            t = t.replace("'", "")
+            #t = self._parse_from_to(data, '&t=', '&', skip_from=1)
+            #t = t.replace("'", "")
+            t = self._parse_from_to(data, '"t": ', ',', skip_from=1)
+            t = t.replace('"', "")
             if len(t) == 0: raise CliveError()
         except:
             raise CliveError('error: extraction url (&t) not found')

Reply via email to