Merge pull request #358 from aviperes/bad_video_title_for_watch

adding "," as an invalid title
This commit is contained in:
hodayabu 2020-09-10 12:33:18 +03:00 committed by GitHub
commit 001c25e1a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -816,9 +816,19 @@ class FacebookIE(InfoExtractor):
return thumbnail
def _valid_video_title(self, video_title):
if video_title:
video_title = video_title.lower()
return video_title and not u'log in or sign up to view' in video_title and not u'on facebook watch' in video_title
if not video_title:
return False
video_title = video_title.lower()
invalid_terms = [
u'log in or sign up to view',
u'on facebook watch',
u'","'
]
for term in invalid_terms:
if term in video_title:
return False
return True
def validate_webpage(self, webpage):
m_msg = re.search(r'class="[^"]*uiInterstitialContent[^"]*"><div>(.*?)</div>', webpage)