adapt to recent youtube changes

ok martynas@ ajacoutot@ dcoppa@
tested by matthieu@
This commit is contained in:
jsg 2012-09-30 02:45:04 +00:00
parent b797312fb6
commit 0d86481a73
2 changed files with 8 additions and 4 deletions

View File

@ -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=

View File

@ -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.