[motherless] Detect friends only videos
authorSergey M․ <dstftw@gmail.com>
Mon, 21 Mar 2016 16:24:42 +0000 (22:24 +0600)
committerSergey M․ <dstftw@gmail.com>
Mon, 21 Mar 2016 16:24:42 +0000 (22:24 +0600)
youtube_dl/extractor/motherless.py

index ad04b12cd761f53ae90e31a0a230635cf6782fcc..5e1a8a71a93aa28962d7f260af966d10cf8e9f7a 100644 (file)
@@ -69,6 +69,9 @@ class MotherlessIE(InfoExtractor):
                 ">The page you're looking for cannot be found.<")):
             raise ExtractorError('Video %s does not exist' % video_id, expected=True)
 
+        if '>The content you are trying to view is for friends only.' in webpage:
+            raise ExtractorError('Video %s is for friends only' % video_id, expected=True)
+
         title = self._html_search_regex(
             r'id="view-upload-title">\s+([^<]+)<', webpage, 'title')
         video_url = self._html_search_regex(