class MySpaceIE(InfoExtractor):
- _VALID_URL = r'https?://myspace\.com/([^/]+)/(?:video/[^/]+/|music/song/.*?)(?P<id>\d+)'
+ _VALID_URL = r'https?://myspace\.com/([^/]+)/(?P<mediatype>video/[^/]+/|music/song/.*?)(?P<id>\d+)'
_TESTS = [
{
video_id = mobj.group('id')
webpage = self._download_webpage(url, video_id)
- if 'music/song' in url:
+ if mobj.group('mediatype').startswith('music/song'):
# songs don't store any useful info in the 'context' variable
def search_data(name):
return self._search_regex(r'data-%s="(.*?)"' % name, webpage,
- name)
+ name)
streamUrl = search_data('stream-url')
info = {
'id': video_id,
}
else:
context = json.loads(self._search_regex(r'context = ({.*?});', webpage,
- u'context'))
+ u'context'))
video = context['video']
streamUrl = video['streamUrl']
info = {