]> jfr.im git - yt-dlp.git/blame - youtube_dl/extractor/vh1.py
[vh1] Simplify
[yt-dlp.git] / youtube_dl / extractor / vh1.py
CommitLineData
f2741c8d
PH
1from __future__ import unicode_literals
2
3ee4b60d 3from .mtv import MTVIE
f2741c8d 4
3ee4b60d
RH
5import re
6from ..utils import fix_xml_ampersands
7
f2741c8d 8
3ee4b60d 9class VH1IE(MTVIE):
f2741c8d 10 IE_NAME = 'vh1.com'
3ee4b60d 11 _FEED_URL = 'http://www.vh1.com/player/embed/AS3/fullepisode/rss/'
f2741c8d
PH
12 _TESTS = [{
13 'url': 'http://www.vh1.com/video/metal-evolution/full-episodes/progressive-metal/1678612/playlist.jhtml',
14 'playlist': [
15 {
16 'md5': '7827a7505f59633983165bbd2c119b52',
17 'info_dict': {
18 'id': '731565',
19 'ext': 'mp4',
20 'title': 'Metal Evolution: Ep. 11 Act 1',
21 'description': 'Many rock academics have proclaimed that the truly progressive musicianship of the last 20 years has been found right here in the world of heavy metal, rather than obvious locales such as jazz, fusion or progressive rock. It stands to reason then, that much of this jaw-dropping virtuosity occurs within what\'s known as progressive metal, a genre that takes root with the likes of Rush in the \'70s, Queensryche and Fates Warning in the \'80s, and Dream Theater in the \'90s. Since then, the genre has exploded with creativity, spawning mind-bending, genre-defying acts such as Tool, Mastodon, Coheed And Cambria, Porcupine Tree, Meshuggah, A Perfect Circle and Opeth. Episode 12 looks at the extreme musicianship of these bands, as well as their often extreme literary prowess and conceptual strength, the end result being a rich level of respect and attention such challenging acts have brought upon the world of heavy metal, from a critical community usually dismissive of the form.'
22 }
23 },
24 {
25 'md5': '34fb4b7321c546b54deda2102a61821f',
26 'info_dict': {
27 'id': '731567',
28 'ext': 'mp4',
29 'title': 'Metal Evolution: Ep. 11 Act 2',
30 'description': 'Many rock academics have proclaimed that the truly progressive musicianship of the last 20 years has been found right here in the world of heavy metal, rather than obvious locales such as jazz, fusion or progressive rock. It stands to reason then, that much of this jaw-dropping virtuosity occurs within what\'s known as progressive metal, a genre that takes root with the likes of Rush in the \'70s, Queensryche and Fates Warning in the \'80s, and Dream Theater in the \'90s. Since then, the genre has exploded with creativity, spawning mind-bending, genre-defying acts such as Tool, Mastodon, Coheed And Cambria, Porcupine Tree, Meshuggah, A Perfect Circle and Opeth. Episode 11 looks at the extreme musicianship of these bands, as well as their often extreme literary prowess and conceptual strength, the end result being a rich level of respect and attention such challenging acts have brought upon the world of heavy metal, from a critical community usually dismissive of the form.'
31 }
32 },
33 {
34 'md5': '813f38dba4c1b8647196135ebbf7e048',
35 'info_dict': {
36 'id': '731568',
37 'ext': 'mp4',
38 'title': 'Metal Evolution: Ep. 11 Act 3',
39 'description': 'Many rock academics have proclaimed that the truly progressive musicianship of the last 20 years has been found right here in the world of heavy metal, rather than obvious locales such as jazz, fusion or progressive rock. It stands to reason then, that much of this jaw-dropping virtuosity occurs within what\'s known as progressive metal, a genre that takes root with the likes of Rush in the \'70s, Queensryche and Fates Warning in the \'80s, and Dream Theater in the \'90s. Since then, the genre has exploded with creativity, spawning mind-bending, genre-defying acts such as Tool, Mastodon, Coheed And Cambria, Porcupine Tree, Meshuggah, A Perfect Circle and Opeth. Episode 11 looks at the extreme musicianship of these bands, as well as their often extreme literary prowess and conceptual strength, the end result being a rich level of respect and attention such challenging acts have brought upon the world of heavy metal, from a critical community usually dismissive of the form.'
40 }
41 },
42 {
43 'md5': '51adb72439dfaed11c799115d76e497f',
44 'info_dict': {
45 'id': '731569',
46 'ext': 'mp4',
47 'title': 'Metal Evolution: Ep. 11 Act 4',
48 'description': 'Many rock academics have proclaimed that the truly progressive musicianship of the last 20 years has been found right here in the world of heavy metal, rather than obvious locales such as jazz, fusion or progressive rock. It stands to reason then, that much of this jaw-dropping virtuosity occurs within what\'s known as progressive metal, a genre that takes root with the likes of Rush in the \'70s, Queensryche and Fates Warning in the \'80s, and Dream Theater in the \'90s. Since then, the genre has exploded with creativity, spawning mind-bending, genre-defying acts such as Tool, Mastodon, Coheed And Cambria, Porcupine Tree, Meshuggah, A Perfect Circle and Opeth. Episode 11 looks at the extreme musicianship of these bands, as well as their often extreme literary prowess and conceptual strength, the end result being a rich level of respect and attention such challenging acts have brought upon the world of heavy metal, from a critical community usually dismissive of the form.'
49 }
50 },
51 {
52 'md5': '93d554aaf79320703b73a95288c76a6e',
53 'info_dict': {
54 'id': '731570',
55 'ext': 'mp4',
56 'title': 'Metal Evolution: Ep. 11 Act 5',
57 'description': 'Many rock academics have proclaimed that the truly progressive musicianship of the last 20 years has been found right here in the world of heavy metal, rather than obvious locales such as jazz, fusion or progressive rock. It stands to reason then, that much of this jaw-dropping virtuosity occurs within what\'s known as progressive metal, a genre that takes root with the likes of Rush in the \'70s, Queensryche and Fates Warning in the \'80s, and Dream Theater in the \'90s. Since then, the genre has exploded with creativity, spawning mind-bending, genre-defying acts such as Tool, Mastodon, Coheed And Cambria, Porcupine Tree, Meshuggah, A Perfect Circle and Opeth. Episode 11 looks at the extreme musicianship of these bands, as well as their often extreme literary prowess and conceptual strength, the end result being a rich level of respect and attention such challenging acts have brought upon the world of heavy metal, from a critical community usually dismissive of the form.'
3ee4b60d 58 }
3ee4b60d 59 }
f2741c8d
PH
60 ],
61 '_skip': 'Blocked outside the US',
62 }, {
63 # Clip
64 'url': 'http://www.vh1.com/video/misc/706675/metal-evolution-episode-1-pre-metal-show-clip.jhtml#id=1674118',
65 'md5': '7d67cf6d9cdc6b4f3d3ac97a55403844',
66 'info_dict': {
67 'id': '706675',
68 'ext': 'mp4',
69 'title': 'Metal Evolution: Episode 1 Pre-Metal Show Clip',
70 'description': 'The greatest documentary ever made about Heavy Metal begins as our host Sam Dunn travels the globe to seek out the origins and influences that helped create Heavy Metal. Sam speaks to legends like Kirk Hammett, Alice Cooper, Slash, Bill Ward, Geezer Butler, Tom Morello, Ace Frehley, Lemmy Kilmister, Dave Davies, and many many more. This episode is the prologue for the 11 hour series, and Sam goes back to the very beginning to reveal how Heavy Metal was created.'
3ee4b60d 71 }
f2741c8d
PH
72 }, {
73 # Short link
74 'url': 'http://www.vh1.com/video/play.jhtml?id=1678353',
75 'md5': '853192b87ad978732b67dd8e549b266a',
76 'info_dict': {
77 'id': '730355',
78 'ext': 'mp4',
79 'title': 'Metal Evolution: Episode 11 Progressive Metal Sneak',
80 'description': 'In Metal Evolution\'s finale sneak, Sam sits with Michael Giles of King Crimson and gets feedback from Metallica guitarist Kirk Hammett on why the group was influential.'
3ee4b60d 81 }
f2741c8d
PH
82 }, {
83 'url': 'http://www.vh1.com/video/macklemore-ryan-lewis/900535/cant-hold-us-ft-ray-dalton.jhtml',
84 'info_dict': {
85 'id': '900535',
86 'ext': 'mp4',
87 'title': 'Macklemore & Ryan Lewis - "Can\'t Hold Us ft. Ray Dalton"',
88 'description': 'The Heist'
3ee4b60d 89 }
f2741c8d
PH
90 }]
91
92 _VALID_URL = r'''(?x)
93 https?://www\.vh1\.com/video/
94 (?:
95 .+?/full-episodes/.+?/(?P<playlist_id>[^/]+)/playlist\.jhtml
96 |
97 (?:
98 play.jhtml\?id=|
99 misc/.+?/.+?\.jhtml\#id=
100 )
101 (?P<video_id>[0-9]+)$
102 |
103 [^/]+/(?P<music_id>[0-9]+)/[^/]+?
104 )
105 '''
3ee4b60d
RH
106
107 def _real_extract(self, url):
108 mobj = re.match(self._VALID_URL, url)
f2741c8d
PH
109 if mobj.group('music_id'):
110 id_field = 'vid'
111 video_id = mobj.group('music_id')
112 else:
113 video_id = mobj.group('playlist_id') or mobj.group('video_id')
114 id_field = 'id'
115 doc_url = '%s?%s=%s' % (self._FEED_URL, id_field, video_id)
116
3ee4b60d 117 idoc = self._download_xml(
f2741c8d 118 doc_url, video_id,
3ee4b60d
RH
119 'Downloading info', transform_source=fix_xml_ampersands)
120 return [self._get_video_info(item) for item in idoc.findall('.//item')]