ard_download_button: Fixed 960x544 format.

This commit is contained in:
tastytea 2019-06-22 04:36:43 +02:00
parent 2e1e6d8416
commit cd49920077
Signed by untrusted user: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 5 additions and 4 deletions

View File

@ -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);