Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Results 1 to 11 of 11
  1. #1
    Join Date
    October 2010
    Location
    Warsaw / Poland
    Posts
    296

    Lightbulb [Script] [ServerQuery] Modify All Codecs

    Hello, I'm interested in a script or serverquery command to modify channel codec to opus voice + codec quality to 10 on all channels.

    Thank you.

  2. #2
    Join Date
    June 2012
    Location
    Portugal
    Posts
    317
    PHP Code:
    <?php
    require 'TeamSpeak3/TeamSpeak3.php';

    $user 'serveradmin';
    $password 'password';
    $ip_query '1.2.3.4:10011';
    $port 9987;

    $ts3 TeamSpeak3::factory("serverquery://$user:$password@$ip_query/?server_port=$port");

    foreach(
    $ts3->channelList() as $channel) {
        
    $properties = array();

        if(
    $channel['channel_codec'] != 4$properties['channel_codec'] = 4;

        if(
    $channel['channel_codec_quality'] != 10$properties['channel_codec_quality'] = 10;

        if(!empty(
    $properties)) {
            
    $properties['cid'] = $channel['cid'];
            
    $ts3->execute('channeledit'$properties);
        } 
    }
    Save as somename.php and execute by requesting on a webserver that you upload the script into or if you have php installed: php somename.php

    You need this: http://forum.teamspeak.com/showthrea...-PHP-Framework
    (Unzip the content inside libraries folder to the folder where you placed the script.
    So that it is the somename.php script and TeamSpeak3 folder in the same place)
    Last edited by barricas; March 6th, 2013 at 03:34 AM.

  3. #3
    Join Date
    October 2010
    Location
    Warsaw / Poland
    Posts
    296
    Hey.

    Thanks! Working as intended, however you forgot closing php tag .

    Code:
    <?php require 'TeamSpeak3/TeamSpeak3.php'; 
    
    
    $user = 'serveradmin'; 
    $password = 'password'; 
    $ip_query = '1.2.3.4:10011'; 
    $port = 9987; 
    
    
    $ts3 = TeamSpeak3::factory("serverquery://$user:[email protected]$ip_query/?server_port=$port"); 
    
    
    foreach($ts3->channelList() as $channel) { 
        $properties = array(); 
    
    
        if($channel['channel_codec'] != 4) $properties['channel_codec'] = 4; 
    
    
        if($channel['channel_codec_quality'] != 10) $properties['channel_codec_quality'] = 10; 
    
    
        if(!empty($properties)) { 
            $properties['cid'] = $channel['cid']; 
            $ts3->execute('channeledit', $properties); 
        }  
    }
    ?>
    But that isn't a problem, I really appreciate your work barricas, thank You once again.

  4. #4
    Join Date
    June 2012
    Location
    Portugal
    Posts
    317
    No problem!
    Php closing tag is not required unless you have, for example, pure html after that.

  5. #5
    Join Date
    March 2013
    Posts
    3

    Is it possible to change all channels codex at once?

    I run a server with 100+ channels. Is it possible to update them all at once, or do I have to do it manually?

  6. #6
    Join Date
    June 2012
    Location
    Portugal
    Posts
    317
    See this: http://forum.teamspeak.com/showthrea...ify-All-Codecs

    it changes all channels to Opus Voice w/ 10 quality.

  7. #7
    Join Date
    December 2010
    Location
    United Kingdom
    Posts
    340
    Hello !

    I tested that script it worked excellent, all my channels was edited perfect solution what i looking for.

  8. #8
    Join Date
    September 2016
    Posts
    4

    nice script

    I apologize for such a late reply to this topic.

    The script is geamcht really cool. Also works one way frein.

    but I have one more please.
    Can one moreover scripten he channel with "opus Music" to ignore.

    I was grateful for it.

  9. #9
    Join Date
    April 2015
    Posts
    155
    Hey,

    can you upload a script so just new channels get opus music 10 ?

  10. #10
    Join Date
    November 2016
    Posts
    2
    I've created simple Python script to do modify codec and quality of all channels on the server. If interested: ts3-mass-codec-changer.py

    I know the thread is 3 years old, but maybe someone will find it(as I did).

  11. #11
    Join Date
    June 2011
    Location
    Germany
    Posts
    4,368
    Quote Originally Posted by florian2833z View Post
    Hey,

    can you upload a script so just new channels get opus music 10 ?
    Can't be done with a script, must be done with a bot.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Not possible] Increasing group modify and client permission modify above 75
    By Warith in forum Permission System
    Replies: 1
    Last Post: September 20th, 2015, 03:44 PM
  2. [Resolved] Modify Channel Name ignores Modify Power?
    By Biblo in forum Permission System
    Replies: 4
    Last Post: April 4th, 2015, 11:45 PM
  3. Replies: 1
    Last Post: January 24th, 2014, 02:46 PM
  4. Replies: 7
    Last Post: August 23rd, 2013, 09:06 PM
  5. Replies: 4
    Last Post: April 3rd, 2012, 07:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •