aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/deezer.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-09-13 08:51:21 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-09-13 08:51:21 +0200
commit6539c91a7806112be9750a72c154f5a1f99e6c78 (patch)
treed17d08cc71c9940d29620728cb3884a4a4d7f7c0 /youtube_dl/extractor/deezer.py
parent4eefbfdbfd472398ed5e40b13d20e3a92f837f52 (diff)
[deezer] Add support for geoblocking
Diffstat (limited to 'youtube_dl/extractor/deezer.py')
-rw-r--r--youtube_dl/extractor/deezer.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/youtube_dl/extractor/deezer.py b/youtube_dl/extractor/deezer.py
index 62c181529..c3205ff5f 100644
--- a/youtube_dl/extractor/deezer.py
+++ b/youtube_dl/extractor/deezer.py
@@ -5,6 +5,7 @@ import re
from .common import InfoExtractor
from ..utils import (
+ ExtractorError,
int_or_none,
orderedSet,
)
@@ -21,6 +22,7 @@ class DeezerPlaylistIE(InfoExtractor):
'thumbnail': 're:^https?://cdn-images.deezer.com/images/cover/.*\.jpg$',
},
'playlist_count': 30,
+ 'skip': 'Only available in .de',
}
def _real_extract(self, url):
@@ -31,6 +33,13 @@ class DeezerPlaylistIE(InfoExtractor):
playlist_id = mobj.group('id')
webpage = self._download_webpage(url, playlist_id)
+ geoblocking_msg = self._html_search_regex(
+ r'<p class="soon-txt">(.*?)</p>', webpage, 'geoblocking message',
+ default=None)
+ if geoblocking_msg is not None:
+ raise ExtractorError(
+ 'Deezer said: %s' % geoblocking_msg, expected=True)
+
data_json = self._search_regex(
r'naboo\.display\(\'[^\']+\',\s*(.*?)\);\n', webpage, 'data JSON')
data = json.loads(data_json)