From 1c758962d30a60f6415f3f560ac64282707aca0f Mon Sep 17 00:00:00 2001 From: Toni Gundogdu Date: Wed, 4 May 2011 20:25:03 +0300 Subject: [PATCH] ted.lua: Cleanup format array * Make 'hd' the 'best' --- share/lua/website/ted.lua | 9 +++------ tests/Makefile.am | 1 - tests/Makefile.in | 1 - tests/data/format/other/ted_hd.json | 17 ----------------- 4 files changed, 3 insertions(+), 25 deletions(-) delete mode 100644 tests/data/format/other/ted_hd.json diff --git a/share/lua/website/ted.lua b/share/lua/website/ted.lua index e6f3621..df0f897 100644 --- a/share/lua/website/ted.lua +++ b/share/lua/website/ted.lua @@ -26,7 +26,7 @@ function ident(self) local C = require 'quvi/const' local r = {} r.domain = "ted.com" - r.formats = "default|best|hd" + r.formats = "default|best" r.categories = C.proto_http local U = require 'quvi/util' r.handles = U.handles(self.page_url, {r.domain}, {"/talks/.+$"}) @@ -52,12 +52,9 @@ function parse(self) local _,_,s = metadata:find('Download video to desktop') - local path = s or error("no match: standard src") -- our 'default' + local path = s or error("no match: standard src") -- 'default' - local r = self.requested_format - r = (r == 'best') and 'hd' or r -- 'best' is an alias for 'hd' - - if r == 'hd' then + if self.requested_format == 'best' then local _,_,s = metadata:find('Watch high%-res video') path = s or path -- fallback to 'default' diff --git a/tests/Makefile.am b/tests/Makefile.am index f7205dc..679ebed 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -57,7 +57,6 @@ data/format/other/youtube_mp4_1080p.json \ data/format/other/youtube_best.json \ data/format/other/cbsnews_m4v_360p.json \ data/format/other/golem_ipod.json \ -data/format/other/ted_hd.json \ data/format/other/cbsnews_best.json \ data/format/other/cbsnews_mp4_180p.json \ data/format/other/cbsnews_m4v_480p.json \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 223f6a1..156b0e4 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -262,7 +262,6 @@ data/format/other/youtube_mp4_1080p.json \ data/format/other/youtube_best.json \ data/format/other/cbsnews_m4v_360p.json \ data/format/other/golem_ipod.json \ -data/format/other/ted_hd.json \ data/format/other/cbsnews_best.json \ data/format/other/cbsnews_mp4_180p.json \ data/format/other/cbsnews_m4v_480p.json \ diff --git a/tests/data/format/other/ted_hd.json b/tests/data/format/other/ted_hd.json deleted file mode 100644 index 955207a..0000000 --- a/tests/data/format/other/ted_hd.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "host": "ted", - "page_title": "Eythor Bender demos human exoskeletons", - "page_url": "http://www.ted.com/talks/eythor_bender_demos_human_exoskeletons.html", - "id": "1104", - "format_requested": "hd", - "thumbnail_url": "http://images.ted.com/images/ted/tedindex/embed-posters/EythorBender-2011.embed_thumbnail.jpg", - "link": [ - { - "id": "1", - "length_bytes": "90208141", - "content_type": "video/mp4", - "file_suffix": "mp4", - "url": "" - } - ] -} -- 2.11.4.GIT