reassign 640422 src:libquvi forwarded 640422 http://sourceforge.net/apps/trac/quvi/attachment/ticket/71/ thanks
Thanks for your quick reply. I wrote a patch for quvi and reassign this bug to quvi.
From d91c53a19e60dafd7a638c05a4762cf3c09498b6 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme <robo...@celest.fr> Date: Tue, 6 Sep 2011 12:45:51 +0200 Subject: [PATCH] Add Videobash support --- share/Makefile.am | 1 + share/lua/website/videobash.lua | 59 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 0 deletions(-) create mode 100644 share/lua/website/videobash.lua diff --git a/share/Makefile.am b/share/Makefile.am index 24def60..867358d 100644 --- a/share/Makefile.am +++ b/share/Makefile.am @@ -44,6 +44,7 @@ lua/website/tagtele.lua \ lua/website/ted.lua \ lua/website/tmunderground.lua \ lua/website/theonion.lua \ +lua/website/videobash.lua \ lua/website/vimeo.lua \ lua/website/yfrog.lua \ lua/website/youtube.lua diff --git a/share/lua/website/videobash.lua b/share/lua/website/videobash.lua new file mode 100644 index 0000000..e627432 --- /dev/null +++ b/share/lua/website/videobash.lua @@ -0,0 +1,59 @@ + +-- quvi +-- Copyright (C) 2011 Thomas Preud'homme <robo...@celest.fr> +-- +-- This file is part of quvi <http://quvi.sourceforge.net/>. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public +-- License as published by the Free Software Foundation; either +-- version 2.1 of the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +-- 02110-1301 USA +-- + +-- Identify the script. +function ident (self) + package.path = self.script_dir .. '/?.lua' + local C = require 'quvi/const' + local r = {} + r.domain = "videobash.com" + r.formats = "default" + r.categories = C.proto_http + local U = require 'quvi/util' + r.handles = U.handles(self.page_url, {r.domain}, {"/video_show/"}) + return r +end + +-- Query available formats. +function query_formats(self) + self.formats = 'default' + return self +end + +-- Parse media URL. +function parse (self) + self.host_id = "videobash" + local page = quvi.fetch(self.page_url) + + local _,_,s = page:find("<title>(.-)%s+-") + self.title = s or error ("no match: media title") + + local _,_,s = page:find("%?id=(.-)&") + self.id = s or error ("no match: media id") + + local _,_,s = page:find("video_url=(.-)%?") + self.url = {s or error ("no match: flv")} + + return self +end + +-- vim: set ts=4 sw=4 tw=72 expandtab: -- 1.7.5.4
signature.asc
Description: This is a digitally signed message part.