소스 검색

[nrk] Improve geo restriction detection

Sergey M․ 9 년 전
부모
커밋
50913b8241
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      youtube_dl/extractor/nrk.py

+ 3 - 2
youtube_dl/extractor/nrk.py

@@ -93,8 +93,9 @@ class NRKBaseIE(InfoExtractor):
                 }]
 
         if not entries:
-            message_type = data.get('messageType')
-            if message_type == 'ProgramIsGeoBlocked' and not self._faked_ip:
+            message_type = data.get('messageType', '')
+            # Can be ProgramIsGeoBlocked or ChannelIsGeoBlocked*
+            if 'IsGeoBlocked' in message_type and not self._faked_ip:
                 self.report_warning(
                     'Video is geo restricted, trying to fake IP')
                 self._fake_ip()