home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / iria107a.lzh / script / theglobe.ipy < prev    next >
Text File  |  2000-11-23  |  973b  |  41 lines

  1.  
  2. #name=theglobe(RANGE)
  3. #version=0.1
  4. #author=Wolfy
  5. #date=2000/11/22
  6. #comment=theglobeé╓é╠âwâbâ_é╠Rangeé≡RANGEé╔ò╧éªéΘ
  7. #func=OnRequest
  8. #category=download
  9. #param_comment=
  10.  
  11. import sys,httplib,re,string,os.path
  12. from gaogaolib import *
  13.  
  14. #theglobe
  15. hosts = r'^http://members[0-9]*\.theglobe\.com'
  16.  
  17. def OnRequest(url,headers,proxy,redirect,item,param):
  18.     r'''HTTPâèâNâGâXâgé╠æOé╔î─é╬éΩé▄é╖üBò╘Ælé═ âtâëâOé╞ÉVé╡éóURLé╠â^âvâï'''
  19.     #Redirecté╚éτé╬ÅIéΦ
  20.     if redirect:
  21.       return (IGNORE,url)
  22.  
  23.     #É│ïKò\î╗âRâôâpâCâï
  24.     re_hosts = re.compile(hosts,re.IGNORECASE)
  25.     if not re_hosts.search(url):
  26.         #î⌐é┬é⌐éτé╚é⌐é┴é╜éτÅIéΦ
  27.         return (IGNORE,url)
  28.     else: #î⌐é┬é⌐é┴é╜éτrangeé≡RANGEé╔ò╧éªéΘ
  29.       keys = headers.keys()
  30.       for field in keys:
  31.         if string.lower(field) == 'range':
  32.           data = headers[field]
  33.           del headers[field]
  34.           headers['RANGE'] = data
  35.  
  36.       return (SUCCESS,url)
  37. #end OnRequest
  38.  
  39.  
  40.  
  41.