projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
43479d9
)
[motherless] Detect non-existing videos
author
Sergey M․
<dstftw@gmail.com>
Wed, 24 Feb 2016 18:42:19 +0000
(
00:42
+0600)
committer
Sergey M․
<dstftw@gmail.com>
Wed, 24 Feb 2016 18:42:19 +0000
(
00:42
+0600)
youtube_dl/extractor/motherless.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/motherless.py
b/youtube_dl/extractor/motherless.py
index b3bfcac9e0cac1b4ece2004e0875e0878b46d6c0..30e686a4e175ad258a5efde8a60dacb85fb24363 100644
(file)
--- a/
youtube_dl/extractor/motherless.py
+++ b/
youtube_dl/extractor/motherless.py
@@
-5,6
+5,7
@@
import re
from .common import InfoExtractor
from ..utils import (
from .common import InfoExtractor
from ..utils import (
+ ExtractorError,
str_to_int,
unified_strdate,
)
str_to_int,
unified_strdate,
)
@@
-66,6
+67,11
@@
class MotherlessIE(InfoExtractor):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
+ if any(p in webpage for p in (
+ '<title>404 - MOTHERLESS.COM<',
+ ">The page you're looking for cannot be found.<")):
+ raise ExtractorError('Video %s does not exist' % video_id, expected=True)
+
title = self._html_search_regex(
r'id="view-upload-title">\s+([^<]+)<', webpage, 'title')
video_url = self._html_search_regex(
title = self._html_search_regex(
r'id="view-upload-title">\s+([^<]+)<', webpage, 'title')
video_url = self._html_search_regex(