+++ /dev/null
---- clive-0.4.10/src/clive/parse.py 2008-04-21 10:54:55.000000000 +0300
-+++ clive-0.4.10-delfi/src/clive/parse.py 2008-04-26 01:09:31.000000000 +0300
-@@ -50,6 +50,7 @@
- ('sevenload.com', 'sevenl', self._parse_sevenload),
- ('myvideo.', 'myvideo', self._parse_myvideo),
- ('break.com', 'break', self._parse_break),
-+ ('delfi.', 'delfi', self._parse_delfi),
- ]
-
- ## Parses a video page data (HTML)
-@@ -221,6 +222,72 @@
- url = self._parse_from_to(data, 'mediaURL=', '&', skip_from=1)
- return (url, vid, low_quality)
-
-+ def _graburl(self, url, read=1):
-+ from urlgrabber.grabber import URLGrabber, URLGrabError
-+ data = ''
-+ try:
-+ g = URLGrabber(
-+ http_headers = (('accept-encoding', 'gzip'),),
-+ user_agent = self._opts.http_agent,
-+ proxies = self._opts.http_proxy
-+ )
-+ o = g.urlopen(url)
-+ if read:
-+ data = o.read()
-+ if o.hdr.get('content-encoding') == 'gzip':
-+ data = gzip.GzipFile(fileobj=StringIO(data)).read()
-+ return data
-+ except URLGrabError, err:
-+ self._say('%s [%s]' % (e.strerror,url), is_error=1)
-+ raise SystemExit
-+ return data
-+
-+ def _parse_delfi(self, url, data, low_quality):
-+ url = None
-+
-+ s = self._parse_from_to(data, "flv_url:", ",")
-+ if s:
-+ # videobox
-+ # http://www.delfi.ee/news/paevauudised/paevavideo/article.php?id=15218215
-+ try:
-+ url = s.replace("'", "").split('flv_url: ',2)[1]
-+ except IndexError:
-+ pass
-+
-+ if not url:
-+ # videoproject embed
-+ # http://www.delfi.ee/news/paevauudised/paevavideo/article.php?id=18759038
-+ s = self._parse_from_to(data, "_delfiVideoSalt", ";")
-+ salt = None
-+ try:
-+ salt = s.split('"',2)[1]
-+ except IndexError:
-+ pass
-+
-+ if salt != None:
-+ # find url to videoproject
-+ s = self._parse_from_to(data, "src=", "/js/embed.js")
-+ s = s[5 + s.rfind("src"):] + "/video/" + salt + "/"
-+ # fetch video page
-+ s = self._graburl(s)
-+ s = self._parse_from_to(s, "s1.addVariable('file'", ";");
-+ try:
-+ url = s.split("'")[3]
-+ except IndexError:
-+ pass
-+
-+ if not url:
-+ # videoproject
-+ # http://video.delfi.ee/video/Uu4gF58g/
-+ s = self._parse_from_to(data, "s1.addVariable('file'", ";");
-+ try:
-+ url = s.split("'")[3]
-+ except IndexError:
-+ pass
-+
-+ vid = md5.new(str(time.time())).hexdigest()[:8]
-+ return (url, vid, low_quality)
-+
- def _random_vid(self):
- return md5.new(str(time.time())).hexdigest()[:8]
-
+++ /dev/null
---- clive-0.4.11/src/clive/parse.py~ 2008-04-27 23:11:12.000000000 +0300
-+++ clive-0.4.11/src/clive/parse.py 2008-04-27 23:11:27.000000000 +0300
-@@ -52,6 +52,7 @@
- ('metacafe.', 'metac', self._parse_metacafe),
- ('delfi.', 'delfi', self._parse_delfi),
- ('www.southparkzone.com', 'southparkzone', self._parse_southparkzone),
-+ ('www.reporter.ee', 'reporter', self._parse_reporter),
- ]
-
- ## Parses a video page data (HTML)
-@@ -297,6 +298,12 @@
- vid = md5.new(str(time.time())).hexdigest()[:8]
- return (url, vid, low_quality)
-
-+ def _parse_reporter(self, url, data, low_quality):
-+ # http://www.reporter.ee/index.php/2008/04/21/soiduopetaja-vorpis-poiste-nupeldamisest-videoklippe/
-+ url = self._parse_from_to(data, 'so.addVariable("src", "', '"', skip_from = 1);
-+ vid = md5.new(str(time.time())).hexdigest()[:8]
-+ return (url, vid, low_quality)
-+
- def _random_vid(self):
- return md5.new(str(time.time())).hexdigest()[:8]
-
+++ /dev/null
-#!/usr/bin/env python
-# -*- coding: ascii -*-
-
-###########################################################################
-# clive, video extraction utility
-# Copyright (C) 2007-2008 Toni Gundogdu
-#
-# clive is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 0.1.2-1307 USA
-###########################################################################
-
-import sys
-import re
-import os
-import gzip
-
-from distutils.core import setup
-
-sys.path.insert(0, 'src')
-
-import clive as _clive
-
-if sys.platform == 'win32':
- try:
- import py2exe
- _py2exe_avail = 1
- except ImportError:
- _py2exe_avail = 0
-
-desc = 'Video extraction tool'
-
-ldesc = 'Video extraction tool for Youtube, Google ' \
- 'video and other video websites'
-
-author = _clive.__author__.rsplit(' ', 1)[0]
-
-author_email = re.sub('(^<)|(>)', '',
- _clive.__author__.rsplit(' ',1)[1])
-
-classifiers = [
- 'Environment :: Console',
- 'Intended Audience :: End Users/Desktop',
- 'Operating System :: POSIX',
- 'Programming Language :: Python',
- 'License :: OSI Approved :: GNU General Public License (GPL)',
- 'Natural Language :: English',
- 'Topic :: Internet',
- 'Topic :: Utilities'
-]
-
-manpage = 'man/clive.1'
-manpage_gz = manpage + '.gz'
-data_files = [ ('share/man/man1', [manpage_gz]) ]
-
-setup_args = dict(
- name = 'clive',
- version = _clive.__version__,
- description = desc,
- long_description = ldesc,
- maintainer = author,
- maintainer_email = author_email,
- url = _clive.__url__,
- license = 'GPL',
- scripts = ['src/scripts/clive'],
- packages = ['clive'],
- package_dir = {'clive':'src/clive'},
- data_files = data_files,
- classifiers = classifiers,
- platforms = ['Any']
-)
-
-if sys.platform == 'win32' and _py2exe_avail:
- setup_args['console'] = ['src/scripts/clive']
- setup_args['data_files'] = []
-
-# gzip clive.1; otherwise bdist_rpm will fail
-gzip.GzipFile(manpage_gz, 'w').write(open(manpage).read())
-
-setup(**setup_args)
-
-try: # cleanup
- os.remove(manpage_gz)
-except:
- pass
-
+++ /dev/null
---- clive-0.4.11/src/clive/parse.py 2008-04-26 16:06:21.000000000 +0300
-+++ clive-0.4.11-spz/src/clive/parse.py 2008-04-26 16:04:07.000000000 +0300
-@@ -51,6 +51,7 @@
- ('guba.com', 'guba', self._parse_guba),
- ('metacafe.', 'metac', self._parse_metacafe),
- ('delfi.', 'delfi', self._parse_delfi),
-+ ('www.southparkzone.com', 'southparkzone', self._parse_southparkzone),
- ]
-
- ## Parses a video page data (HTML)
-@@ -288,6 +289,14 @@
- vid = md5.new(str(time.time())).hexdigest()[:8]
- return (url, vid, low_quality)
-
-+ def _parse_southparkzone(self, url, data, low_quality):
-+ mirror_id = self._parse_from_to(data, "episodeinfo.php?mirror=", "'")
-+ data = self._graburl("http://www.southparkzone.com/" + mirror_id)
-+ url = self._parse_from_to(data, "<location><![CDATA[", "]]></location>", skip_from = 1)
-+
-+ vid = md5.new(str(time.time())).hexdigest()[:8]
-+ return (url, vid, low_quality)
-+
- def _random_vid(self):
- return md5.new(str(time.time())).hexdigest()[:8]
-