[musicplayon] Relax _VALID_URL and improve metadata extraction

In r'pl=\d+&play=\d+' pages, several metadata items are missing

Closes #9222.
This commit is contained in:
Yen Chi Hsuan 2016-04-17 17:22:59 +08:00
parent b1cf58f48f
commit 0f97fb4d00
No known key found for this signature in database
GPG key ID: 3FDDD575826C5C30

View file

@ -11,9 +11,9 @@ from ..utils import (
class MusicPlayOnIE(InfoExtractor): class MusicPlayOnIE(InfoExtractor):
_VALID_URL = r'https?://(?:.+?\.)?musicplayon\.com/play(?:-touch)?\?(?:v|pl=100&play)=(?P<id>\d+)' _VALID_URL = r'https?://(?:.+?\.)?musicplayon\.com/play(?:-touch)?\?(?:v|pl=\d+&play)=(?P<id>\d+)'
_TEST = { _TESTS = [{
'url': 'http://en.musicplayon.com/play?v=433377', 'url': 'http://en.musicplayon.com/play?v=433377',
'md5': '00cdcdea1726abdf500d1e7fd6dd59bb', 'md5': '00cdcdea1726abdf500d1e7fd6dd59bb',
'info_dict': { 'info_dict': {
@ -24,10 +24,16 @@ class MusicPlayOnIE(InfoExtractor):
'duration': 342, 'duration': 342,
'uploader': 'ultrafish', 'uploader': 'ultrafish',
}, },
} }, {
'url': 'http://en.musicplayon.com/play?pl=102&play=442629',
'only_matching': True,
}]
_URL_TEMPLATE = 'http://en.musicplayon.com/play?v=%s'
def _real_extract(self, url): def _real_extract(self, url):
video_id = self._match_id(url) video_id = self._match_id(url)
url = self._URL_TEMPLATE % video_id
page = self._download_webpage(url, video_id) page = self._download_webpage(url, video_id)