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

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


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Fri Oct 30 12:55:12 2020 +0100| [eb4ee4f6821588ba4fcd6fdf1b83379e0f05daa0] | 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.

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

 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