1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-27 05:10:36 +00:00

- Remove support for FFMPEG and FLV2MPEG4, the code was changed and

these unofficial patchs aren't more applicable.
- From now on USE_PYTHON = 2.5+.
- Bump PORTREVISION.

Reported by:	barbara <barbara.xxx1975@libero.it>,
		Robert Huff <roberthuff@rcn.com>
This commit is contained in:
Marcelo Araujo 2009-05-06 00:28:19 +00:00
parent 195a420e1c
commit f3040a50b2
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=233278
3 changed files with 3 additions and 76 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= youtube_dl
PORTVERSION= 2009.04.25
PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= http://bitbucket.org/rg3/youtube-dl/raw/c42582904adf/
DISTNAME= youtube-dl
@ -19,40 +20,14 @@ COMMENT= A program for downloading videos from YouTube.com
NO_WRKSUBDIR= yes
NO_BUILD= yes
USE_PYTHON= 2.4+
USE_PYTHON= 2.5+
PLIST_FILES= bin/youtube-dl
OPTIONS= FFMPEG "Use ffmpeg for avi output" off \
FLV2MPEG4 "Use flv2mpeg4 for avi output" off
.include <bsd.port.pre.mk>
.if defined(WITH_FFMPEG) || defined(WITH_FLV2MPEG4)
EXTRA_PATCHES+= ${PATCHDIR}/conv2avi.patch
.endif
.if defined(WITH_FFMPEG)
.if defined (WITH_FLV2MPEG4)
IGNORE= cannot use WITH_FFMPEG and WITH_FLV2MPEG4 simultaneously
.endif
CONV2AVI_CMD= ${PREFIX}/bin/ffmpeg -y -i
RUN_DEPENDS+= ffmpeg:${PORTSDIR}/multimedia/ffmpeg
.elif defined (WITH_FLV2MPEG4)
CONV2AVI_CMD= ${PREFIX}/bin/flv2mpeg4
RUN_DEPENDS+= flv2mpeg4:${PORTSDIR}/multimedia/flv2mpeg4
.endif
post-extract:
@${CP} ${DISTDIR}/youtube-dl ${WRKSRC}/youtube-dl
post-patch:
@${REINPLACE_CMD} -e 's|%%PYTHON_CMD%%|${PYTHON_CMD}|' ${WRKSRC}/youtube-dl
.if defined(WITH_FFMPEG) || defined(WITH_FLV2MPEG4)
@${REINPLACE_CMD} -e 's|%%CONV2AVI_CMD%%|${CONV2AVI_CMD}|' ${WRKSRC}/youtube-dl
.endif
do-install:
@${INSTALL_SCRIPT} ${WRKSRC}/youtube-dl ${PREFIX}/bin/youtube-dl
.include <bsd.port.post.mk>
.include <bsd.port.mk>

View File

@ -1,40 +0,0 @@
--- youtube-dl.orig 2009-02-18 15:18:40.981138312 +0800
+++ youtube-dl 2009-02-18 15:20:30.904521591 +0800
@@ -315,6 +315,20 @@
retcode = self.trouble('ERROR: postprocessing: %s' % str(err))
continue
+ # Convert to avi if needed
+ if self._params['useavi']:
+ avi_filename = '%s.avi' % filename
+
+ try:
+ os.system('%%CONV2AVI_CMD%% "%s" "%s" > %s 2> %s' % (filename, avi_filename, os.path.devnull, os.path.devnull))
+ self.to_stdout('Video file converted to %s' % avi_filename)
+ except OSError, e:
+ retcode = self.trouble('ERROR: unable to convert file: %s' % e.strerror)
+
+ try:
+ os.unlink(filename)
+ except OSError, e:
+ retcode = self.trouble('ERROR: unable to remove downloaded file: %s' % e.strerror)
break
if not suitable_found:
retcode = self.trouble('ERROR: no suitable InfoExtractor: %s' % url)
@@ -964,6 +978,8 @@
action='store_true', dest='useliteral', help='use literal title in file name', default=False)
parser.add_option('-n', '--netrc',
action='store_true', dest='usenetrc', help='use .netrc authentication data', default=False)
+ parser.add_option('-a', '--avi',
+ action='store_true', dest='useavi', help='convert file to MPEG4 format', default=False)
parser.add_option('-g', '--get-url',
action='store_true', dest='geturl', help='simulate, quiet but print URL', default=False)
parser.add_option('-e', '--get-title',
@@ -1037,6 +1053,7 @@
or u'%(id)s.%(ext)s'),
'ignoreerrors': opts.ignoreerrors,
'ratelimit': opts.ratelimit,
+ 'useavi': opts.useavi,
'nooverwrites': opts.nooverwrites,
})
fd.add_info_extractor(youtube_search_ie)

View File

@ -1,8 +0,0 @@
--- youtube-dl.orig 2009-02-18 15:17:26.576520965 +0800
+++ youtube-dl 2009-02-18 15:17:42.870252710 +0800
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!%%PYTHON_CMD%%
# -*- coding: utf-8 -*-
# Author: Ricardo Garcia Gonzalez
# Author: Danny Colligan