From 0d86481a7348c46e06d9d83a003c69ee73aaa26e Mon Sep 17 00:00:00 2001 From: jsg Date: Sun, 30 Sep 2012 02:45:04 +0000 Subject: [PATCH] adapt to recent youtube changes ok martynas@ ajacoutot@ dcoppa@ tested by matthieu@ --- net/yt/Makefile | 5 ++--- net/yt/files/yt.lua | 7 ++++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/net/yt/Makefile b/net/yt/Makefile index 793d41c47fb..6e2a8c0f997 100644 --- a/net/yt/Makefile +++ b/net/yt/Makefile @@ -1,11 +1,10 @@ -# $OpenBSD: Makefile,v 1.46 2012/09/19 08:15:09 jasper Exp $ +# $OpenBSD: Makefile,v 1.47 2012/09/30 02:45:04 jsg Exp $ PKG_ARCH = * COMMENT= fetch YouTube and Google videos -PKGNAME= yt-19 -REVISION= 1 +PKGNAME= yt-20 CATEGORIES= net www DISTFILES= diff --git a/net/yt/files/yt.lua b/net/yt/files/yt.lua index 2900cdcbbab..e081c29fc05 100644 --- a/net/yt/files/yt.lua +++ b/net/yt/files/yt.lua @@ -1,5 +1,5 @@ #!${MODLUA_BIN} --- $OpenBSD: yt.lua,v 1.35 2012/08/06 09:47:20 sthen Exp $ +-- $OpenBSD: yt.lua,v 1.36 2012/09/30 02:45:04 jsg Exp $ -- Fetch videos from YouTube.com/Videos.Google.com, and convert to MPEG. -- Written by Pedro Martelletto and Martynas Venckus. Public domain. -- Example: lua yt.lua http://www.youtube.com/watch?v=c5uoo1Kl_uA @@ -113,6 +113,11 @@ for i = 1, table.getn(urls) do body = table.concat(t) body = url_decode(body) encurl = string.match(body, "url=(http[^,=&]-cache.-type.-)[&;]") + -- signature + sig = string.match(body, "sig=(.-)&") + if sig then + encurl = encurl .. "&signature=" .. sig + end url = string.format("\"%s\"", encurl) else -- We assume it's Google Video URL.