Advertisement
Guest User

artedl

a guest
Mar 11th, 2015
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.72 KB | None | 0 0
  1. #!/bin/bash
  2. set -u
  3.  
  4. url="${1:?need mediathek url}";
  5.  
  6. echo "url = '${url}'" >&2
  7.  
  8. title="$(sed -nr 's#^.*www.arte.tv/guide/de/.*/([^/]*)$#\1#p' <<<"$url")";
  9. echo "title = '${title}'" >&2
  10.  
  11. documentId="$(sed -nr 's#^.*www.arte.tv/guide/de/([^/]*).*#\1#p' <<<"$url")";
  12. echo "documentId = '${documentId}'" >&2
  13.  
  14. jsonUrl="http://arte.tv/papi/tvguide/videos/stream/player/D/${documentId}_PLUS7-D/ALL/ALL.json";
  15. echo "jsonUrl = '${jsonUrl}'" >&2
  16.  
  17. movieUrl="$(curl "${jsonUrl}" | grep -Eo '\{[^{}]*}' | grep -E 'HD.*720p.*"videoFormat":"RMP4".*"versionShortLibelle":"DE"' | sed -rn 's/.*"streamer":"([^"]*)"[^}]*"url":"([^"]*)".*/\1\2/p')";
  18. echo "movieUrl = '${movieUrl}'" >&2
  19.  
  20. rtmpdump -e -o "${title}.mp4" -r "${movieUrl}";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement