def _download_restricted(url, filename, age):
 params = {u'age_limit': age, u'skip_download': True, u'writeinfojson': True, u'outtmpl': u'%(id)s.%(ext)s'}
 ydl = YoutubeDL(params)
 ydl.add_default_info_extractors()
 json_filename = (os.path.splitext(filename)[0] + u'.info.json')
 try_rm(json_filename)
 ydl.download([url])
 res = os.path.exists(json_filename)
 try_rm(json_filename)
 return res

def _download_restricted ( url , filename , age ) : params = { u'age_limit' : age , u'skip_download' : True , u'writeinfojson' : True , u'outtmpl' : u'%(id)s.%(ext)s' } ydl = YoutubeDL ( params ) ydl . add_default_info_extractors ( ) json_filename = ( os . path . splitext ( filename ) [ 0 ] + u'.info.json' ) try_rm ( json_filename ) ydl . download ( [ url ] ) res = os . path . exists ( json_filename ) try_rm ( json_filename ) return res
returns true if the file has been downloaded .