I did some modification to give arrays . Yes it was limited
see message sent to IONOS this morning
Dear Ionis Support,
I like many of your customers using IONOS products which had a server on IFast have had a control panel update which limited the unlimited bandwidth of the web site : epiz_33087480
Website for deniserose.epizy.com
Your account is Temporarily Suspended
Your account was suspended because you hit the I/O Limits. Learn more about this limit.
Your account will be reactivated automatically in 10 hours from now.
Don’t want to wait any longer? iFastNet can migrate your website quickly and for free, even if your account is suspended!
etc
@Oxy @Greenreader9 I am writing a restream to obtain all id3 from my stream . I think @Edwin has left the forum and website probably fed up idk
$url = "http://".$server.":".$port."/".$mount;
class MetadataBlock {
private $expected_length, $content;
public $ID3 = array(
"ID3" => array(BinaryFileReader::FIXED, 3),
"Version" => array(BinaryFileReader::FIXED, 2),
"Flag" => array(BinaryFileReader::FIXED, 1),
"SizeTag" => array(BinaryFileReader::FIXED, 4, BinaryFileReader::INT)
);
public $MIME = array(
"TextEncoding" => array(BinaryFileReader::FIXED, 1),
"MimeType" => array(BinaryFileReader::NULL_TERMINATED),
"FileName" => array(BinaryFileReader::NULL_TERMINATED),
"ContentDesc" => array(BinaryFileReader::NULL_TERMINATED),
"BinaryData" => array(BinaryFileReader::EOF_TERMINATED)
);
public $APIC = array(
"FrameID" => array(BinaryFileReader::FIXED, 4),
"Size" => array(BinaryFileReader::FIXED, 4, BinaryFileReader::INT),
"Flag" => array(BinaryFileReader::FIXED, 2),
"Body" => array(BinaryFileReader::SIZE_OF, "Size"),
);
/**
* Creates a new empty MetadataBlock with the given $expected_length.
* The actual content can be added using the write() method.
*/
public function __construct($expected_length) {
$this->content = '';
$this->expected_length = $expected_length;
}
public function expected_length() {
return $this->expected_length;
}
public function write($buffer) {
$this->content .= $buffer;
}
public function content() {
return $this->content;
}
public function length() {
return strlen($this->content);
}
/**
* Determines if the metadata block is complete. A metadata block is completed
* when its content has at least $expected_length bytes of data.
* https://learn.microsoft.com/en-us/windows/win32/wmformat/id3-tag-support
*/
public function is_complete() {
return $this->remaining_length() == 0;
}
public function remaining_length() {
return $this->expected_length - $this->length();
}
public function stream_title() {
if (!$this->is_complete())
throw new \Exception("The Title is not complete yet");
$start = strlen("TIT1"); // title
$end = strpos($this->content, "TIT1", $start);
return substr($this->content, $start, $end-$start);
}public function stream_author() {
if (!$this->is_complete())
throw new \Exception("The Authur is not complete yet");
$start = strlen("TPE2"); //Author
$end = strpos($this->content, "TPE2", $start);
return substr($this->content, $start, $end-$start);
}
public function stream_album() {
if (!$this->is_complete())
throw new \Exception("The Album is not complete yet");
$start = strlen("TALB"); // The structure of the TALB (Album) text frame
$end = strpos($this->content, "TALB", $start);
return substr($this->content, $start, $end-$start);
}
public function stream_genre() {
if (!$this->is_complete())
throw new \Exception("The Genre is not complete yet");
$start = strlen("TCON"); // Genre
$end = strpos($this->content, "TCON", $start);
return substr($this->content, $start, $end-$start);
}
public function stream_comment() {
if (!$this->is_complete())
throw new \Exception("The comment is not complete yet");
$start = strlen("TCOM"); // Comment
$end = strpos($this->content, "TCOM", $start);
return substr($this->content, $start, $end-$start);
}
public function stream_year() {
if (!$this->is_complete())
throw new \Exception("The comment is not complete yet");
$start = strlen("TYER"); // Year
$end = strpos($this->content, "TYER", $start);
return substr($this->content, $start, $end-$start);
}
public function stream_duration() {
if (!$this->is_complete())
throw new \Exception("The duration is not complete yet");
$start = strlen("TLEN"); // Duration
$end = strpos($this->content, "TLEN", $start);
return substr($this->content, $start, $end-$start);
}
public function stream_bpm() {
if (!$this->is_complete())
throw new \Exception("The bpm is not complete yet");
$start = strlen("TBPM"); // Beats per Minute.
$end = strpos($this->content, "TBPM", $start);
return substr($this->content, $start, $end-$start);
}
public function stream_listeners() {
if (!$this->is_complete())
throw new \Exception("The listeners is not complete yet");
$start = strlen("LISTENERS=");
$end = strpos($this->content, ";", $start);
return substr($this->content, $start, $end-$start);
}
public function stream_song_cover() {
$start = strlen("APIC");
$end = strpos($this->content, "APIC", $start);
return substr($this->content, $start, $end-$start);
}
public function stream_lyrics() {
$start = strlen("USLT");
$end = strpos($this->content, ";", $start);
return substr($this->content, $start, $end-$start);
}
}
// Begin SHOUTcast Principle control
class stream {
private $metadata, $next_metadata_position, $icy_metaint, $mp3, $stream_bytes_count = 0;
private $length,$duration;
private $expected_length, $content;
private $options, $default_options = array(
'path' => '.',
'split_tracks' => false,
'max_track_duration' => 3600, #sec (1 h)
'max_track_length' => 102400000 #bytes (100 mb)
);
public $title;
public function __construct($options=array()) {
$this->options = array_merge($this->default_options, $options);
}
public function start($url) {
$http_streaming = new HttpStreaming($url);
$http_streaming->open();
$response_message = $http_streaming->response_message();
var_dump($response_message);
$this->icy_metaint = $response_message->icy_metaint();
$this->next_metadata_position = $this->icy_metaint;
$lyrics = MetadataBlock->stream_lyrics(); // bytes of lyrics.
$byteStream = MetadataBlock->stream_song_cover(); //bytes of image.
$album = base64_encode($byteStream);
$title = MetadataBlock->stream_title();
$author = MetadataBlock->stream_author();
$album = MetadataBlock->stream_album();
$genre = MetadataBlock->stream_genre();
$duration = MetadataBlock->stream_duration();
$year = MetadataBlock->stream_year();
$comment = MetadataBlock->stream_comment();
$bpm = MetadataBlock->stream_bpm();
$listeners = MetadataBlock->stream_listeners();
while ($buffer = $http_streaming->read_stream()) {
$this->length += strlen($buffer);
if (!$this->process_received_buffer($buffer) || $this->are_limits_reached()) break;
}
}
private function are_limits_reached(){
//return false;
return $this->length >= $this->options['max_track_duration'];
}
private function process_received_buffer($buffer) {
$buffer_len = strlen($buffer);
$this->stream_bytes_count += $buffer_len;
var_dump( $buffer);
return TRUE;
}
}
?>