youtube recently changed page formats so all the scrapers are
currently broken; here is a diff to fix youtube-dl.

Index: Makefile
===================================================================
RCS file: /cvs/ports/www/youtube-dl/Makefile,v
retrieving revision 1.22
diff -u -p -r1.22 Makefile
--- Makefile    8 Jun 2011 18:15:30 -0000       1.22
+++ Makefile    4 Aug 2011 13:27:39 -0000
@@ -4,7 +4,7 @@ COMMENT =       command-line program to downlo
 
 V =            2011.03.29
 DISTNAME =     youtube-dl-${V}
-REVISION =     0
+REVISION =     1
 WRKDIST =      ${WRKDIR}/youtube-dl
 DIST_SUBDIR =  youtube-dl
 CATEGORIES =   www
Index: patches/patch-youtube-dl
===================================================================
RCS file: /cvs/ports/www/youtube-dl/patches/patch-youtube-dl,v
retrieving revision 1.5
diff -u -p -r1.5 patch-youtube-dl
--- patches/patch-youtube-dl    31 May 2011 17:36:01 -0000      1.5
+++ patches/patch-youtube-dl    4 Aug 2011 13:27:39 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-youtube-dl,v 1.5 2011/05/31 17:36:01 dcoppa Exp $
---- youtube-dl.orig    Tue May 31 16:25:23 2011
-+++ youtube-dl Tue May 31 16:25:23 2011
+--- youtube-dl.orig    Thu Aug  4 14:19:18 2011
++++ youtube-dl Thu Aug  4 14:24:08 2011
 @@ -634,7 +634,7 @@ class FileDownloader(object):
                # Download using rtmpdump. rtmpdump returns exit code 2 when
                # the connection was interrumpted and resuming appears to be
@@ -10,3 +10,17 @@ $OpenBSD: patch-youtube-dl,v 1.5 2011/05
                retval = subprocess.call(basic_args + [[], ['-e', '-k', 
'1']][self.params.get('continuedl', False)])
                while retval == 2 or retval == 1:
                        prevsize = os.path.getsize(tmpfilename)
+@@ -1079,8 +1079,11 @@ class YoutubeIE(InfoExtractor):
+               # Decide which formats to download
+               req_format = self._downloader.params.get('format', None)
+ 
+-              if 'fmt_url_map' in video_info and 
len(video_info['fmt_url_map']) >= 1 and ',' in video_info['fmt_url_map'][0]:
+-                      url_map = dict(tuple(pair.split('|')) for pair in 
video_info['fmt_url_map'][0].split(','))
++              if 'url_encoded_fmt_stream_map' in video_info and 
len(video_info['url_encoded_fmt_stream_map']) >= 1:
++                      url_data_strs = 
video_info['url_encoded_fmt_stream_map'][0].split(',')
++                      url_data = [dict(pairStr.split('=') for pairStr in 
uds.split('&')) for uds in url_data_strs]
++                      url_map = dict((ud['itag'], urllib.unquote(ud['url'])) 
for ud in url_data)
++
+                       format_limit = 
self._downloader.params.get('format_limit', None)
+                       if format_limit is not None and format_limit in 
self._available_formats:
+                               format_list = 
self._available_formats[self._available_formats.index(format_limit):]

Reply via email to