def scan_video(path):
 if (not os.path.exists(path)):
  raise ValueError('Path does not exist')
 if (not path.endswith(VIDEO_EXTENSIONS)):
  raise ValueError(('%r is not a valid video extension' % os.path.splitext(path)[1]))
 (dirpath, filename) = os.path.split(path)
 logger.info('Scanning video %r in %r', filename, dirpath)
 video = Video.fromguess(path, guessit(path))
 video.size = os.path.getsize(path)
 if (video.size > 10485760):
  logger.debug('Size is %d', video.size)
  video.hashes['opensubtitles'] = hash_opensubtitles(path)
  video.hashes['shooter'] = hash_shooter(path)
  video.hashes['thesubdb'] = hash_thesubdb(path)
  video.hashes['napiprojekt'] = hash_napiprojekt(path)
  logger.debug('Computed hashes %r', video.hashes)
 else:
  logger.warning('Size is lower than 10MB: hashes not computed')
 return video

def scan_video ( path ) : if ( not os . path . exists ( path ) ) : raise ValueError ( 'Path does not exist' ) if ( not path . endswith ( VIDEO_EXTENSIONS ) ) : raise ValueError ( ( '%r is not a valid video extension' % os . path . splitext ( path ) [ 1 ] ) ) ( dirpath , filename ) = os . path . split ( path ) logger . info ( 'Scanning video %r in %r' , filename , dirpath ) video = Video . fromguess ( path , guessit ( path ) ) video . size = os . path . getsize ( path ) if ( video . size > 10485760 ) : logger . debug ( 'Size is %d' , video . size ) video . hashes [ 'opensubtitles' ] = hash_opensubtitles ( path ) video . hashes [ 'shooter' ] = hash_shooter ( path ) video . hashes [ 'thesubdb' ] = hash_thesubdb ( path ) video . hashes [ 'napiprojekt' ] = hash_napiprojekt ( path ) logger . debug ( 'Computed hashes %r' , video . hashes ) else : logger . warning ( 'Size is lower than 10MB: hashes not computed' ) return video
scan a video from a path .