Menu

Suggestions for making batch-downloading easier

uvett
2013-03-13
2013-03-13
  • uvett

    uvett - 2013-03-13

    It is nice to see that the script makes batch jobs easier, but it should be possible to make this even better. It not difficult to get a list of all currently available episodes of a series on tv.nrk.no, but one has to take (at least) two different approaches. I use this script in order to extract episode urls from the current season:

    Usage: skript.sh "url"

    korturl=$(echo "$url"|awk -F / '{print $1,$2,$3,$4}'|sed 's_ _/_g')
    navn=$(echo "$url"|awk -F / '{print $5}')
    lynx -dump "$url"|sed 's# .* ##g'|sed '/#tab-list|#monthTable|#tablist-sub|#information|#parentalControlBox|#sfMain|#recommended-list|#oldEpisodes|#lastEpisodes|#participants|#t=[0-9]/d'|grep ^"$korturl"|grep "$navn"|sort -u|tail -n +2

    (This script does not distinguish between dead and working links).

    Episode urls from previous seasons can be obtained by using the meta tags called "seriesid" and "seasonid". You take those and reassemble them to a url with this pattern:

    /program/Episodes/$seriesid/$seasonid

    E.g., Supernytt from 2012:

    http://tv.nrk.no/program/Episodes/supernytt/21902

    ... with this done, lynx -dump and some grep does the rest.

     
    • Falkeklubben

      Falkeklubben - 2013-03-13

      Nice. Especially liked the trick to get the episodes for a season. Didn't know that one. This is definitely something I'd like to do.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.