]> git.pld-linux.org Git - packages/clive.git/blob - clive-delfi.patch
- updated patches to 0.4.10
[packages/clive.git] / clive-delfi.patch
1 --- clive-0.4.10/src/clive/parse.py~    2008-04-25 23:53:39.000000000 +0300
2 +++ clive-0.4.10/src/clive/parse.py     2008-04-25 23:55:53.000000000 +0300
3 @@ -50,6 +50,7 @@
4              ('dailymotion.', 'dmotion', self._parse_dmotion),
5              ('guba.com', 'guba', self._parse_guba),
6              ('metacafe.', 'metac', self._parse_metacafe),
7 +                       ('delfi.', 'delfi', self._parse_delfi),
8          ]
9  
10      ## Parses a video page data (HTML)
11 @@ -221,6 +222,16 @@
12          url = self._parse_from_to(data, 'mediaURL=', '&', skip_from=1)
13          return (url, vid, low_quality)
14  
15 +       def _parse_delfi(self, url, data, low_quality):
16 +               text = self._parse_from_to(data, "flv_url:", ",")
17 +               try:
18 +                       url = urllib.unquote(text.replace("'", "").split('flv_url: ',2)[1])
19 +               except IndexError:
20 +                       pass
21 +
22 +               vid = md5.new(str(time.time())).hexdigest()[:8]
23 +               return (url, vid, low_quality)
24 +
25      def _random_vid(self):
26          return md5.new(str(time.time())).hexdigest()[:8]
27  
This page took 0.073012 seconds and 4 git commands to generate.