Modified:
trunk/cli.py
trunk/main.py
Log:
fixed many stuff... ROAAHHAHAHgedit main.pygedit main.pygedit main.py111
Modified: trunk/cli.py
==============================================================================
--- trunk/cli.py (original)
+++ trunk/cli.py Sun Feb 3 05:55:12 2008
@@ -83,7 +83,7 @@
saveAs = options.saveAs
else:
saveAs = os.path.join(options.destination, data.data[2])
- print _('Saving file as "%(file)s"...') % {"file" : saveAs}
+ print 'Saving file as "%(file)s"...' % {"file" : saveAs}
down = fdownload(data.data[0], saveAs)
down.start()
progress = down.downloaded()
Modified: trunk/main.py
==============================================================================
--- trunk/main.py (original)
+++ trunk/main.py Sun Feb 3 05:55:12 2008
@@ -103,9 +103,11 @@
self.data = [None, None, None, None]
def run(self):
if re.match("(http://)?stage6.divx.com/.*/video/[0-9]*/.*",
self.url) == None: # if no stage6 video
- SITE="www.nachrichtenmann.de"
- FILENAME="/cgi-bin/video/video.cgi"
- params = urlencode({"downloadurl" : self.url})
+ SITE="www.2video.de"
+ FILENAME="/"
+ params = urlencode({"dl" : self.url,
+ "req" : "downloads",
+ "action" : "download"})
headers = {"Content-type": "application/x-www-form-urlencoded",
"Accept": "text/plain"}
con=httplib.HTTPConnection(SITE)
@@ -113,14 +115,24 @@
con_info=con.getresponse()
con_data=con_info.read()
lines=con_data.splitlines()
+ SITE=re.match("(http://)?(.*)/(.*)", self.url).group(2)
+ FILENAME=re.match("(http://)?(.*)/(.*)", self.url).group(3)
+ con2=httplib.HTTPConnection(SITE)
+ con2.request("GET", "/"+FILENAME)
+ con2_data=con2.getresponse().read()
+ mylines=con2_data.splitlines()
+
+
try:
- WANTEDLINE_LINK=lines.index([x for x in lines
if '<font color="#00FF00">Download von ' in x][0]) # returns line number
- WANTEDLINE_NAME=WANTEDLINE_LINK+1
- except IndexError:
+ LINKLINE_NR=lines.index([x for x in lines
if 'target="_blank">Download von ' in x][0])
+ WANTEDLINK=re.match('.*<a href="(.*)" target=.*', lines[LINKLINE_NR]).group(1)
+ WANTEDNAME_NR=mylines.index([x for x in mylines
if '<title>' in x][0])
+ WANTEDNAME=re.match('.*<title>(.*)</title>.*', mylines[WANTEDNAME_NR]).group(1)
+ print WANTEDNAME
+
+ except NameError:
self.status = 1
else:
- WANTEDLINK=re.split('"', lines[WANTEDLINE_LINK])[1]
- WANTEDNAME=lines[WANTEDLINE_NAME].replace("\t", "").replace("</font><br>", "")
VIDEO_FILENAME=re.sub("(?i).flv.flv", ".flv", WANTEDNAME+".flv")
self.status = 0
self.data = [WANTEDLINK, WANTEDNAME, VIDEO_FILENAME, True]