Commit a9571144 authored by Kelly Anderson's avatar Kelly Anderson Committed by Rémi Denis-Courmont

Cleanup lua script escape sequences for lua 5.2.

Converting \ to %, since 5.2 no longer accepts \.
Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent 5c261b04
......@@ -237,7 +237,7 @@ function parse_resultspage(data)
if not link then break end -- this would not be normal behavior...
_, pos, thistitle = string.find(table, "<a href=\"" .. link .. "\"[^>]*>([^<]+)</a>", pos)
if not thistitle then break end -- this would not be normal behavior...
local _, _, year = string.find(table, "\((%d+)\)", pos)
local _, _, year = string.find(table, "%((%d+)%)", pos)
-- Add this title to the list
count = count + 1
local _, _, imdbID = string.find(link, "/([^/]+)/$")
......
......@@ -67,7 +67,7 @@ function parse()
description = find( line, "h%d.->(.-)</h%d") .. ' '
end
if string.match( line, 'img src=') then
for img in string.gmatch(line, '<img src="(http://.*\.jpg)" ') do
for img in string.gmatch(line, '<img src="(http://.*%.jpg)" ') do
art_url = img
end
for i,value in pairs(playlist) do
......@@ -76,8 +76,8 @@ function parse()
else break end
end
end
if string.match( line, "class=\"hd\".-\.mov") then
for urlline,resolution in string.gmatch(line, "class=\"hd\".-href=\"(.-.mov)\".-(%d+.-p)") do
if string.match( line, 'class="hd".-%.mov') then
for urlline,resolution in string.gmatch(line, 'class="hd".-href="(.-%.mov)".-(%d+.-p)') do
urlline = string.gsub( urlline, "_"..resolution, "_h"..resolution )
table.insert( playlist, { path = urlline,
name = description .. '(' .. resolution .. ')',
......
......@@ -34,14 +34,14 @@ end
-- Probe function.
function probe()
return vlc.access == "http"
and string.match( vlc.path, "extreme.com/." )
or string.match( vlc.path, "freecaster.tv/." )
or string.match( vlc.path, "player.extreme.com/info/.")
and string.match( vlc.path, "extreme%.com/." )
or string.match( vlc.path, "freecaster%.tv/." )
or string.match( vlc.path, "player%.extreme%.com/info/.")
end
-- Parse function.
function parse()
if (string.match( vlc.path, "extreme\.com/." ) or string.match( vlc.path, "freecaster\.tv/." )) and not string.match( vlc.path, "player.extreme.com/info/") then
if (string.match( vlc.path, "extreme%.com/." ) or string.match( vlc.path, "freecaster%.tv/." )) and not string.match( vlc.path, "player%.extreme%.com/info/") then
while true do
line = vlc.readline()
if not line then break end
......@@ -54,7 +54,7 @@ function parse()
return { { path = "http://player.extreme.com/info/" .. vid; name = "extreme.com video"; } }
end
if string.match( vlc.path, "player.extreme.com/info/." ) then
if string.match( vlc.path, "player%.extreme%.com/info/." ) then
prefres = get_prefres()
gostraight = true
while true do
......
......@@ -57,7 +57,7 @@ function parse()
then
arturl = "http://www.katsomo.fi"..find( line, " src=\"(.-)\" alt=" )
end
for treeid,name in string.gmatch( line, "/\?treeId=(%d+)\">([^<]+)</a") do
for treeid,name in string.gmatch( line, '/%?treeId=(%d+)">([^<]+)</a') do
name = vlc.strings.resolve_xml_special_chars( name )
name = vlc.strings.from_charset( "ISO_8859-1", name )
path = "http://www.katsomo.fi/?treeId="..treeid
......
......@@ -23,7 +23,7 @@
-- Probe function.
function probe()
return vlc.access == "http"
and string.match( vlc.path, "video.mpora.com/watch/" )
and string.match( vlc.path, "video%.mpora%.com/watch/" )
end
-- Parse function.
......@@ -40,7 +40,7 @@ function parse()
_,_,arturl = string.find( line, "image_src\" href=\"(.*)\" />" )
end
if string.match( line, "video_src" ) then
_,_,video = string.find( line, "href=\"http://video\.mpora\.com/ep/(.*).swf\" />" )
_,_,video = string.find( line, 'href="http://video%.mpora%.com/ep/(.*)%.swf" />' )
end
end
......
......@@ -45,10 +45,10 @@ function parse()
end
-- Try to find server which has our video
if string.match( line, "<link rel=\"videothumbnail\" href=\"http://(.*)/vt/svt-") then
_,_,server = string.find (line, "<link rel=\"videothumbnail\"\ href=\"http://(.*)/vt/svt-" )
_,_,server = string.find (line, '<link rel="videothumbnail" href="http://(.*)/vt/svt-' )
end
if string.match( line, "<link rel=\"videothumbnail\" href=\"(.*)\" type=\"image/jpeg\"") then
_,_,arturl = string.find (line, "<link rel=\"videothumbnail\" href=\"(.*)\"\ type=\"image/jpeg\"")
_,_,arturl = string.find (line, '<link rel="videothumbnail" href="(.*)" type="image/jpeg"')
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