aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-10-01 22:05:18 +0700
committerSergey M․ <dstftw@gmail.com>2018-10-01 22:05:18 +0700
commit3c7da54c92b7560c3ceeb8b58a67d4759ed843d0 (patch)
tree44b43135effed8a092f6a7b74e7e128e201bd450
parent9795d93316cb63e0e2a73ee840600be7f13e19f5 (diff)
downloadyoutube-dl-3c7da54c92b7560c3ceeb8b58a67d4759ed843d0.tar.xz
[jamendo] Add support for licensing.jamendo.com (closes #17724)
-rw-r--r--youtube_dl/extractor/jamendo.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/youtube_dl/extractor/jamendo.py b/youtube_dl/extractor/jamendo.py
index 595d7a5b7..c21827618 100644
--- a/youtube_dl/extractor/jamendo.py
+++ b/youtube_dl/extractor/jamendo.py
@@ -26,8 +26,15 @@ class JamendoBaseIE(InfoExtractor):
class JamendoIE(JamendoBaseIE):
- _VALID_URL = r'https?://(?:www\.)?jamendo\.com/track/(?P<id>[0-9]+)/(?P<display_id>[^/?#&]+)'
- _TEST = {
+ _VALID_URL = r'''(?x)
+ https?://
+ (?:
+ licensing\.jamendo\.com/[^/]+|
+ (?:www\.)?jamendo\.com
+ )
+ /track/(?P<id>[0-9]+)/(?P<display_id>[^/?#&]+)
+ '''
+ _TESTS = [{
'url': 'https://www.jamendo.com/track/196219/stories-from-emona-i',
'md5': '6e9e82ed6db98678f171c25a8ed09ffd',
'info_dict': {
@@ -40,14 +47,19 @@ class JamendoIE(JamendoBaseIE):
'duration': 210,
'thumbnail': r're:^https?://.*\.jpg'
}
- }
+ }, {
+ 'url': 'https://licensing.jamendo.com/en/track/1496667/energetic-rock',
+ 'only_matching': True,
+ }]
def _real_extract(self, url):
mobj = self._VALID_URL_RE.match(url)
track_id = mobj.group('id')
display_id = mobj.group('display_id')
- webpage = self._download_webpage(url, display_id)
+ webpage = self._download_webpage(
+ 'https://www.jamendo.com/track/%s/%s' % (track_id, display_id),
+ display_id)
title, artist, track = self._extract_meta(webpage)