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

(-)www/youtube_dl/Makefile (-1 / +1 lines)
Lines 6-12 Link Here
6
#
6
#
7
7
8
PORTNAME=	youtube_dl
8
PORTNAME=	youtube_dl
9
PORTVERSION=	2008.06.08
9
PORTVERSION=	2008.07.22
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}
(-)www/youtube_dl/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (youtube-dl-2008.06.08) = f74dad01219537fdb59c69b915f1d7ee
1
MD5 (youtube-dl-2008.07.22) = f0e3e1181b0d95df4b47af1665007f0e
2
SHA256 (youtube-dl-2008.06.08) = 3bebe8503ca41db8073a8a15a5773a8815e764a84f51f3f27c720a8c466c1c5a
2
SHA256 (youtube-dl-2008.07.22) = 67fd936d602c418627eeac275d2f0c40006f674d924ea1e3622c80d42c2fd2a1
3
SIZE (youtube-dl-2008.06.08) = 16488
3
SIZE (youtube-dl-2008.07.22) = 21398
(-)www/youtube_dl/files/conv2avi.patch (-30 / +38 lines)
Lines 1-34 Link Here
1
--- youtube-dl.orig	2008-06-09 09:36:33.000000000 +0400
1
--- youtube-dl-orig	2008-07-24 08:17:26.000000000 +0400
2
+++ youtube-dl	2008-06-09 09:43:10.000000000 +0400
2
+++ youtube-dl	2008-07-24 08:19:28.000000000 +0400
3
@@ -216,6 +216,7 @@
3
@@ -264,6 +264,22 @@
4
 cmdl_parser.add_option('-t', '--title', action='store_true', dest='use_title', help='use title in file name')
4
 					except (urllib2.URLError, httplib.HTTPException, socket.error), err:
5
 cmdl_parser.add_option('-l', '--literal', action='store_true', dest='use_literal', help='use literal title in file name')
5
 						retcode = self.trouble('ERROR: unable to download video data: %s' % str(err))
6
 cmdl_parser.add_option('-n', '--netrc', action='store_true', dest='use_netrc', help='use .netrc authentication data')
6
 						continue
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')
9
 cmdl_parser.add_option('-2', '--title-too', action='store_true', dest='get_title', help='used with -g, print title too')
10
 cmdl_parser.add_option('-f', '--format', dest='video_format', metavar='FORMAT', help='append &fmt=FORMAT to the URL')
11
@@ -420,6 +421,22 @@
12
 	
13
 	except KeyboardInterrupt:
14
 		sys.exit('\n')
15
-	
16
+
7
+
17
+	# Convert to avi if needed
8
+					# Convert to avi if needed
18
+	avi_filename = '%s.avi' % video_filename
9
+					if self._params['useavi']:
10
+						avi_filename = '%s.avi' % filename
19
+
11
+
20
+	try:
12
+						try:
21
+		os.system('%%CONV2AVI_CMD%% "%s" "%s" > %s 2> %s' % (video_filename, avi_filename, os.path.devnull, os.path.devnull))
13
+							os.system('%%CONV2AVI_CMD%% "%s" "%s" > %s 2> %s' % (filename, avi_filename, os.path.devnull, os.path.devnull))
22
+		cond_print('Video file converted to %s\n' % avi_filename)
14
+							self.to_stdout('Video file converted to %s' % avi_filename)
23
+	except OSError:
15
+						except OSError, e:
24
+		sys.exit('Error: unable to convert file.\n')
16
+							retcode = self.trouble('ERROR: unable to convert file: %s' % e.strerror)
25
+	except KeyboardInterrupt:
26
+		sys.exit('\n')
27
+
17
+
28
+	try:
18
+						try:
29
+		os.unlink(video_filename)
19
+							os.unlink(filename)
30
+	except OSError:
20
+						except OSError, e:
31
+		sys.exit('Error: unable to remove downloaded file.\n')
21
+							retcode = self.trouble('ERROR: unable to remove downloaded file: %s' % e.strerror)
32
+
22
+
33
 # Finish
23
 				break
34
 sys.exit()
24
 			if not suitable_found:
25
 				retcode = self.trouble('ERROR: no suitable InfoExtractor: %s' % url)
26
@@ -563,6 +579,8 @@
27
 				action='store_true', dest='useliteral', help='use literal title in file name', default=False)
28
 		parser.add_option('-n', '--netrc',
29
 				action='store_true', dest='usenetrc', help='use .netrc authentication data', default=False)
30
+		parser.add_option('-a', '--avi',
31
+				action='store_true', dest='useavi', help='convert file to MPEG4 format', default=False)
32
 		parser.add_option('-g', '--get-url',
33
 				action='store_true', dest='geturl', help='simulate, quiet but print URL', default=False)
34
 		parser.add_option('-e', '--get-title',
35
@@ -609,6 +627,7 @@
36
 				or (opts.useliteral and '%(title)s-%(id)s.%(ext)s')
37
 				or '%(id)s.%(ext)s'),
38
 			'ignoreerrors': opts.ignoreerrors,
39
+			'useavi': opts.useavi,
40
 			})
41
 		fd.add_info_extractor(youtube_ie)
42
 		retcode = fd.download(args)
(-)www/youtube_dl/files/patch-youtube-dl (-5 / +5 lines)
Lines 1-8 Link Here
1
--- youtube-dl-orig	Fri Aug 11 01:00:08 2006
1
--- youtube-dl-orig	2008-07-24 07:42:53.000000000 +0400
2
+++ youtube-dl	Sat Aug 12 13:46:38 2006
2
+++ youtube-dl	2008-07-24 07:45:30.000000000 +0400
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
 # -*- coding: utf-8 -*-
7
 # Copyright (c) 2006 Ricardo Garcia Gonzalez
7
 # Author: Ricardo Garcia Gonzalez
8
 #
8
 # License: Public domain code

Return to bug 125931