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

(-)www/youtube_dl/files/conv2avi.patch (-44 / +37 lines)
Lines 1-44 Link Here
1
Index: www/youtube_dl/files/conv2avi.patch
1
--- youtube-dl.orig	Wed Jan 30 14:18:50 2008
2
===================================================================
2
+++ youtube-dl	Thu Jan 31 21:36:49 2008
3
RCS file: www/youtube_dl/files/conv2avi.patch
3
@@ -208,6 +208,7 @@
4
diff -N www/youtube_dl/files/conv2avi.patch
4
 cmdl_parser.add_option('-t', '--title', action='store_true', dest='use_title', help='use title in file name')
5
--- /dev/null	1 Jan 1970 00:00:00 -0000
5
 cmdl_parser.add_option('-l', '--literal', action='store_true', dest='use_literal', help='use literal title in file name')
6
+++ www/youtube_dl/files/conv2avi.patch	31 Jan 2008 19:32:45 -0000
6
 cmdl_parser.add_option('-n', '--netrc', action='store_true', dest='use_netrc', help='use .netrc authentication data')
7
@@ -0,0 +1,37 @@
7
+cmdl_parser.add_option('-a', '--avi', action='store_true', dest='use_avi', help='output file in avi format')
8
+--- youtube-dl.orig	Wed Jan 30 14:18:50 2008
8
 cmdl_parser.add_option('-g', '--get-url', action='store_true', dest='get_url', help='print final video URL only')
9
++++ youtube-dl	Thu Jan 31 21:36:49 2008
9
 cmdl_parser.add_option('-2', '--title-too', action='store_true', dest='get_title', help='used with -g, print title too')
10
+@@ -208,6 +208,7 @@
10
 (cmdl_opts, cmdl_args) = cmdl_parser.parse_args()
11
+ cmdl_parser.add_option('-t', '--title', action='store_true', dest='use_title', help='use title in file name')
11
@@ -382,6 +383,26 @@
12
+ cmdl_parser.add_option('-l', '--literal', action='store_true', dest='use_literal', help='use literal title in file name')
12
 
13
+ cmdl_parser.add_option('-n', '--netrc', action='store_true', dest='use_netrc', help='use .netrc authentication data')
13
 except KeyboardInterrupt:
14
++cmdl_parser.add_option('-a', '--avi', action='store_true', dest='use_avi', help='output file in avi format')
14
 	sys.exit('\n')
15
+ cmdl_parser.add_option('-g', '--get-url', action='store_true', dest='get_url', help='print final video URL only')
15
+
16
+ cmdl_parser.add_option('-2', '--title-too', action='store_true', dest='get_title', help='used with -g, print title too')
16
+# Convert to avi if needed
17
+ (cmdl_opts, cmdl_args) = cmdl_parser.parse_args()
17
+if cmdl_opts.use_avi:
18
+@@ -382,6 +383,26 @@
18
+	if cmdl_opts.outfile is None:
19
+ 
19
+		avi_filename = '%s.avi' % video_filename[:-4]
20
+ except KeyboardInterrupt:
20
+	else:
21
+ 	sys.exit('\n')
21
+		avi_filename = '%s.avi' % video_filename
22
++
22
+
23
++# Convert to avi if needed
23
+	try:
24
++if cmdl_opts.use_avi:
24
+		os.system('%%CONV2AVI_CMD%% "%s" "%s" > %s 2> %s' % (video_filename, avi_filename, os.path.devnull, os.path.devnull))
25
++	if cmdl_opts.outfile is None:
25
+		cond_print('Video file converted to %s\n' % avi_filename)
26
++		avi_filename = '%s.avi' % video_filename[:-4]
26
+	except OSError:
27
++	else:
27
+		sys.exit('Error: unable to convert file.\n')
28
++		avi_filename = '%s.avi' % video_filename
28
+	except KeyboardInterrupt:
29
++
29
+		sys.exit('\n')
30
++	try:
30
+
31
++		os.system('%%CONV2AVI_CMD%% "%s" "%s" > %s 2> %s' % (video_filename, avi_filename, os.path.devnull, os.path.devnull))
31
+	try:
32
++		cond_print('Video file converted to %s\n' % avi_filename)
32
+		os.unlink(video_filename)
33
++	except OSError:
33
+	except OSError:
34
++		sys.exit('Error: unable to convert file.\n')
34
+		sys.exit('Error: unable to remove downloaded file.\n')
35
++	except KeyboardInterrupt:
35
 
36
++		sys.exit('\n')
36
 # Finish
37
++
37
 sys.exit()
38
++	try:
39
++		os.unlink(video_filename)
40
++	except OSError:
41
++		sys.exit('Error: unable to remove downloaded file.\n')
42
+ 
43
+ # Finish
44
+ sys.exit()

Return to bug 120301