Add initial and very WIP DCGI for mediasetplay - gophercgis - Collection of gopher CGI/DCGI for geomyidae
(HTM) hg clone https://bitbucket.org/iamleot/gophercgis
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) changeset 5ab3bc8436ea9493e9e4db4d8095f9f49d1c7733
(DIR) parent 1fcd81f7437f77d77ca11a0377770af69b8b4094
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Wed, 2 Jan 2019 01:13:33
Add initial and very WIP DCGI for mediasetplay
ATM only the `film' category was tested.
Diffstat:
mediasetplay/category.dcgi | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)
---
diff -r 1fcd81f7437f -r 5ab3bc8436ea mediasetplay/category.dcgi
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasetplay/category.dcgi Wed Jan 02 01:13:33 2019 +0100
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+. ../common/config.sh
+
+CGI="${CGI_BASEDIR}/mediasetplay/category.dcgi"
+
+case "$2" in
+*/*)
+ category=${2%%/*}
+ start_index=${2##*/}
+ ;;
+*)
+ category=$2
+ start_index=1
+ ;;
+esac
+
+url="https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-programs?byTags=category:${category}&startIndex=${start_index}"
+
+curl -Lgs "${url}" |
+jq -r '
+ ( .entries[] |
+ "[h|\(.title | gsub("\\|"; "\\|"))|https:\(."mediasetprogram$videoPageUrl")|server|port]",
+ "t\(.description)",
+ "t" ),
+ if .entryCount == .itemsPerPage then
+ "[1|Next|'"${CGI}?${category}/"'" + ((.startIndex + .entryCount) | tostring) + "|server|port]"
+ else
+ empty
+ end
+'