Meta redirects are now supported.
This commit is contained in:
		
							
								
								
									
										8
									
								
								morss.py
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								morss.py
									
									
									
									
									
								
							@@ -231,6 +231,14 @@ def EncDownload(url):
 | 
				
			|||||||
		log('http error')
 | 
							log('http error')
 | 
				
			||||||
		return False
 | 
							return False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						# meta-redirect
 | 
				
			||||||
 | 
						match = re.search(r'(?i)<meta http-equiv=.refresh[^>]*?url=(http.*?)["\']', data)
 | 
				
			||||||
 | 
						if match:
 | 
				
			||||||
 | 
							new_url = match.groups()[0]
 | 
				
			||||||
 | 
							log('redirect: %s' % new_url)
 | 
				
			||||||
 | 
							return EncDownload(new_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						# encoding
 | 
				
			||||||
	if con.headers.getparam('charset'):
 | 
						if con.headers.getparam('charset'):
 | 
				
			||||||
		log('header')
 | 
							log('header')
 | 
				
			||||||
		enc = con.headers.getparam('charset')
 | 
							enc = con.headers.getparam('charset')
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user