From 0d4e2968970e2a344ce81c979b78e27435c485c6 Mon Sep 17 00:00:00 2001
From: Pierre Ynard <linkfanel@yahoo.fr>
Date: Mon, 9 Jan 2012 02:25:51 +0100
Subject: [PATCH] youtube.lua: partial fix for format matching

Stereoscopic formats would get mistakenly selected
---
 share/lua/playlist/youtube.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index 38bc3201f807..fd4db30ff9a2 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -119,7 +119,7 @@ function parse()
                 if url_map then
                     -- FIXME: do this properly
                     url_map = string.gsub( url_map, "\\u0026", "&" )
-                    for url,itag in string.gmatch( url_map, "url=([^&,]+).-&itag=(%d+)" ) do
+                    for url,itag in string.gmatch( url_map, "url=([^&,]+)[^,]*&itag=(%d+)" ) do
                         -- Apparently formats are listed in quality order,
                         -- so we can afford to simply take the first one
                         if not fmt or tonumber( itag ) == tonumber( fmt ) then
-- 
GitLab