ports/120005: [patch] update www/youtube_dl

Gleb Smirnoff glebius at FreeBSD.org
Sat Jan 26 14:30:04 UTC 2008


>Number:         120005
>Category:       ports
>Synopsis:       [patch] update www/youtube_dl
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 26 14:30:03 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Gleb Smirnoff
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
Rambler
>Environment:
System: FreeBSD cell.glebius.int.ru 6.2-STABLE FreeBSD 6.2-STABLE #2: Thu Apr 19 00:48:33 MSD 2007 root at cell.glebius.int.ru:/usr/obj/usr/src/sys/NUCLEUS i386
>Description:
	The YouTube site has updated and old version of youtube_dl
	can't download movies. Therefore a new version of the
	youtube_dl script has been released.
>How-To-Repeat:
>Fix:
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/www/youtube_dl/Makefile,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile
--- Makefile	9 Oct 2007 11:36:05 -0000	1.15
+++ Makefile	26 Jan 2008 11:54:50 -0000
@@ -6,10 +6,10 @@
 #
 
 PORTNAME=	youtube_dl
-PORTVERSION=	2007.10.09
+PORTVERSION=	2008.01.24
 CATEGORIES=	www
 MASTER_SITES=	http://www.arrakis.es/~rggi3/youtube-dl/
-DISTNAME=	youtube-dl-${PORTVERSION}
+DISTNAME=	youtube-dl
 EXTRACT_SUFX=
 EXTRACT_ONLY=
 
@@ -33,7 +33,7 @@ EXTRA_PATCHES+=	${PATCHDIR}/ffmpeg.patch
 .endif
 
 post-extract:
-	@${CP} ${DISTDIR}/youtube-dl-${PORTVERSION} ${WRKSRC}/youtube-dl
+	@${CP} ${DISTDIR}/youtube-dl ${WRKSRC}/youtube-dl
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|%%PYTHON_CMD%%|${PYTHON_CMD}|g' ${WRKSRC}/youtube-dl
Index: distinfo
===================================================================
RCS file: /home/ncvs/ports/www/youtube_dl/distinfo,v
retrieving revision 1.14
diff -u -p -r1.14 distinfo
--- distinfo	9 Oct 2007 11:36:05 -0000	1.14
+++ distinfo	26 Jan 2008 10:50:34 -0000
@@ -1,3 +1,3 @@
-MD5 (youtube-dl-2007.10.09) = a721e6f3cbd44777bbaa73b45c4a6117
-SHA256 (youtube-dl-2007.10.09) = f1773a2d98d9c2d5cab2c7ff2526c6c1fe91c13f6588d1b0af8849989efa6949
-SIZE (youtube-dl-2007.10.09) = 15356
+MD5 (youtube-dl) = 48a7df743398bbfdf2710962000886cb
+SHA256 (youtube-dl) = 6e98f3abfa79a038e578d45441bb6675ac6d4880bae4b801d5125e364e60d5c5
+SIZE (youtube-dl) = 14643
Index: files/ffmpeg.patch
===================================================================
RCS file: /home/ncvs/ports/www/youtube_dl/files/ffmpeg.patch,v
retrieving revision 1.2
diff -u -p -r1.2 ffmpeg.patch
--- files/ffmpeg.patch	28 Mar 2007 20:44:14 -0000	1.2
+++ files/ffmpeg.patch	26 Jan 2008 11:53:42 -0000
@@ -1,14 +1,14 @@
---- youtube-dl.orig	Wed Mar 28 22:12:49 2007
-+++ youtube-dl	Wed Mar 28 22:11:38 2007
-@@ -203,6 +203,7 @@
+--- youtube-dl.orig	2008-01-24 20:13:21.000000000 +0300
++++ youtube-dl	2008-01-26 14:51:26.000000000 +0300
+@@ -208,6 +208,7 @@
  cmdl_parser.add_option('-t', '--title', action='store_true', dest='use_title', help='use title in file name')
  cmdl_parser.add_option('-l', '--literal', action='store_true', dest='use_literal', help='use literal title in file name')
  cmdl_parser.add_option('-n', '--netrc', action='store_true', dest='use_netrc', help='use .netrc authentication data')
 +cmdl_parser.add_option('-a', '--avi', action='store_true', dest='use_avi', help='output file in avi format')
  cmdl_parser.add_option('-g', '--get-url', action='store_true', dest='get_url', help='print final video URL only')
+ cmdl_parser.add_option('-2', '--title-too', action='store_true', dest='get_title', help='used with -g, print title too')
  (cmdl_opts, cmdl_args) = cmdl_parser.parse_args()
- 
-@@ -275,13 +276,21 @@
+@@ -276,7 +277,11 @@
  
  # Get output file name 
  if cmdl_opts.outfile is None:
@@ -17,10 +17,21 @@
 +		ext = 'avi'
 +	else:
 +		ext = 'flv'
-+	video_filename = '%s.%s' % (video_url_id,ext)
++	video_filename = '%s.%s' % (video_url_id, ext)
  else:
  	video_filename = cmdl_opts.outfile
  
+@@ -311,11 +316,19 @@
+ 		prefix = title_string_norm(video_title)
+ 	else:
+ 		prefix = title_string_touch(video_title)
+-	video_filename = '%s-%s.flv' % (prefix, video_url_id)
++	if cmdl_opts.use_avi:
++		ext = 'avi'
++	else:
++		ext = 'flv'
++	final_filename = '%s-%s.%s' % (prefix, video_url_id, ext)
+ 
  # Check name
 -if not video_filename.lower().endswith('.flv'):
 -	sys.stderr.write('Warning: video file name does not end in .flv\n')
@@ -31,30 +42,26 @@
 +	if not video_filename.lower().endswith('.flv'):
 +		sys.stderr.write('Warning: video file name does not end in .flv\n')
  
- # Test writable file
- if not (cmdl_opts.simulate or cmdl_opts.get_url):
-@@ -328,7 +337,10 @@
+ # Retrieve video data
+ try:
+@@ -333,10 +346,16 @@
  	if cmdl_opts.simulate or cmdl_opts.get_url:
  		sys.exit()
  
--	video_file = open(video_filename, 'wb')
+-	try:
+-		video_file = open(video_filename, 'wb')
+-	except (IOError, OSError):
+-		sys.exit('Error: unable to open "%s" for writing.' % video_filename)
 +	if cmdl_opts.use_avi:
-+		video_file = os.popen('ffmpeg -y -i - "%s" > %s 2> %s' % (video_filename, os.path.devnull, os.path.devnull), 'wb')
++		try:
++			video_file = os.popen('ffmpeg -y -i - "%s" > %s 2> %s' % (video_filename, os.path.devnull, os.path.devnull), 'wb')
++		except (IOError, OSError):
++			sys.exit('Error: unable to run ffmpeg -y -i - "%s".' % video_filename)
 +	else:
-+		video_file = open(video_filename, 'wb')
++		try:
++			video_file = open(video_filename, 'wb')
++		except (IOError, OSError):
++			sys.exit('Error: unable to open "%s" for writing.' % video_filename)
  	try:
  		video_len = long(video_data.info()['Content-length'])
  		video_len_str = format_bytes(video_len)
-@@ -382,7 +394,11 @@
- 			prefix = title_string_norm(video_title)
- 		else:
- 			prefix = title_string_touch(video_title)
--		final_filename = '%s-%s.flv' % (prefix, video_url_id)
-+		if cmdl_opts.use_avi:
-+			ext = 'avi'
-+		else:
-+			ext = 'flv'
-+		final_filename = '%s-%s.%s' % (prefix, video_url_id, ext)		
- 		os.rename(video_filename, final_filename)
- 		cond_print('Video file renamed to %s\n' % final_filename)
- 	
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list