Mastering XUI Panel Commands: Guide for IPTV Providers
As an IPTV Provider, you understand the importance of having a reliable and efficient IPTV panel to manage your business. XUI Panel, also known as XUI ONE, is a powerful and user-friendly IPTV panel that has gained popularity among IPTV providers worldwide. One of the key features that make XUI Panel stand out is its comprehensive set of commands that can help you streamline your IPTV operations and enhance the viewing experience for your customers.
In this article, we will dive into the world of XUI Panel commands and explore how you can use them to take your IPTV business to the next level. Whether you are a seasoned IPTV provider or just starting out, this guide will equip you with the knowledge and tools to maximize the potential of XUI Panel commands. So, let's get started!
Looking for a step-by-step XUI Panel installation tutorial? Read on:
How to Install XUI ONE - Step by Step Tutorial
Basics for XUI.ONE
Service Commands
service xuione <start|stop|reload|restart>
service xuione startGenerate License
To generate a license after installing, go to http://yoursite.com/accesscode and replace it with the unique access code for your installation.
If it doesn't work, follow the Access Code instructions. If you need to regenerate the license, follow the instructions below.
- Visit the XUI Billing Panel, log in and Reissue your license (for Main server only). Load balancers can skip this step.
- Ensure your license number is in /home/xui/config/config.ini
- Run the following commands on the server via SSH:
rm /home/xui/config/license
sudo -u xui /home/xui/bin/php/bin/php /home/xui/crons/license.phpThe license.php will output information about your license and whether it is valid or not. If this doesn’t work, and your license is definitely in the reissued state, then you’ll have to contact support.
No Access Code
If you can't access the admin interface because your access code isn't working, check the /home /xui/bin/nginx/conf/codes/ directory for a code that ends with .conf. If you find one, try using it as your access code.
If there are no codes that end with .conf, or the ones that do are not for an admin interface login, then copy template to admin.conf and make the following changes:
- Replace
#CODE#withadmin - Replace
#TYPE#withadmin - Delete
#WHITELIST# - Enter mysql via your preferred method and run: USE
`xui`; INSERT INTO `access_codes`( `code`, `type`, `enabled`, `groups`) VALUES ('admin', 0, 1, '[1]'); - Run the following command via SSH:
service xuione reload - You should now be able to access the admin panel via:
http://yoursite.com:8080/admin
Login Error: “You do not have access”
This error is related to the access code you're using. It means the access code belongs to a different user group than the one you're in. Make sure you're using the correct user or access code. If you can't access the panel due to this error, follow the instructions in the "No Access Code" section to create a new access code for admins.
MySQL Access Denied
If you’re getting access denied on the main server, you’re going to need to edit /home/xui/config/config.ini and change the username and password in the Encrypted section to match the credentials you were given when installing XUI, like this:
[Encrypted]username = "username"password = "password"
Save and restart the panel.
For load balancers, you can either follow the steps above or regenerate MySQL authentication using the "General" option in Management -> Tools -> Quick Tools. If the issue persists, it may be because the XUI MySQL user doesn't have permission to authorize external users. To fix this, you'll need to grant the privilege or manually allow the load balancer IP. If neither option works, it's an advanced procedure that may require external help.
Load Balancer Offline
To diagnose why the load balancer isn't going online, access it via SSH and run
/etc/init.d/xuione stop
/etc/init.d/xuione startThis will give you information about the issue, which could be related to MySQL, the license, or missing libraries. Follow the trail to troubleshoot the problem.
Reset Admin User
To reset the admin user, run the following command via MySQL to restore user ID 1 to the default username and password, which is admin for both. Afterward, make sure to change the username and password.
USE `xui`; REPLACE INTO `users`(`id`, `username`, `password`, `member_group_id`, `status`, `owner_id`, `date_registered`) VALUES(1, 'admin', '$6$rounds=20000$xui$eQfRsD2gsIUhoY5RnnYN82qiB5VeZTcHICQrFxXpa98J2R1454b6lzVHVjiJ.NP0gi0X3K7NXVgxeR1VhVhg61', 1, 1, 0, UNIX_TIMESTAMP());XUI.ONE How to Use / Add Admin API
- Open the Panel, go to Management > Access Control > Access Codes
- Add Access Code, select from Access Type: Admin API and click next.
- Select as Group “Administrators”.
- If you want restrict the API to a cretain IP, add the IP and save it.
- To get the Admin API Key, open the Admin Profile.
You can then access the API via: http://yoursite.com/accesscode/?api_key=#APIKEY#
Example: https://[domain]:[port]/[accesscode]/?api_key=[api_key]&action=[api_command]https://bestdomain.com:9000/rnVKrSLe/?api_key=1A2C5C80056A80F5AB6ECAD3937875DE&action=packages
If you're a developer, use this as your API endpoint and set the "action" parameter to one of the available API commands:
GET INFOmysql_queryuser_infoget_linesget_magsget_enigmasget_usersget_streamsget_channelsget_stationsget_moviesget_series_listget_episodes
LOGS & EVENT APIactivity_logslive_connectionscredit_logsclient_logsuser_logsstream_errorswatch_outputsystem_logslogin_logsrestream_logsmag_events
LINE APIget_linecreate_lineedit_linedelete_linedisable_lineenable_lineunban_lineban_line
USER APIget_usercreate_useredit_userdelete_userdisable_userenable_user
MAG APIget_magcreate_magedit_magdelete_magdisable_magenable_magunban_magban_magconvert_mag
ENIGMA APIget_enigmacreate_enigmaedit_enigmadelete_enigmadisable_enigmaenable_enigmaunban_enigmaban_enigmaconvert_enigma
BOUQUETE APIget_bouquetsget_bouquetcreate_bouquetedit_bouquetdelete_bouquet
ACCESS CODE APIget_access_codesget_access_codecreate_access_codeedit_access_codedelete_access_code
HMAC APIget_hmacsget_hmaccreate_hmacedit_hmacdelete_hmac
EPG APIget_epgsget_epgcreate_epgedit_epgdelete_epgreload_epg
GROUPS APIget_groupsget_groupcreate_groupedit_groupdelete_group
PACKAGES APIget_packagesget_packagecreate_packageedit_packagedelete_package
TRANSCODING PROFILE APIget_transcode_profilesget_transcode_profilecreate_transcode_profileedit_transcode_profiledelete_transcode_profile
RTMP APIget_rtmp_ipsget_rtmp_ipcreate_rtmp_ipedit_rtmp_ipdelete_rtmp_ip
CATEGORIES APIget_categoriesget_categorycreate_categoryedit_categorydelete_category
SUB RESELLER APIget_subresellersget_subresellercreate_subreselleredit_subresellerdelete_subreseller
WATCH FOLDERS APIget_watch_foldersget_watch_foldercreate_watch_folderedit_watch_folderdelete_watch_folderreload_watch_folder
BLOCKED ISP & IP APIget_blocked_ispsadd_blocked_ispdelete_blocked_ispget_blocked_uasadd_blocked_uadelete_blocked_uaget_blocked_ipsadd_blocked_ipdelete_blocked_ipflush_blocked_ips
STREAMS APIget_streamcreate_streamedit_streamstart_streamstop_streamdelete_stream
CHANNEL APIget_channelcreate_channeledit_channelstart_channelstop_channeldelete_channel
STATION APIget_stationcreate_stationedit_stationstart_stationstop_stationdelete_station
MOVIE APIget_moviecreate_movieedit_moviestart_moviestop_moviedelete_movie
SERIES APIget_seriescreate_seriesedit_seriesdelete_series
EPISONE APIget_episodecreate_episodedelete_episodeedit_episodestart_episodestop_episode
SERVERS APIget_serversget_serverinstall_serverdelete_serveredit_serverinstall_proxyedit_proxy
SETTINGS, STATS AND OTHER APIget_settingsedit_settingsget_server_statsget_fpm_statusget_rtmp_statsget_free_spaceget_pidsget_certificate_inforeload_nginxclear_tempclear_streamsupdate_blacklistget_directorykill_pidkill_connectionreload_cache
The upcoming API information will explain each function and its parameters. In the meantime, you can explore by enabling Developer Tools in the Admin Interface and logging traffic to post.php. The parameters sent there are the same ones you can use for the related API function.
For instance, if you add a stream in the "Streams" section, you can log post.php and send the same request to the "create_stream" function to replicate it. To edit a stream, pass the ID along with the request.
Some of the functions are server specific, so send server_id with them, for example:get_server_stats, get_fpm_status, get_rtmp_stats, get_free_space, get_pids, get_certificate_info, reload_nginx, clear_temp, clear_streams, update_blacklist, get_directory
If you have any questions or suggestions, please feel free to leave them in the comments below. We're always happy to help you on your IPTV journey!