Commit fc5f04d8 authored by Ilkka Ollakka's avatar Ilkka Ollakka

youtube.lua: add demux=avformat,ffmpeg for options

This should help watching mp4-videos (&fmt=18 and 22 or something like that)
from youtube. ffmpeg for fallback for windows. Not idea about OS X side.
parent 3a2e995b
...@@ -38,6 +38,7 @@ function probe() ...@@ -38,6 +38,7 @@ function probe()
if vlc.access ~= "http" then if vlc.access ~= "http" then
return false return false
end end
options = {":demux=avformat,ffmpeg"}
youtube_site = string.match( string.sub( vlc.path, 1, 8 ), "youtube" ) youtube_site = string.match( string.sub( vlc.path, 1, 8 ), "youtube" )
if not youtube_site then if not youtube_site then
-- FIXME we should be using a builtin list of known youtube websites -- FIXME we should be using a builtin list of known youtube websites
...@@ -103,10 +104,10 @@ function parse() ...@@ -103,10 +104,10 @@ function parse()
format = "" format = ""
end end
if t then if t then
return { { path = base_yt_url .. "get_video?video_id="..video_id.."&t="..t..format; name = name; description = description; artist = artist; arturl = arturl } } return { { path = base_yt_url .. "get_video?video_id="..video_id.."&t="..t..format; name = name; description = description; artist = artist; arturl = arturl; options = options } }
else else
-- This shouldn't happen ... but keep it as a backup. -- This shouldn't happen ... but keep it as a backup.
return { { path = "http://www.youtube.com/v/"..video_id; name = name; description = description; artist = artist; arturl = arturl } } return { { path = "http://www.youtube.com/v/"..video_id; name = name; description = description; artist = artist; arturl = arturl; options=options } }
end end
else -- This is the flash player's URL else -- This is the flash player's URL
if string.match( vlc.path, "title=" ) then if string.match( vlc.path, "title=" ) then
...@@ -123,8 +124,8 @@ function parse() ...@@ -123,8 +124,8 @@ function parse()
if not string.match( vlc.path, "t=" ) then if not string.match( vlc.path, "t=" ) then
-- This sucks, we're missing "t" which is now mandatory. Let's -- This sucks, we're missing "t" which is now mandatory. Let's
-- try using another url -- try using another url
return { { path = "http://www.youtube.com/v/"..video_id; name = name; arturl = arturl } } return { { path = "http://www.youtube.com/v/"..video_id; name = name; arturl = arturl; options=options } }
end end
return { { path = "http://www.youtube.com/get_video.php?video_id="..video_id.."&t="..get_url_param( vlc.path, "t" )..format; name = name; arturl = arturl } } return { { path = "http://www.youtube.com/get_video.php?video_id="..video_id.."&t="..get_url_param( vlc.path, "t" )..format; name = name; arturl = arturl; options=options } }
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment