mirror of
				https://github.com/MCV-Software/TWBlue.git
				synced 2025-11-04 05:47:05 +00:00 
			
		
		
		
	Added exception handlers.
This commit is contained in:
		@@ -45,16 +45,22 @@ def find_next_reply(id, listItem):
 | 
			
		||||
def is_audio(tweet,force=False):
 | 
			
		||||
 if force == False and 'is_audio' in tweet:
 | 
			
		||||
  return tweet['is_audio']
 | 
			
		||||
 try:
 | 
			
		||||
  if len(tweet["entities"]["hashtags"]) > 0:
 | 
			
		||||
   for i in tweet["entities"]["hashtags"]:
 | 
			
		||||
    if i["text"] == "audio":
 | 
			
		||||
     tweet['is_audio']=True
 | 
			
		||||
     return True
 | 
			
		||||
 except:
 | 
			
		||||
  log.exception("Exception while executing is_audio hashtag algorithm")
 | 
			
		||||
 try:
 | 
			
		||||
  if config.app['app-settings']['use_modern_audio_algo']:
 | 
			
		||||
   for u in find_urls(tweet):
 | 
			
		||||
    if url_is_audio(u):
 | 
			
		||||
     tweet['is_audio']=True
 | 
			
		||||
     return True
 | 
			
		||||
 except:
 | 
			
		||||
  log.exception("Exception while executing is_audio Codeofdusk algorithm.")
 | 
			
		||||
 tweet['is_audio']=False
 | 
			
		||||
 return False
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user