aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas <lucas.bergeron@outlook.fr>2019-08-12 17:50:03 +0200
committerLucas <lucas.bergeron@outlook.fr>2019-08-12 17:50:03 +0200
commit297f60e62c4b799bc58257813ffce452a60a250a (patch)
tree3e6b81697d9f21166c5454426180c6002ce0750c
parent3bce4ff7d96d845ec67ffe8e9e2715474f190d89 (diff)
downloadhypervideo-pre-297f60e62c4b799bc58257813ffce452a60a250a.tar.lz
hypervideo-pre-297f60e62c4b799bc58257813ffce452a60a250a.tar.xz
hypervideo-pre-297f60e62c4b799bc58257813ffce452a60a250a.zip
[DeezerPlaylist] Update to new website
-rw-r--r--youtube_dl/extractor/deezer.py21
1 files changed, 6 insertions, 15 deletions
diff --git a/youtube_dl/extractor/deezer.py b/youtube_dl/extractor/deezer.py
index a38b2683d..458b89b75 100644
--- a/youtube_dl/extractor/deezer.py
+++ b/youtube_dl/extractor/deezer.py
@@ -18,11 +18,10 @@ class DeezerPlaylistIE(InfoExtractor):
'info_dict': {
'id': '176747451',
'title': 'Best!',
- 'uploader': 'Anonymous',
- 'thumbnail': r're:^https?://cdn-images\.deezer\.com/images/cover/.*\.jpg$',
+ 'uploader': 'anonymous',
+ 'thumbnail': r're:^https?://e-cdns-images\.dzcdn\.net/images/cover/.*\.jpg$',
},
- 'playlist_count': 30,
- 'skip': 'Only available in .de',
+ 'playlist_count': 29,
}
def _real_extract(self, url):
@@ -46,25 +45,17 @@ class DeezerPlaylistIE(InfoExtractor):
webpage, 'data JSON')
data = json.loads(data_json)
- playlist_title = data.get('DATA', {}).get('TITLE')
- playlist_uploader = data.get('DATA', {}).get('PARENT_USERNAME')
+ playlist_title = data['DATA']['TITLE']
+ playlist_uploader = data['DATA']['PARENT_USERNAME']
playlist_thumbnail = self._search_regex(
r'<img id="naboo_playlist_image".*?src="([^"]+)"', webpage,
'playlist thumbnail')
- preview_pattern = self._search_regex(
- r"var SOUND_PREVIEW_GATEWAY\s*=\s*'([^']+)';", webpage,
- 'preview URL pattern', fatal=False)
entries = []
for s in data['SONGS']['data']:
- puid = s['MD5_ORIGIN']
- preview_video_url = preview_pattern.\
- replace('{0}', puid[0]).\
- replace('{1}', puid).\
- replace('{2}', s['MEDIA_VERSION'])
formats = [{
'format_id': 'preview',
- 'url': preview_video_url,
+ 'url': s['MEDIA'][0]['HREF'],
'preference': -100, # Only the first 30 seconds
'ext': 'mp3',
}]