[vlc-commits] vocaroo.lua: remove obsolete {old,beta}.vocaroo.com support

Pierre Ynard git at videolan.org
Fri Oct 30 13:18:50 CET 2020


vlc/vlc-3.0 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Fri Oct 30 12:55:12 2020 +0100| [dea74fff739f534b1f7c60e3e2aadd638e09682d] | committer: Pierre Ynard

vocaroo.lua: remove obsolete {old,beta}.vocaroo.com support

These domains are now instead directly redirected to the main
vocaroo.com domain and platform.

(cherry picked from commit eb4ee4f6821588ba4fcd6fdf1b83379e0f05daa0)
Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=dea74fff739f534b1f7c60e3e2aadd638e09682d
---

 share/lua/playlist/vocaroo.lua | 29 ++++++-----------------------
 1 file changed, 6 insertions(+), 23 deletions(-)

diff --git a/share/lua/playlist/vocaroo.lua b/share/lua/playlist/vocaroo.lua
index 3fc16a3acc..b9c112ef9a 100644
--- a/share/lua/playlist/vocaroo.lua
+++ b/share/lua/playlist/vocaroo.lua
@@ -1,7 +1,7 @@
 --[[
  $Id$
 
- Copyright © 2016, 2019 the VideoLAN team
+ Copyright © 2016, 2019-2020 the VideoLAN team
 
  Authors: Pierre Ynard
 
@@ -20,34 +20,17 @@
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 --]]
 
--- Set to "mp3", "ogg", "flac" or "wav"
-local fmt = "mp3"
-
 -- Probe function.
 function probe()
     return ( vlc.access == "http" or vlc.access == "https" )
-        and ( string.match( vlc.path, "^old%.vocaroo%.com/i/" )
-            or string.match( vlc.path, "^beta%.vocaroo%.com/." )
-            or string.match( vlc.path, "^vocaroo%.com/." ) )
+        and string.match( vlc.path, "^vocaroo%.com/." )
 end
 
 -- Parse function.
 function parse()
-    -- At the moment, a new/beta platform coexists with the old one:
-    -- classic URLs for old media are redirected to the old platform,
-    -- while new media seems accessible only through the new platform.
-
-    -- With either platform, HTML pages contain no metadata and are not
-    -- worth parsing.
-
-    if string.match( vlc.path, "^old%.vocaroo%.com/" ) then -- Old platform
-        local id = string.match( vlc.path, "vocaroo%.com/i/([^?]*)" )
-        local path = vlc.access.."://old.vocaroo.com/media_command.php?media="..id.."&command=download_"..fmt
-        return { { path = path } }
-    else -- New/beta platform
-        local id = string.match( vlc.path, "vocaroo%.com/([^?]+)" )
-        local path = vlc.access.."://media.vocaroo.com/mp3/"..id
-        return { { path = path } }
-    end
+    -- The HTML page contains no metadata and is not worth parsing
+    local id = string.match( vlc.path, "^vocaroo%.com/([^?]+)" )
+    local path = vlc.access.."://media.vocaroo.com/mp3/"..id
+    return { { path = path } }
 end
 



More information about the vlc-commits mailing list