diff options
author | Remita Amine <remitamine@gmail.com> | 2017-02-23 11:47:06 +0100 |
---|---|---|
committer | Remita Amine <remitamine@gmail.com> | 2017-02-23 11:56:45 +0100 |
commit | bc61c80c143d8faed3e264c2487204924acd1eb6 (patch) | |
tree | f6726e391abf7d7aa41f46378dbe9ee352cb60a4 | |
parent | 345b24538b24772c6c5917439e62c510437fce04 (diff) |
[leeco] raise GeoRestrictedError and use geo bypass mechanism
-rw-r--r-- | youtube_dl/extractor/leeco.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/youtube_dl/extractor/leeco.py b/youtube_dl/extractor/leeco.py index 4321f90c8..9eda956d2 100644 --- a/youtube_dl/extractor/leeco.py +++ b/youtube_dl/extractor/leeco.py @@ -30,7 +30,7 @@ from ..utils import ( class LeIE(InfoExtractor): IE_DESC = '乐视网' _VALID_URL = r'https?://(?:www\.le\.com/ptv/vplay|(?:sports\.le|(?:www\.)?lesports)\.com/(?:match|video))/(?P<id>\d+)\.html' - + _GEO_COUNTRIES = ['CN'] _URL_TEMPLATE = 'http://www.le.com/ptv/vplay/%s.html' _TESTS = [{ @@ -126,10 +126,9 @@ class LeIE(InfoExtractor): if playstatus['status'] == 0: flag = playstatus['flag'] if flag == 1: - msg = 'Country %s auth error' % playstatus['country'] + self.raise_geo_restricted() else: - msg = 'Generic error. flag = %d' % flag - raise ExtractorError(msg, expected=True) + raise ExtractorError('Generic error. flag = %d' % flag, expected=True) def _real_extract(self, url): media_id = self._match_id(url) |