From a2f601e21c558dc7ae4e3640a23b81c4fdaa75d9 Mon Sep 17 00:00:00 2001 From: Toni Gundogdu Date: Thu, 17 Jan 2013 15:23:58 +0200 Subject: [PATCH] util/resolve_redirections.lua: Use updated quvi.resolve quvi.resolve will now return a table, modify resolve_redirections function to check the length of the "resolved_url" string value. Signed-off-by: Toni Gundogdu --- share/util/resolve_redirections.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/util/resolve_redirections.lua b/share/util/resolve_redirections.lua index 0cf9538..957091c 100644 --- a/share/util/resolve_redirections.lua +++ b/share/util/resolve_redirections.lua @@ -1,5 +1,5 @@ -- libquvi-scripts --- Copyright (C) 2012 Toni Gundogdu +-- Copyright (C) 2012-2013 Toni Gundogdu -- -- This file is part of libquvi-scripts . -- @@ -22,11 +22,11 @@ local ResolveExceptions = {} -- Utility functions unique to this script function resolve_redirections(qargs) -- Let libcURL resolve the URL redirections for us. - local resolved, dst = quvi.resolve(qargs.input_url) - if not resolved then return qargs.input_url end + local r = quvi.resolve(qargs.input_url) + if #r.resolved_url ==0 then return qargs.input_url end -- Apply any exception rules to the destination URL. - return ResolveExceptions.YouTube(qargs, dst) + return ResolveExceptions.YouTube(qargs, r.resolved_url) end -- -- 2.11.4.GIT