From cd49920077cb7d259fe56c5346e5d6486dec060a Mon Sep 17 00:00:00 2001 From: tastytea Date: Sat, 22 Jun 2019 04:36:43 +0200 Subject: [PATCH] ard_download_button: Fixed 960x544 format. --- video/ard_download_button.user.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/video/ard_download_button.user.js b/video/ard_download_button.user.js index ae86a9e..637bb91 100644 --- a/video/ard_download_button.user.js +++ b/video/ard_download_button.user.js @@ -2,7 +2,7 @@ // @name ARD download button // @description Adds a download-button for every video on ardmediathek.de. // @description:de Fügt einen download-button für jedes video auf ardmediathek.de hinzu. -// @version 2019.06.22.5 +// @version 2019.06.22.6 // @author tastytea // @copyright 2019, tastytea (https://tastytea.de/) // @license GPL-3.0-only @@ -46,7 +46,7 @@ function get_url() // Extract URL from HTML. const re_mp4 = new RegExp( // ARD '"(https://pdvideosdaserste-a\.akamaihd\.net/[^"]+/320-[^"]+\.mp4)"'); const re_516 = new RegExp( // ARD, 960x544 (WTF?) - '"(https://pdvideosdaserste-a\.akamaihd.net/[^"]+format516040.mp4)"'); + '"(https://pdvideosdaserste-a\.akamaihd.net/[^"]+format[0-9]+\.mp4)"', 'g'); const re_m3u = new RegExp( // MDR '"(https://[^,"]+\.akamaihd\.net/[^,"]+master\.m3u8)"'); @@ -56,10 +56,11 @@ function get_url() // Extract URL from HTML. return result[1].replace("/320-", "/1280-"); } - result = re_516.exec(html); + result = html.match(re_516); if (result !== null) { - return result[1]; + console.log(result); + return result[result.length - 1].replace(/"/g, ""); } result = re_m3u.exec(html);