From 430b5450af3332ff3d72fb4643fbc431595a3a9c Mon Sep 17 00:00:00 2001 From: Toni Gundogdu Date: Tue, 31 Jul 2012 12:05:28 +0300 Subject: [PATCH] ident: Rewrite using the "accepts" function Use the 'accepts' function from the quvi/accepts module. --- share/lua/media/dailymotion.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/share/lua/media/dailymotion.lua b/share/lua/media/dailymotion.lua index a10a7b3..2953052 100644 --- a/share/lua/media/dailymotion.lua +++ b/share/lua/media/dailymotion.lua @@ -25,14 +25,16 @@ local Dailymotion = {} -- Utility functions unique to this script. -- Identify the media script. -function ident(self) - local C = require 'quvi/const' - local r = {} - r.categories = C.proto_http - local U = require 'quvi/util' - r.handles = U.handles(self.page_url, {r.domain, "dai.ly"}, - {"/video/","/%w+$","/family_filter"}) - return r +function ident(qargs) + local A = require 'quvi/accepts' + local C = require 'quvi/const' + local d = {"dailymotion%.%w+", "dai.ly"} -- domains + local p = {"/video/", "/%w+$", "/family_filter"} -- paths + local r = { + accepts = A.accepts(qargs.input_url, d, p), + categories = C.proto_http + } + return r end -- Query available formats. -- 2.11.4.GIT