This fix allows to use as URL provided to quvi the page in
http://www.arte.tv/guide/ which embed the video.

For example it allows to use
http://www.arte.tv/guide/fr/060139-021-A/le-dessous-des-cartes
instead of the less findable
http://www.arte.tv/arte_vp/index.php?json_url=https%3A%2F%2Fapi.arte.tv%2Fapi%2Fplayer%2Fv1%2Fconfig%2Ffr%2F060139-021-A%3Fplatform%3DARTEPLUS7

Signed-off-by: Francois Joulaud <[email protected]>
---
 share/media/arte.lua | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/share/media/arte.lua b/share/media/arte.lua
index f5ce1e7..3215fc3 100644
--- a/share/media/arte.lua
+++ b/share/media/arte.lua
@@ -38,8 +38,15 @@ function parse(qargs)
 
   -- Fetch the video data JSON.
   local p = quvi.http.fetch(qargs.input_url).data
-  local u = p:match('arte_vp_url="(.-/ALL%.json)"')
-              or error('no match: config URL')
+  local u = p:match('arte_vp_url_oembed=.(.-). ')
+  if u then
+     u = u:gsub('/oembed/', '/config/', 1)
+  else
+     u = p:match('arte_vp_url="(.-/ALL%.json)"')
+  end
+  if not u then
+     error('neither oembed URL nor config URL was found')
+  end
   local c = quvi.http.fetch(u).data
   local j = J.decode(c)
 
-- 
2.8.1

------------------------------------------------------------------------------
_______________________________________________
quvi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/quvi-devel

Reply via email to