- flag = xpath_text(video_xml, './track/flag', 'flag', default=None)
- if flag and flag != 'SUCCEED':
+ flag = xpath_text(video_xml, './track/flag', 'flag', default=None)
+ if flag and flag == 'SUCCEED':
+ break
+ if flag == 'PARTIAL_ADULT':
+ self._downloader.report_warning(
+ 'In accordance with local laws and regulations, underage users are restricted from watching adult content. '
+ 'Only content suitable for all ages will be downloaded. '
+ 'Provide account credentials if you wish to download restricted content.')
+ partial_view = True
+ continue
+ elif flag == 'ADULT':
+ error = 'Only users older than 19 are able to watch this video. Provide account credentials to download this content.'
+ else:
+ error = flag