Browse Source

[leeco] raise GeoRestrictedError and use geo bypass mechanism

master-ytdl-org
Remita Amine 8 years ago
parent
commit
bc61c80c14
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      youtube_dl/extractor/leeco.py

+ 3
- 4
youtube_dl/extractor/leeco.py View File

@ -30,7 +30,7 @@ from ..utils import (
class LeIE(InfoExtractor): class LeIE(InfoExtractor):
IE_DESC = '乐视网' IE_DESC = '乐视网'
_VALID_URL = r'https?://(?:www\.le\.com/ptv/vplay|(?:sports\.le|(?:www\.)?lesports)\.com/(?:match|video))/(?P<id>\d+)\.html' _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' _URL_TEMPLATE = 'http://www.le.com/ptv/vplay/%s.html'
_TESTS = [{ _TESTS = [{
@ -126,10 +126,9 @@ class LeIE(InfoExtractor):
if playstatus['status'] == 0: if playstatus['status'] == 0:
flag = playstatus['flag'] flag = playstatus['flag']
if flag == 1: if flag == 1:
msg = 'Country %s auth error' % playstatus['country']
self.raise_geo_restricted()
else: 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): def _real_extract(self, url):
media_id = self._match_id(url) media_id = self._match_id(url)


Loading…
Cancel
Save