Révision 3acd948f
Ajouté par Assos Assos il y a plus de 6 ans
drupal7/sites/all/modules/media_youtube/includes/MediaInternetYouTubeHandler.inc | ||
---|---|---|
14 | 14 |
|
15 | 15 |
public function parse($embedCode) { |
16 | 16 |
$list_patterns = array( |
17 |
'@youtube\.com/playlist[#\?].*?list=([^"\& ]+)@i', |
|
18 |
'@youtube\.com/view_play_list[#\?].*?p=([^"\& ]+)@i', |
|
17 |
'@youtube\.com/playlist[#\?].*?list=([^"#\& ]+)@i',
|
|
18 |
'@youtube\.com/view_play_list[#\?].*?p=([^"#\& ]+)@i',
|
|
19 | 19 |
); |
20 | 20 |
|
21 | 21 |
foreach ($list_patterns as $pattern) { |
... | ... | |
32 | 32 |
// http://youtu.be/* |
33 | 33 |
// http://gdata.youtube.com/feeds/api/videos/* |
34 | 34 |
$patterns = array( |
35 |
'@youtube\.com/watch[#\?].*?v=([^"\& ]+).*&list=([^"\& ]+)@i',
|
|
36 |
'@youtu\.be/([^"\&\? ]+)\?list=([^"\& ]+)@i',
|
|
37 |
'@youtube\.com/embed/([^"\&\? ]+)\?list=([^"\& ]+)@i',
|
|
38 |
'@youtube\.com/watch[#\?].*?v=([^"\& ]+)@i', |
|
39 |
'@youtube\.com/embed/([^"\&\? ]+)@i', |
|
40 |
'@youtube\.com/v/([^"\&\? ]+)@i', |
|
41 |
'@youtube\.com/\?v=([^"\& ]+)@i', |
|
42 |
'@youtu\.be/([^"\&\? ]+)@i', |
|
43 |
'@gdata\.youtube\.com/feeds/api/videos/([^"\&\? ]+)@i', |
|
35 |
'@youtube\.com/watch[#\?].*?v=([^"#\& ]+).*&list=([^"#\& ]+)@i',
|
|
36 |
'@youtu\.be/([^"#\&\? ]+)\?list=([^"#\& ]+)@i',
|
|
37 |
'@youtube\.com/embed/([^"#\&\? ]+)\?list=([^"#\& ]+)@i',
|
|
38 |
'@youtube\.com/watch[#\?].*?v=([^"#\& ]+)@i',
|
|
39 |
'@youtube\.com/embed/([^"#\&\? ]+)@i',
|
|
40 |
'@youtube\.com/v/([^"#\&\? ]+)@i',
|
|
41 |
'@youtube\.com/\?v=([^"#\& ]+)@i',
|
|
42 |
'@youtu\.be/([^"#\&\? ]+)@i',
|
|
43 |
'@gdata\.youtube\.com/feeds/api/videos/([^"#\&\? ]+)@i',
|
|
44 | 44 |
); |
45 | 45 |
|
46 | 46 |
foreach ($patterns as $pattern) { |
... | ... | |
51 | 51 |
$uri = 'youtube://v/' . $matches[1][0]; |
52 | 52 |
if (isset($matches[2][0]) && $this->validId($matches[2][0], 'l')) { |
53 | 53 |
$uri .= '/l/' . $matches[2][0]; |
54 |
}
|
|
54 |
} |
|
55 | 55 |
return file_stream_wrapper_uri_normalize($uri); |
56 | 56 |
} |
57 | 57 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules