View | Details | Raw Unified | Return to bug 119990
Collapse All | Expand All

(-)Makefile (-1 / +1 lines)
Lines 6-12 Link Here
6
#
6
#
7
7
8
PORTNAME=	youtube_dl
8
PORTNAME=	youtube_dl
9
PORTVERSION=	2007.10.09
9
PORTVERSION=	2008.01.24
10
CATEGORIES=	www
10
CATEGORIES=	www
11
MASTER_SITES=	http://www.arrakis.es/~rggi3/youtube-dl/
11
MASTER_SITES=	http://www.arrakis.es/~rggi3/youtube-dl/
12
DISTNAME=	youtube-dl-${PORTVERSION}
12
DISTNAME=	youtube-dl-${PORTVERSION}
(-)distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (youtube-dl-2007.10.09) = a721e6f3cbd44777bbaa73b45c4a6117
1
MD5 (youtube-dl-2008.01.24) = 48a7df743398bbfdf2710962000886cb
2
SHA256 (youtube-dl-2007.10.09) = f1773a2d98d9c2d5cab2c7ff2526c6c1fe91c13f6588d1b0af8849989efa6949
2
SHA256 (youtube-dl-2008.01.24) = 6e98f3abfa79a038e578d45441bb6675ac6d4880bae4b801d5125e364e60d5c5
3
SIZE (youtube-dl-2007.10.09) = 15356
3
SIZE (youtube-dl-2008.01.24) = 14643
(-)files/patch-youtube-dl (-3 / +3 lines)
Lines 1-8 Link Here
1
--- youtube-dl-orig	Fri Aug 11 01:00:08 2006
1
--- youtube-dl-orig	2008-01-24 18:13:29.000000000 +0100
2
+++ youtube-dl	Sat Aug 12 13:46:38 2006
2
+++ youtube-dl	2008-01-26 02:25:54.000000000 +0100
3
@@ -1,4 +1,4 @@
3
@@ -1,4 +1,4 @@
4
-#!/usr/bin/env python
4
-#!/usr/bin/env python
5
+#!%%PYTHON_CMD%%
5
+#!%%PYTHON_CMD%%
6
 #
6
 #
7
 # Copyright (c) 2006 Ricardo Garcia Gonzalez
7
 # Copyright (c) 2006-2008 Ricardo Garcia Gonzalez
8
 #
8
 #
(-)files/ffmpeg.patch (-27 / +25 lines)
Lines 1-14 Link Here
1
--- youtube-dl.orig	Wed Mar 28 22:12:49 2007
1
--- youtube-dl.orig	2008-01-24 18:13:29.000000000 +0100
2
+++ youtube-dl	Wed Mar 28 22:11:38 2007
2
+++ youtube-dl	2008-01-26 02:40:32.000000000 +0100
3
@@ -203,6 +203,7 @@
3
@@ -208,6 +208,7 @@
4
 cmdl_parser.add_option('-t', '--title', action='store_true', dest='use_title', help='use title in file name')
4
 cmdl_parser.add_option('-t', '--title', action='store_true', dest='use_title', help='use title in file name')
5
 cmdl_parser.add_option('-l', '--literal', action='store_true', dest='use_literal', help='use literal title in file name')
5
 cmdl_parser.add_option('-l', '--literal', action='store_true', dest='use_literal', help='use literal title in file name')
6
 cmdl_parser.add_option('-n', '--netrc', action='store_true', dest='use_netrc', help='use .netrc authentication data')
6
 cmdl_parser.add_option('-n', '--netrc', action='store_true', dest='use_netrc', help='use .netrc authentication data')
7
+cmdl_parser.add_option('-a', '--avi', action='store_true', dest='use_avi', help='output file in avi format')
7
+cmdl_parser.add_option('-a', '--avi', action='store_true', dest='use_avi', help='output file in avi format')
8
 cmdl_parser.add_option('-g', '--get-url', action='store_true', dest='get_url', help='print final video URL only')
8
 cmdl_parser.add_option('-g', '--get-url', action='store_true', dest='get_url', help='print final video URL only')
9
 cmdl_parser.add_option('-2', '--title-too', action='store_true', dest='get_title', help='used with -g, print title too')
9
 (cmdl_opts, cmdl_args) = cmdl_parser.parse_args()
10
 (cmdl_opts, cmdl_args) = cmdl_parser.parse_args()
10
 
11
@@ -276,7 +277,11 @@
11
@@ -275,13 +276,21 @@
12
 
12
 
13
 # Get output file name 
13
 # Get output file name 
14
 if cmdl_opts.outfile is None:
14
 if cmdl_opts.outfile is None:
Lines 21-26 Link Here
21
 else:
21
 else:
22
 	video_filename = cmdl_opts.outfile
22
 	video_filename = cmdl_opts.outfile
23
 
23
 
24
@@ -311,11 +316,19 @@
25
 		prefix = title_string_norm(video_title)
26
 	else:
27
 		prefix = title_string_touch(video_title)
28
-	video_filename = '%s-%s.flv' % (prefix, video_url_id)
29
+	if cmdl_opts.use_avi:
30
+		ext = 'avi'
31
+	else:
32
+		ext = 'flv'
33
+	video_filename = '%s-%s.%s' % (prefix, video_url_id, ext)
34
 
24
 # Check name
35
 # Check name
25
-if not video_filename.lower().endswith('.flv'):
36
-if not video_filename.lower().endswith('.flv'):
26
-	sys.stderr.write('Warning: video file name does not end in .flv\n')
37
-	sys.stderr.write('Warning: video file name does not end in .flv\n')
Lines 31-60 Link Here
31
+	if not video_filename.lower().endswith('.flv'):
42
+	if not video_filename.lower().endswith('.flv'):
32
+		sys.stderr.write('Warning: video file name does not end in .flv\n')
43
+		sys.stderr.write('Warning: video file name does not end in .flv\n')
33
 
44
 
34
 # Test writable file
45
 # Retrieve video data
35
 if not (cmdl_opts.simulate or cmdl_opts.get_url):
46
 try:
36
@@ -328,7 +337,10 @@
47
@@ -334,7 +347,10 @@
37
 	if cmdl_opts.simulate or cmdl_opts.get_url:
38
 		sys.exit()
48
 		sys.exit()
39
 
49
 
40
-	video_file = open(video_filename, 'wb')
41
+	if cmdl_opts.use_avi:
42
+		video_file = os.popen('ffmpeg -y -i - "%s" > %s 2> %s' % (video_filename, os.path.devnull, os.path.devnull), 'wb')
43
+	else:
44
+		video_file = open(video_filename, 'wb')
45
 	try:
50
 	try:
46
 		video_len = long(video_data.info()['Content-length'])
51
-		video_file = open(video_filename, 'wb')
47
 		video_len_str = format_bytes(video_len)
48
@@ -382,7 +394,11 @@
49
 			prefix = title_string_norm(video_title)
50
 		else:
51
 			prefix = title_string_touch(video_title)
52
-		final_filename = '%s-%s.flv' % (prefix, video_url_id)
53
+		if cmdl_opts.use_avi:
52
+		if cmdl_opts.use_avi:
54
+			ext = 'avi'
53
+			video_file = os.popen('ffmpeg -y -i - "%s" > %s 2> %s' % (video_filename, os.path.devnull, os.path.devnull), 'wb')
55
+		else:
54
+		else:
56
+			ext = 'flv'
55
+			video_file = open(video_filename, 'wb')
57
+		final_filename = '%s-%s.%s' % (prefix, video_url_id, ext)		
56
 	except (IOError, OSError):
58
 		os.rename(video_filename, final_filename)
57
 		sys.exit('Error: unable to open "%s" for writing.' % video_filename)
59
 		cond_print('Video file renamed to %s\n' % final_filename)
58
 	try:
60
 	

Return to bug 119990