Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- set -u
- url="${1:?need mediathek url}";
- echo "url = '${url}'" >&2
- title="$(sed -nr 's#^.*www.arte.tv/guide/de/.*/([^/]*)$#\1#p' <<<"$url")";
- echo "title = '${title}'" >&2
- documentId="$(sed -nr 's#^.*www.arte.tv/guide/de/([^/]*).*#\1#p' <<<"$url")";
- echo "documentId = '${documentId}'" >&2
- jsonUrl="http://arte.tv/papi/tvguide/videos/stream/player/D/${documentId}_PLUS7-D/ALL/ALL.json";
- echo "jsonUrl = '${jsonUrl}'" >&2
- movieUrl="$(curl "${jsonUrl}" | grep -Eo '\{[^{}]*}' | grep -E 'HD.*720p.*"videoFormat":"RMP4".*"versionShortLibelle":"DE"' | sed -rn 's/.*"streamer":"([^"]*)"[^}]*"url":"([^"]*)".*/\1\2/p')";
- echo "movieUrl = '${movieUrl}'" >&2
- rtmpdump -e -o "${title}.mp4" -r "${movieUrl}";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement