Add support for links from players embedded in third party pages.

ok martynas@
This commit is contained in:
jsg 2008-09-11 11:58:09 +00:00
parent a9bbce840f
commit 51cd836e2e
2 changed files with 6 additions and 3 deletions

View File

@ -1,8 +1,8 @@
# $OpenBSD: Makefile,v 1.18 2008/06/11 05:04:37 landry Exp $
# $OpenBSD: Makefile,v 1.19 2008/09/11 11:58:09 jsg Exp $
COMMENT= customizable script to fetch youtube videos
PKGNAME= yt-8p7
PKGNAME= yt-8p8
CATEGORIES= net
DISTFILES=

View File

@ -1,5 +1,5 @@
#!/usr/local/bin/lua
-- $OpenBSD: yt.lua,v 1.12 2008/06/02 17:43:10 martynas Exp $
-- $OpenBSD: yt.lua,v 1.13 2008/09/11 11:58:09 jsg Exp $
-- Fetch videos from YouTube.com and convert them to MPEG.
-- Written by Pedro Martelletto in August 2006. Public domain.
-- Example: lua yt.lua http://www.youtube.com/watch?v=c5uoo1Kl_uA
@ -18,6 +18,9 @@ convert = "ffmpeg -y -i <flv> -b 1000k -f mp4 -vcodec mpeg4 -acodec libfaac -ab
-- Set this to the base location where to fetch YouTube videos from.
base_url = "http://www.youtube.com/get_video"
-- Convert embedded links to the correct form
url = string.gsub(url, "/v/", "/watch?v=")
-- Fetch the page holding the embedded video.
print(string.format("Getting %s ...", url))
body = assert(http.request(url))