home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.0)
-
- import sys
- import httplib
- import re
- import string
- import os.path as os
- import urlparse
- from gaogaolib import *
- hosts = '^http://.+\\.' + '(webjump|jumpmovies|jumptunes|jumptravel|jumpsports|' + 'jumpshopping|jumpreligion|jumprealestate|jumppolitics|' + 'jumpoutdoors|jumphobbies|jumphealth|jumpgardens|' + 'jumpgames|jumpfood|jumpfinance|jumpfamily|jumpeducation|' + 'jumpfun|jumpcomputers|jumpcareers|jumpbusiness|jumpbooks|' + 'jumpautos|jumpart)\\.com'
- re_hosts = re.compile(hosts, re.IGNORECASE)
-
- def OnRequest(url, headers, proxy = '', redirect = FALSE, item = None, misc = None):
- '''HTTP\x83\x8a\x83N\x83G\x83X\x83g\x82\xcc\x91O\x82\xc9\x8c\xc4\x82\xce\x82\xea\x82\xdc\x82\xb7\x81B\x95\xd4\x92l\x82\xcd \x83t\x83\x89\x83O\x82\xc6\x90V\x82\xb5\x82\xa2URL\x82\xcc\x83^\x83v\x83\x8b'''
- if redirect:
- return (INGNORE, url)
-
- if not re_hosts.search(url):
- return (IGNORE, url)
- else:
- print '\x90V\x82\xb5\x82\xa2URL\x82\xf0\x92T\x82\xb5\x82\xdc\x82\xb7'
- url = restore_webjump(url)
- url_info = parse_url(url)
- (host, port, path) = extract_url(url, proxy)
- http = httplib.HTTP(host, port)
- http.set_debuglevel(1)
-
- try:
- http.putrequest('GET', path)
- keys = headers.keys()
- for field in keys:
- if string.lower(field) == 'range':
- pass
- elif string.lower(field) == 'host':
- http.putheader('Host', url_info['host'])
- else:
- http.putheader(field, headers[field])
-
- http.endheaders()
- (status_num, status, ret_headers) = http.getreply()
- if status_num == 200:
- f = http.getfile()
- html = f.read()
- f.close()
- m = re.search('http://.+' + url_info['path'], html, re.IGNORECASE)
- if m:
- ret_url = html[m.start(0):m.end(0)]
- print '\x90V\x82\xb5\x82\xa2URL\x82\xcc\x8e\xe6\x93\xbe\x82\xc9\x90\xac\x8c\xf7\x82\xb5\x82\xdc\x82\xb5\x82\xbd'
- print ret_url
- headers['Host'] = urlparse.urlparse(ret_url)[1]
- return (SUCCESS, ret_url)
- else:
- return (ERROR, url)
- else:
- return (ERROR, url)
- finally:
- http.close()
-
-
-