diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2007-01-23 08:12:49 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2007-01-23 08:12:49 +0000 |
commit | 1513d93b79c531bed2a6aed8f7b99115b1d1d0f8 (patch) | |
tree | 229359cbc707fe5221378481285395a1669f53b2 /www/youtube_dl/files | |
parent | 291d5aa3f178c9f842d3721a16d9987d6d5ec49c (diff) | |
download | ports-1513d93b79c531bed2a6aed8f7b99115b1d1d0f8.tar.gz ports-1513d93b79c531bed2a6aed8f7b99115b1d1d0f8.zip |
- Update to 2007.01.09 [1]
- Add an options to recode the movie in avi
PR: ports/107890
Submitted by: Sergio Lenzi <lenzi@k1.com.br>
Pankov Pavel <pankov_p@mail.ru> [1] (maintainer)
Notes
Notes:
svn path=/head/; revision=183055
Diffstat (limited to 'www/youtube_dl/files')
-rw-r--r-- | www/youtube_dl/files/ffmpeg.patch | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/www/youtube_dl/files/ffmpeg.patch b/www/youtube_dl/files/ffmpeg.patch new file mode 100644 index 000000000000..ff4edbedf6e9 --- /dev/null +++ b/www/youtube_dl/files/ffmpeg.patch @@ -0,0 +1,59 @@ +--- youtube-dl.orig Sat Jan 20 02:44:25 2007 ++++ youtube-dl Sat Jan 20 23:53:11 2007 +@@ -167,6 +167,7 @@ + cmdl_parser.add_option('-s', '--simulate', action='store_true', dest='simulate', help='do not download video') + cmdl_parser.add_option('-t', '--title', action='store_true', dest='use_title', help='use 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_opts, cmdl_args) = cmdl_parser.parse_args() + + # Get video URL +@@ -232,19 +233,30 @@ + + # Get output file name + if cmdl_opts.outfile is None: +- video_filename = '%s.flv' % video_url_id ++ if cmdl_opts.use_avi: ++ ext = 'avi' ++ else: ++ ext='flv' ++ video_filename = '%s.%s' % (video_url_id,ext) + else: + video_filename = cmdl_opts.outfile + + # Check name +-if not video_filename.lower().endswith('.flv'): +- sys.stderr.write('Warning: video file name does not end in .flv\n') ++if cmdl_opts.use_avi: ++ if not video_filename.lower().endswith('.avi'): ++ sys.stderr.write('Warning: video file name does not end in .avi\n') ++else: ++ 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: + try: +- disk_test = open(video_filename, 'wb') +- disk_test.close() ++ 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') ++ else: ++ disk_test = open(video_filename, 'wb') ++ disk_test.close() + + except (OSError, IOError): + sys.exit('Error: unable to open %s for writing.' % video_filename) +@@ -317,7 +329,11 @@ + # Rename video file if needed + if cmdl_opts.use_title: + try: +- final_filename = '%s-%s.flv' % (title_string_norm(video_title), video_url_id) ++ if cmdl_opts.use_avi: ++ ext = 'avi' ++ else: ++ ext = 'flv' ++ final_filename = '%s-%s.%s' % (title_string_norm(video_title), video_url_id, ext) + os.rename(video_filename, final_filename) + cond_print('Video file renamed to %s\n' % final_filename) + |