youtube-videos-with-duration - randomcrap - random crap programs of varying quality
(HTM) git clone git://git.codemadness.org/randomcrap
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
youtube-videos-with-duration (453B)
---
1 #!/bin/sh
2 # Dependencies: frontends/youtube/feed
3
4 # youtube_with_duration(url)
5 youtube_with_duration() {
6 url="$1"
7
8 channelid=""
9 case "$url" in
10 *channel_id=*)
11 # strip channel_id from URL.
12 channelid="${url##*?channel_id=}";;
13 esac
14
15 # no channel ID found, process normally.
16 if test "$channelid" = ""; then
17 sfeed
18 return
19 fi
20
21 youtube_feed "$channelid"
22 }
23
24 youtube_with_duration_test() {
25 url="$1"
26 hurl "$url" | youtube_with_duration "$url"
27 }