[vlc-commits] [Git][videolan/vlc][master] lua: dailymotion: use JSON metadata for title, artist and thumbnails

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Jun 17 04:40:51 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
22155cf0 by Ansh Somra at 2026-06-17T04:25:25+00:00
lua: dailymotion: use JSON metadata for title, artist and thumbnails

- - - - -


1 changed file:

- share/lua/playlist/dailymotion.lua


Changes:

=====================================
share/lua/playlist/dailymotion.lua
=====================================
@@ -54,12 +54,22 @@ function parse()
             local line = metadata:readline() -- data is on one line only
 
             -- TODO: fetch "title" and resolve \u escape sequences
-            -- FIXME: use "screenname" instead and resolve \u escape sequences
-            artist = string.match( line, '"username":"([^"]+)"' )
-
-            local poster = string.match( line, '"poster_url":"([^"]+)"' )
-            if poster then
-                arturl = string.gsub( poster, "\\/", "/")
+            -- handled via JSON instead of HTML fields
+             local name_json = string.match(line, '"title":"(.-)"')
+            if name_json then
+                name_json = string.gsub(name_json, '\\"', '"')
+                name = name_json
+            end
+            -- Artist (handled via JSON instead of HTML)
+            artist = string.match( line, '"screenname":"([^"]+)"' )
+                    or string.match(line, '"username":"([^"]+)"')
+                
+            -- Thumbnail  parsed from JSON metadata
+           local thumb = string.match(line, '"thumbnails":{.-"1080":"([^"]+)"') or
+             string.match(line, '"thumbnails":{.-"720":"([^"]+)"')              or
+            string.match(line, '"thumbnails":{.-"480":"([^"]+)"')
+            if thumb then
+                arturl = string.gsub(thumb, "\\/", "/")
             end
 
             local streams = string.match( line, "\"qualities\":{(.-%])}" )



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/22155cf0aada5522dfab6fb161d81607932f50da

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/22155cf0aada5522dfab6fb161d81607932f50da
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list