mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 14:30:30 +03:00 
			
		
		
		
	A couple of minor update checking improvements
This commit is contained in:
		
							parent
							
								
									229d5f15ff
								
							
						
					
					
						commit
						26a4de4ccd
					
				
					 1 changed files with 9 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -37,7 +37,12 @@ execfile('config.py')
 | 
			
		|||
def check_market(app):
 | 
			
		||||
    time.sleep(5)
 | 
			
		||||
    url = 'http://market.android.com/details?id=' + app['id']
 | 
			
		||||
    page = urllib.urlopen(url).read()
 | 
			
		||||
    req = urllib.urlopen(url)
 | 
			
		||||
    if req.getcode() == 404:
 | 
			
		||||
        return (None, 'Not in market')
 | 
			
		||||
    elif req.getcode() != 200:
 | 
			
		||||
        return (None, 'Return code ' + str(req.getcode()))
 | 
			
		||||
    page = req.read()
 | 
			
		||||
 | 
			
		||||
    version = None
 | 
			
		||||
    vercode = None
 | 
			
		||||
| 
						 | 
				
			
			@ -46,6 +51,9 @@ def check_market(app):
 | 
			
		|||
    if m:
 | 
			
		||||
        version = html_parser.unescape(m.group(1))
 | 
			
		||||
 | 
			
		||||
    if version == 'Varies with device':
 | 
			
		||||
        return (None, 'Device-variable version, cannot use this method')
 | 
			
		||||
 | 
			
		||||
    m = re.search('data-paramValue="(\d+)"><div class="goog-menuitem-content">Latest Version<', page)
 | 
			
		||||
    if m:
 | 
			
		||||
        vercode = m.group(1)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue