SlicK Posted March 30, 2007 Report Posted March 30, 2007 Primeste un playlist de winamp care sa contina mp3'uri(cu altceva nu am incercat)Testat cu Active Perl 5.8.7.815 si Winamp 2.95 dar probabil merge cu orice perl si orice winampTrebuiesc setate "$PORT","$LIST" si "$NAME"Versiune formatata: http://rootb0x.com/0X0/rad-0.1.txt#!/usr/bin/perluse IO::Socket;$SIG{CHLD}=sub {wait ()};$PORT=8000;$LIST="playlist.m3u";$NAME="<<My tiny online radio station>>";open(PLAYLIST,$LIST) || die("Error: Could not open $LIST\r\n"); @songs=<PLAYLIST>; close PLAYLIST;$server=IO::Socket::INET->new(Proto =>'tcp', LocalPort=>$PORT, Listen =>SOMAXCONN, Reuse =>1);if($server){ while(1) { while($client=$server->accept()) { $client->autoflush(1); if(!fork()) { foreach $song (@songs) { chomp($song); if(index($song,'#')==-1) { print("playing song: $song\n"); print $client "ICY 200 OK\r\n"; print $client "Content-Type: audio/x-mp3stream\r\n"; print $client "Cache-Control: no-cache\r\n"; print $client "Pragma: no-cache\r\n"; print $client "Connection: close\r\n"; print $client "icy-name: $NAME\r\n"; print $client "icy-metadata: 0\r\n\r\n"; open (SONG,"$song"); binmode(SONG); $read_status =1; $print_status=1; $chunk; while($read_status && $print_status) { $read_status=read(SONG,$chunk,1024); if(defined $chunk && defined $read_status) { $print_status=print $client $chunk; } undef $chunk; } close SONG; } } exit(0); } close($client); } }}Am uitat... Winamp->ADD->ADD URL->"IP:PORT" Quote
DjSystem Posted November 24, 2018 Report Posted November 24, 2018 Si ip care va fi?banuiesc cel de la root nu? Cat si playlist-ul cu mp3-uri trebuie facut tot in root nu? Scuze de intrebari dar ca sa inteleg mai exact cum functioneaza.... Mersi. Quote