summaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2014-02-07 18:13:23 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2014-02-07 18:13:23 +0100
commit63de3c669009f37e8a3d214d11999ff7ed2835b8 (patch)
tree3b55c30c43dd6dcb4f9487f551be028181e1c85c /.local
parent8abf288264d0119eb85009fb77c055088aef038f (diff)
downloaddotfiles-63de3c669009f37e8a3d214d11999ff7ed2835b8.tar.gz
dotfiles-63de3c669009f37e8a3d214d11999ff7ed2835b8.tar.bz2
dotfiles-63de3c669009f37e8a3d214d11999ff7ed2835b8.zip
quvi/putlocker: Extend to also handle sockshare.com
Seems they have exactly the same script so we can use the same code.
Diffstat (limited to '.local')
-rw-r--r--.local/share/libquvi-scripts/media/putlocker.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/.local/share/libquvi-scripts/media/putlocker.lua b/.local/share/libquvi-scripts/media/putlocker.lua
index f3abebc..e0b81b9 100644
--- a/.local/share/libquvi-scripts/media/putlocker.lua
+++ b/.local/share/libquvi-scripts/media/putlocker.lua
@@ -5,7 +5,7 @@ local Putlocker = {}
-- Identify the script.
function ident(qargs)
return {
- domains = table.concat({'putlocker.com'}, ','),
+ domains = table.concat({'putlocker.com', 'sockshare.com'}, ','),
can_parse_url = Putlocker.can_parse_url(qargs)
}
end
@@ -31,10 +31,13 @@ function Putlocker.iter_streams(c, qargs)
local S = require 'quvi/stream'
url = c:match('<a href="([^"]+)" class="download_file_link"')
+ local U = require 'socket.url'
+ local t = U.parse(qargs.input_url)
-- url,container = c:match('file:%s*"(.-/)v%.(.-)"')
- local s = S.stream_new(table.concat({"http://www.putlocker.com", url}))
- --s.container = container
+
+ local s = S.stream_new(table.concat({"http://", t.host, url}))
+ --s.container = containehttp://www.sockshare.com/file/ACCFBF032A3CD770r
return { s }
end
@@ -43,7 +46,8 @@ function Putlocker.can_parse_url(qargs)
local t = U.parse(qargs.input_url)
return t and t.scheme and t.scheme:lower():match('^http$')
- and t.host and t.host:lower():match('putlocker%.com$')
+ and t.host and (t.host:lower():match('putlocker%.com$') or
+ t.host:lower():match('sockshare%.com$'))
and t.path and t.path:match("^/file/[A-Z0-9]+")
and true or false
end