Lines 1-24
Link Here
|
1 |
--- youtube-dl.orig Wed Jan 30 14:18:50 2008 |
1 |
--- youtube-dl.orig 2008-06-09 09:36:33.000000000 +0400 |
2 |
+++ youtube-dl Thu Jan 31 21:36:49 2008 |
2 |
+++ youtube-dl 2008-06-09 09:43:10.000000000 +0400 |
3 |
@@ -208,6 +208,7 @@ |
3 |
@@ -216,6 +216,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='convert file to MPEG4 format') |
7 |
+cmdl_parser.add_option('-a', '--avi', action='store_true', dest='use_avi', help='convert file to MPEG4 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_parser.add_option('-2', '--title-too', action='store_true', dest='get_title', help='used with -g, print title too') |
10 |
(cmdl_opts, cmdl_args) = cmdl_parser.parse_args() |
10 |
cmdl_parser.add_option('-f', '--format', dest='video_format', metavar='FORMAT', help='append &fmt=FORMAT to the URL') |
11 |
@@ -382,6 +383,26 @@ |
11 |
@@ -420,6 +421,22 @@ |
12 |
|
12 |
|
13 |
except KeyboardInterrupt: |
13 |
except KeyboardInterrupt: |
14 |
sys.exit('\n') |
14 |
sys.exit('\n') |
|
|
15 |
- |
15 |
+ |
16 |
+ |
16 |
+# Convert to avi if needed |
17 |
+ # Convert to avi if needed |
17 |
+if cmdl_opts.use_avi and not cmdl_opts.best_quality: |
18 |
+ avi_filename = '%s.avi' % video_filename |
18 |
+ if cmdl_opts.outfile is None: |
|
|
19 |
+ avi_filename = '%s.avi' % video_filename[:-4] |
20 |
+ else: |
21 |
+ avi_filename = '%s.avi' % video_filename |
22 |
+ |
19 |
+ |
23 |
+ try: |
20 |
+ try: |
24 |
+ os.system('%%CONV2AVI_CMD%% "%s" "%s" > %s 2> %s' % (video_filename, avi_filename, os.path.devnull, os.path.devnull)) |
21 |
+ os.system('%%CONV2AVI_CMD%% "%s" "%s" > %s 2> %s' % (video_filename, avi_filename, os.path.devnull, os.path.devnull)) |
Lines 32-37
Link Here
|
32 |
+ os.unlink(video_filename) |
29 |
+ os.unlink(video_filename) |
33 |
+ except OSError: |
30 |
+ except OSError: |
34 |
+ sys.exit('Error: unable to remove downloaded file.\n') |
31 |
+ sys.exit('Error: unable to remove downloaded file.\n') |
35 |
|
32 |
+ |
36 |
# Finish |
33 |
# Finish |
37 |
sys.exit() |
34 |
sys.exit() |