• Publicidad

Radio X 0.2

¿Estás desarrollando un proyecto, o piensas hacerlo? Pon aquí tu propuesta, lo más seguro es que alguien esté interesado en ayudarte.

Radio X 0.2

Notapor BigBear » 2012-10-14 19:55 @871

Estaba harto de escuchar siempre la misma canción así que mejoré este script para poder escuchar música con los siguientes géneros.

Sintáxis: [ Descargar ] [ Ocultar ]
Using text Syntax Highlighting
[+] Rock'n'Roll
[+] Pop
[+] Ambient
[+] Trance
[+] House
[+] Y otros mas .......
Coloreado en 0.000 segundos, usando GeSHi 1.0.8.4



Aclaro que necesitan bajar el mplayer. Esta el enlace de descarga en el script; una vez que lo tengan descargado y descomprimido creen una carpeta llamada "mplayer" y copian todos los archivos del archivo descomprimido en la carpeta recién creada. Todo esto tiene que ser en el mismo directorio donde esté el script.

El código es el siguiente:
Sintáxis: [ Descargar ] [ Ocultar ]
Using perl Syntax Highlighting
  1. #!usr/bin/perl
  2. #Radio X
  3. #Version 0.2
  4. #Coded By Doddy H
  5. #
  6. #Download : http://www.mplayerhq.hu/MPlayer/releases/win32/MPlayer-mingw32-1.0rc2.zip
  7. #
  8.  
  9. use Cwd;
  10.  
  11. my @emisoras = (
  12.  
  13.     {},
  14.  
  15.     {
  16.  
  17.         "nombre" => "Absolute Classic Rock (Broadband)",
  18.         "genero" => "Rock'n'Roll",
  19.         "link"   => "http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=vcbb"
  20.  
  21.     },
  22.  
  23.     {
  24.  
  25.         "nombre" => "Absolute Classic Rock (Modem)",
  26.         "genero" => "Rock'n'Roll",
  27.         "link"   => "http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=vc"
  28.  
  29.     },
  30.  
  31.     {
  32.  
  33.         "nombre" => "Absolute Radio (Broadband)",
  34.         "genero" => "Pop",
  35.         "link"   => "http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=vrbb"
  36.  
  37.     },
  38.  
  39.     {
  40.  
  41.         "nombre" => "Absolute Radio (Modem)",
  42.         "genero" => "Pop",
  43.         "link"   => "http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=vr"
  44.  
  45.     },
  46.  
  47.     {
  48.  
  49.         "nombre" => "Absolute Xtreme (Broadband)",
  50.         "genero" => "Modern Rock",
  51.         "link"   => "http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=vxbb"
  52.  
  53.     },
  54.  
  55.     {
  56.  
  57.         "nombre" => "Absolute Xtreme (Modem)",
  58.         "genero" => "Modern Rock",
  59.         "link"   => "http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=vx"
  60.  
  61.     },
  62.  
  63.     {
  64.  
  65.         "nombre" => "HBR1.com - Dream Factory",
  66.         "genero" => "Ambient",
  67.         "link"   => "http://ubuntu.hbr1.com:19800/ambient.ogg"
  68.  
  69.     },
  70.  
  71.     {
  72.  
  73.         "nombre" => "HBR1.com - I.D.M. Tranceponder",
  74.         "genero" => "Trance",
  75.         "link"   => "http://ubuntu.hbr1.com:19800/trance.ogg"
  76.  
  77.     },
  78.  
  79.     {
  80.  
  81.         "nombre" => "HBR1.com - Tronic Lounge",
  82.         "genero" => "House",
  83.         "link"   => "http://ubuntu.hbr1.com:19800/tronic.ogg"
  84.  
  85.     },
  86.  
  87.     {
  88.  
  89.         "nombre" => "NRK Alltid Klassisk (Norway)",
  90.         "genero" => "Desconocido",
  91.         "link"   => "http://media.hiof.no/streams/m3u/nrk-alltid-klassisk-172.ogg.m3u"
  92.  
  93.     },
  94.  
  95.     {
  96.  
  97.         "nombre" => "NRK Alltid Nyheter (Norway)",
  98.         "genero" => "Desconocido",
  99.         "link"   => "http://media.hiof.no/streams/m3u/nrk-alltid-nyheter-172.ogg.m3u"
  100.  
  101.     },
  102.  
  103.     {
  104.  
  105.         "nombre" => "NRK mP3 (Norway)",
  106.         "genero" => "Desconocido",
  107.         "link"   => "http://media.hiof.no/streams/m3u/nrk-mpetre-172.ogg.m3u"
  108.  
  109.     },
  110.  
  111.     {
  112.  
  113.         "nombre" => "NRK P1 (Norway)",
  114.         "genero" => "General",
  115.         "link"   => "http://media.hiof.no/streams/m3u/nrk-p1-172.ogg.m3u",
  116.  
  117.     },
  118.  
  119.     {
  120.  
  121.         "nombre" => "NRK P2 (Norway)",
  122.         "genero" => "General",
  123.         "link"   => "http://media.hiof.no/streams/m3u/nrk-p2-172.ogg.m3u"
  124.  
  125.     },
  126.  
  127.     {
  128.  
  129.         "nombre" => "NRK P3 (Norway)",
  130.         "genero" => "General",
  131.         "link"   => "http://media.hiof.no/streams/m3u/nrk-petre-172.ogg.m3u"
  132.  
  133.     },
  134.  
  135.     {
  136.  
  137.         "nombre" => "WKNC 88.1 FM (NC State) (High Quality)",
  138.         "genero" => "Music",
  139.         "link"   => "http://wknc.sma.ncsu.edu:8000/wknchq.ogg.m3u"
  140.  
  141.     },
  142.  
  143.     {
  144.  
  145.         "nombre" => "WKNC 88.1 FM (NC State) (Low Quality)",
  146.         "genero" => "Music",
  147.         "link"   => "http://wknc.sma.ncsu.edu:8000/wkncmq.ogg.m3u"
  148.  
  149.     }
  150.  
  151. );
  152.  
  153. $SIG{INT} = \&retorno;
  154.  
  155. chdir( getcwd() . "/mplayer/" );
  156.  
  157. menu();
  158.  
  159. sub retorno {
  160.     print "\n\n[+] Press any key for return to the menu\n\n";
  161.     <stdin>;
  162.     menu();
  163. }
  164.  
  165. sub menu {
  166.  
  167.     head();
  168.  
  169.     for my $em ( 1 .. @emisoras - 1 ) {
  170.  
  171.         print "\n[+] Number : " . $em . "\n";
  172.         print "[+] Name : " . $emisoras[$em]->{nombre} . "\n";
  173.         print "[+] Station : " . $emisoras[$em]->{genero} . "\n";
  174.  
  175.     }
  176.  
  177.     print "\n\n[+] Option : ";
  178.     chomp( my $op = <stdin> );
  179.  
  180.     if ( $op =~ /\d+/ ) {
  181.         system("mplayer $emisoras[$op]->{link}");
  182.     }
  183.  
  184.     copyright();
  185.  
  186. }
  187.  
  188. sub head {
  189.  
  190.     clean();
  191.  
  192.     print qq(
  193.  
  194.  
  195.  @@@@@     @    @@@@    @   @@@@     @     @
  196.  @    @    @    @   @   @  @    @    @     @
  197.  @    @   @ @   @    @  @  @    @     @   @
  198.  @    @   @ @   @    @  @  @    @      @ @  
  199.  @@@@@   @   @  @    @  @  @    @       @  
  200.  @    @  @   @  @    @  @  @    @      @ @  
  201.  @    @  @@@@@  @    @  @  @    @     @   @
  202.  @    @ @     @ @   @   @  @    @    @     @
  203.  @    @ @     @ @@@@    @   @@@@     @     @
  204.  
  205.  
  206.  
  207. );
  208.  
  209. }
  210.  
  211. sub copyright {
  212.     print "\n\n-- == (C) Doddy Hackman 2012 == --\n\n";
  213.     <stdin>;
  214.     exit(1);
  215. }
  216.  
  217. sub clean {
  218.     my $os = $^O;
  219.     if ( $os =~ /Win32/ig ) {
  220.         system("cls");
  221.     }
  222.     else {
  223.         system("clear");
  224.     }
  225. }
  226.  
  227. #The End ?
Coloreado en 0.005 segundos, usando GeSHi 1.0.8.4


Ejemplo de uso

Código: Seleccionar todo



 @@@@@     @    @@@@    @   @@@@     @     @
 @    @    @    @   @   @  @    @    @     @
 @    @   @ @   @    @  @  @    @     @   @
 @    @   @ @   @    @  @  @    @      @ @
 @@@@@   @   @  @    @  @  @    @       @
 @    @  @   @  @    @  @  @    @      @ @
 @    @  @@@@@  @    @  @  @    @     @   @
 @    @ @     @ @   @   @  @    @    @     @
 @    @ @     @ @@@@    @   @@@@     @     @




[+] Number : 1
[+] Name : Absolute Classic Rock (Broadband)
[+] Station : Rock'n'Roll

[+] Number : 2
[+] Name : Absolute Classic Rock (Modem)
[+] Station : Rock'n'Roll

[+] Number : 3
[+] Name : Absolute Radio (Broadband)
[+] Station : Pop

[+] Number : 4
[+] Name : Absolute Radio (Modem)
[+] Station : Pop

[+] Number : 5
[+] Name : Absolute Xtreme (Broadband)
[+] Station : Modern Rock

[+] Number : 6
[+] Name : Absolute Xtreme (Modem)
[+] Station : Modern Rock

[+] Number : 7
[+] Name : HBR1.com - Dream Factory
[+] Station : Ambient

[+] Number : 8
[+] Name : HBR1.com - I.D.M. Tranceponder
[+] Station : Trance

[+] Number : 9
[+] Name : HBR1.com - Tronic Lounge
[+] Station : House

[+] Number : 10
[+] Name : NRK Alltid Klassisk (Norway)
[+] Station : Desconocido

[+] Number : 11
[+] Name : NRK Alltid Nyheter (Norway)
[+] Station : Desconocido

[+] Number : 12
[+] Name : NRK mP3 (Norway)
[+] Station : Desconocido

[+] Number : 13
[+] Name : NRK P1 (Norway)
[+] Station : General

[+] Number : 14
[+] Name : NRK P2 (Norway)
[+] Station : General

[+] Number : 15
[+] Name : NRK P3 (Norway)
[+] Station : General

[+] Number : 16
[+] Name : WKNC 88.1 FM (NC State) (High Quality)
[+] Station : Music

[+] Number : 17
[+] Name : WKNC 88.1 FM (NC State) (Low Quality)
[+] Station : Music


[+] Option : 7
MPlayer 1.0rc2-4.2.1 (C) 2000-2007 MPlayer Team
CPU: AMD Sempron(tm) 140 Processor (Family: 16, Model: 6, Stepping: 2)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.

Playing http://ubuntu.hbr1.com:19800/ambient.ogg.
Resolving ubuntu.hbr1.com for AF_INET...
Connecting to server ubuntu.hbr1.com[93.94.83.51]: 19800...
Cache size set to 320 KBytes
Cache fill: 15.00% (49152 bytes)
[Ogg] stream 0: audio (Vorbis), -aid 0
Ogg file format detected.
Clip info:
 Artist: A.C.E. (chillgressive tunes)
 Name: Acid Chill Experience (DJ-Set, exclusive 4 hbr1.com)
 Album: hbr1.com
 Genre: Ambient
 Track: 1
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
Ogg : bad packet in stream 0
AUDIO: 44100 Hz, 2 ch, s16le, 64.0 kbit/4.54% (ratio: 8000->176400)
Selected audio codec: [ffvorbis] afm: ffmpeg (FFmpeg Vorbis decoder)
==========================================================================
AO: [dsound] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
BigBear
Perlero frecuente
Perlero frecuente
 
Mensajes: 981
Registrado: 2009-03-01 18:39 @818

Publicidad

Volver a Proyectos

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 2 invitados

cron