]> git.pld-linux.org Git - packages/clive.git/commitdiff
- parse delfi videobox videos
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 22 Nov 2007 11:05:14 +0000 (11:05 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    clive-delfi.patch -> 1.1

clive-delfi.patch [new file with mode: 0644]

diff --git a/clive-delfi.patch b/clive-delfi.patch
new file mode 100644 (file)
index 0000000..ee80cea
--- /dev/null
@@ -0,0 +1,26 @@
+--- clive-0.3.1/clive/parse.py 2007-10-28 23:11:16.000000000 +0200
++++ clive-0.3.1.delfi/clive/parse.py   2007-11-21 23:21:45.850962793 +0200
+@@ -52,6 +52,8 @@
+                       video_url = self._parse_guba(data)
+               elif url.find('stage6.divx.com') != -1:
+                       video_url = self._parse_stage6(data)
++              elif url.find('delfi.') != -1:
++                      video_url = self._parse_delfi(data)
+               else:
+                       (scheme, host, path, params, query, fragment) = \
+                               urlparse.urlparse(url)
+@@ -136,6 +138,14 @@
+               return self._parse_from_to(data,
+                       'http://video.stage6.com/', '&')
++      def _parse_delfi(self, data):
++              text = self._parse_from_to(data, "flv_url:", ",")
++              try:
++                      return urllib.unquote(text.replace("'", "").split('flv_url: ',2)[1])
++              except IndexError:
++                      pass
++              return ''
++
+       def _parse_from_to(self, data, _from, to, skip_from=0):
+               start = data.find(_from)
+               end = data.find(to, start)
This page took 0.05029 seconds and 4 git commands to generate.