This file is indexed.

/usr/bin/dradio-config is in dradio 3.8-2.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/bin/sh
#############################################################################
## DRadio - a Danmarks Radio netradio player.
##
## Copyright (C) 2009  Jess Thrysoee
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program.  If not, see <http://www.gnu.org/licenses/>.
##
#############################################################################

if test -n "$1" -a "$1" != "--rss"
then
   echo "`basename $0`: invalid option '$1'"
   echo "Usage: `basename $0` [--rss]"
   exit 1
fi

# assert progs are available
type curl > /dev/null || { echo "`basename $0` require curl, but it's not installed.  Aborting." >&2; exit 1; }
type tidy > /dev/null || { echo "`basename $0` require tidy, but it's not installed.  Aborting." >&2; exit 1; }
type xsltproc > /dev/null || { echo "`basename $0` require xsltproc, but it's not installed.  Aborting." >&2; exit 1; }

TMP_XSL=/tmp/dradio.xsl
trap 'rm $TMP_XSL' 0


##################
## rss (podcasts)
##
if test "$1" = "--rss"
then

   #DIRECT_URL=http://www.dr.dk/netradio/wmp.asp

   #DIRECT_URL=http://www.dr.dk/Podcast/A-G
   #DIRECT_URL=http://www.dr.dk/Podcast/H-N
   #DIRECT_URL=http://www.dr.dk/Podcast/O-AA
   #DIRECT_URL=http://www.dr.dk/podcast/Video
   #DIRECT_URL=http://www.dr.dk/podcast/Udvalgte_serier
   DIRECT_URL=http://www.dr.dk/podcast/Emner

   HEADTAG=h1

   cat > $TMP_XSL <<EOF
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:x="http://www.w3.org/1999/xhtml" version="1.0">
   <xsl:output method="xml" encoding="ISO-8859-1" indent="yes"/>
   <xsl:template match="/">
      <xsl:element name="menu">
         <xsl:apply-templates select="//x:div[@class='relContent' and descendant::x:a[@title='XML']]"/>
      </xsl:element>
   </xsl:template>
   <xsl:template match="x:div[@class='relContent' and descendant::x:a[@title='XML']]">
      <xsl:element name="item">
         <xsl:attribute name="label">
            <xsl:value-of select="../x:div[@class='txtContent']/x:${HEADTAG}/x:a"/>
         </xsl:attribute>
         <xsl:attribute name="src">
            <xsl:value-of select="descendant::x:a[@title='XML']/@href"/>
         </xsl:attribute>
         <xsl:attribute name="type">rss</xsl:attribute>
      </xsl:element>
   </xsl:template>
</xsl:stylesheet>
EOF


   curl -s $DIRECT_URL | tidy -q -wrap 0 -utf8 -asxml 2>/dev/null |
   sed -e 's#</*nobr>##g' -e 's/&nbsp;/ /g' | xsltproc $TMP_XSL - 

else
##################
## stream
##

   DIRECT_URL=http://www.dr.dk/netradio/wmp.asp

   cat > $TMP_XSL <<EOF
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:x="http://www.w3.org/1999/xhtml" version="1.0">
   <xsl:output method="xml" encoding="ISO-8859-1" indent="yes"/>
   <xsl:template match="/">
      <xsl:element name="menu">
         <xsl:apply-templates select="//x:table/x:tr"/>
         <item label='DR1 TV' src='mms://video.dr.dk/dr1' type='direct' />
         <item label='DR2 TV' src='mms://video.dr.dk/dr2' type='direct' />
         <item label='DR Update' src='mms://video.dr.dk/DRUpdate' type='direct' />
      </xsl:element>
   </xsl:template>
   <xsl:template match="x:table/x:tr">
      <xsl:apply-templates select="x:td[2]/x:a[3]"/>
   </xsl:template>
   <xsl:template match="x:td[2]/x:a[3]">
      <xsl:element name="item">
         <xsl:attribute name="label">
            <xsl:value-of select="../../x:td[1]"/>
         </xsl:attribute>
         <xsl:attribute name="src">
            <xsl:value-of select="@href"/>
         </xsl:attribute>
         <xsl:attribute name="type">playlist</xsl:attribute>
      </xsl:element>
   </xsl:template>
</xsl:stylesheet>
EOF

   curl -s $DIRECT_URL | tidy -q -latin1 -asxml 2> /dev/null | xsltproc $TMP_XSL - 2>/dev/null
fi