Skip to content

Commit

Permalink
Merge pull request #57 from SRGSSR/develop
Browse files Browse the repository at this point in the history
Update ParsePlayUrl javascript version to v29
  • Loading branch information
pyby authored Jul 3, 2021
2 parents 0f2c74f + 4f8b240 commit f4326a8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>ch.srgssr</groupId>
<artifactId>playfff</artifactId>
<version>33</version>
<version>34</version>
<packaging>jar</packaging>

<name>pfff</name>
Expand Down
18 changes: 12 additions & 6 deletions src/main/resources/deeplink/v1/parsePlayUrl.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// parsePlayUrl

var parsePlayUrlVersion = 28;
var parsePlayUrlVersion = 29;
var parsePlayUrlBuild = "mmf";

if(! console) {
Expand Down Expand Up @@ -98,9 +98,9 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
/**
* Catch special case: radio swiss
*
* Ex: http://www.radioswisspop.ch/de/webplayer
* Ex: http://www.radioswissclassic.ch/fr/webplayer
* Ex: http://www.radioswissjazz.ch/it/webplayer
* Ex: https://www.radioswisspop.ch/de/webplayer
* Ex: https://www.radioswissclassic.ch/fr/webplayer
* Ex: https://www.radioswissjazz.ch/it/webplayer
*/
if (bu == "radioswiss") {
var redirectBu = null;
Expand Down Expand Up @@ -234,7 +234,7 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
* Catch redirect media urls
*
* Ex: https://www.rts.ch/play/tv/redirect/detail/9938530
* Ex: http://www.srf.ch/play/tv/redirect/Detail/99f040e9-b1e6-4d7a-bc08-d5639d600aa1
* Ex: https://www.srf.ch/play/tv/redirect/Detail/99f040e9-b1e6-4d7a-bc08-d5639d600aa1
*/
switch (true) {
case pathname.includes("/tv/redirect/detail/"):
Expand Down Expand Up @@ -556,8 +556,11 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
* Catch new by date TV urls
*
* Ex: https://www.rts.ch/play/tv/emissions-par-dates/2021-06-21
* Ex: https://www.srf.ch/play/tv/programm/2021-07-03
*/
if (pathname.includes("/tv/sendungen-nach-datum/") || pathname.includes("/tv/emissions-par-dates/") || pathname.includes("/tv/programmi-per-data/") || pathname.includes("/tv/emissiuns-tenor-data/")) {
if (pathname.includes("/tv/sendungen-nach-datum/") || pathname.includes("/tv/emissions-par-dates/") || pathname.includes("/tv/programmi-per-data/") || pathname.includes("/tv/emissiuns-tenor-data/") ||
pathname.endsWith("/tv/programm") || pathname.includes("/tv/programme") || pathname.includes("/tv/program") ||
pathname.includes("/tv/programm/") || pathname.includes("/tv/programme/") || pathname.includes("/tv/program/")) {
var lastPathComponent = pathname.split("/").slice(-1)[0];

var date = null;
Expand Down Expand Up @@ -716,8 +719,11 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
* Ex: https://www.srf.ch/play/tv/hilfe
* Ex: https://www.srf.ch/play/tv/hilfe/geoblock
* Ex: https://www.rts.ch/play/tv/aide
* Ex: https://www.rts.ch/play/tv/aide/geoblocke
* Ex: https://www.rsi.ch/play/tv/guida
* Ex: https://www.rsi.ch/play/tv/guida/geobloccato
* Ex: https://www.rtr.ch/play/tv/agid
* Ex: https://www.rtr.ch/play/tv/agid/geo-blocking
* Ex: https://play.swissinfo.ch/play/tv/help
*/
if (pathname.endsWith("/hilfe") || pathname.includes("/hilfe/") || pathname.endsWith("/aide") || pathname.includes("/aide/") || pathname.endsWith("/guida") || pathname.includes("/guida/") || pathname.endsWith("/agid") || pathname.includes("/agid/") || pathname.endsWith("/help") || pathname.includes("/help/")) {
Expand Down
20 changes: 13 additions & 7 deletions src/main/resources/deeplink/v2/parsePlayUrl.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// parsePlayUrl

var parsePlayUrlVersion = 28;
var parsePlayUrlVersion = 29;
var parsePlayUrlBuild = "mmf";

if(! console) {
Expand Down Expand Up @@ -71,9 +71,9 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
/**
* Catch special case: radio swiss
*
* Ex: http://www.radioswisspop.ch/de/webplayer
* Ex: http://www.radioswissclassic.ch/fr/webplayer
* Ex: http://www.radioswissjazz.ch/it/webplayer
* Ex: https://www.radioswisspop.ch/de/webplayer
* Ex: https://www.radioswissclassic.ch/fr/webplayer
* Ex: https://www.radioswissjazz.ch/it/webplayer
*/
if (bu == "radioswiss") {
var redirectBu = null;
Expand Down Expand Up @@ -207,7 +207,7 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
* Catch redirect media urls
*
* Ex: https://www.rts.ch/play/tv/redirect/detail/9938530
* Ex: http://www.srf.ch/play/tv/redirect/Detail/99f040e9-b1e6-4d7a-bc08-d5639d600aa1
* Ex: https://www.srf.ch/play/tv/redirect/Detail/99f040e9-b1e6-4d7a-bc08-d5639d600aa1
*/
switch (true) {
case pathname.includes("/tv/redirect/detail/"):
Expand Down Expand Up @@ -523,11 +523,14 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
}

/**
* Catch new by date TV urls
* Catch new by date TV urls and TV program urls
*
* Ex: https://www.rts.ch/play/tv/emissions-par-dates/2021-06-21
* Ex: https://www.srf.ch/play/tv/programm/2021-07-03
*/
if (pathname.includes("/tv/sendungen-nach-datum/") || pathname.includes("/tv/emissions-par-dates/") || pathname.includes("/tv/programmi-per-data/") || pathname.includes("/tv/emissiuns-tenor-data/")) {
if (pathname.includes("/tv/sendungen-nach-datum/") || pathname.includes("/tv/emissions-par-dates/") || pathname.includes("/tv/programmi-per-data/") || pathname.includes("/tv/emissiuns-tenor-data/") ||
pathname.endsWith("/tv/programm") || pathname.includes("/tv/programme") || pathname.includes("/tv/program") ||
pathname.includes("/tv/programm/") || pathname.includes("/tv/programme/") || pathname.includes("/tv/program/")) {
var lastPathComponent = pathname.split("/").slice(-1)[0];

var date = null;
Expand Down Expand Up @@ -681,8 +684,11 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
* Ex: https://www.srf.ch/play/tv/hilfe
* Ex: https://www.srf.ch/play/tv/hilfe/geoblock
* Ex: https://www.rts.ch/play/tv/aide
* Ex: https://www.rts.ch/play/tv/aide/geoblocke
* Ex: https://www.rsi.ch/play/tv/guida
* Ex: https://www.rsi.ch/play/tv/guida/geobloccato
* Ex: https://www.rtr.ch/play/tv/agid
* Ex: https://www.rtr.ch/play/tv/agid/geo-blocking
* Ex: https://play.swissinfo.ch/play/tv/help
*/
if (pathname.endsWith("/hilfe") || pathname.includes("/hilfe/") || pathname.endsWith("/aide") || pathname.includes("/aide/") || pathname.endsWith("/guida") || pathname.includes("/guida/") || pathname.endsWith("/agid") || pathname.includes("/agid/") || pathname.endsWith("/help") || pathname.includes("/help/")) {
Expand Down

0 comments on commit f4326a8

Please sign in to comment.