This installation guide covers both ESX and QBCore frameworks.
Setup
Don't forget to set your Framework in the config.lua file.
First open cmd in folder part and write "npm install" if you dont want this download from here node_modules folder and put in this folder.
Setup Step 1
Open the config.js file for video downloads and audio recordings to work.
Type your server's IP address here.
Config.Host ="127.0.0.1"// Replace Your IP
In order to record voice recordings, you must create TCP and UDP ports inbound and outbound.
The port number must be a number you specify or 48080.
After moving the script to the resources folder, open your server.cfg file and position it as follows.
--- main core ----
start res-audio
--- other resources ---
And now let's create our database tables.
CREATETABLE`res-audio` (`id`int(11) NOT NULL,`owner`textNOT NULL,`url`textNOT NULL,`name`textNOT NULL,`cat`int(11) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;CREATETABLE`res-audio-profile` (`id`int(11) NOT NULL,`owner`textNOT NULL,`name`textNOT NULL,`url`textNOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;CREATETABLE`res-spotify` (`id`int(11) NOT NULL,`owner`textNOT NULL,`name`textNOT NULL,`img`textNOT NULL,`url` longtext NOT NULL,`cur_mahlas`textNOT NULL,`cur_avatar`textNOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;ALTERTABLE`res-audio`ADDPRIMARY KEY (`id`);ALTERTABLE`res-audio-profile`ADDPRIMARY KEY (`id`);ALTERTABLE`res-spotify`ADDPRIMARY KEY (`id`);ALTERTABLE`res-audio`MODIFY`id`int(11) NOT NULL AUTO_INCREMENT;ALTERTABLE`res-audio-profile`MODIFY`id`int(11) NOT NULL AUTO_INCREMENT;ALTERTABLE`res-spotify`MODIFY`id`int(11) NOT NULL AUTO_INCREMENT;COMMIT;
Now you can start the server and use the script. Remember that it is opened with the /studio command.
I cannot download YouTube videos. How do I solve it?
If YouTube videos are not downloading, you can find a solution by downloading an old version of ytdl-core. It will work more stable, but the videos will download late.
You can solve this problem by using the command below.
npm i ytdl-core@4.9.1
If you want to update ytdl-core again, you can use the code below. If a new ytdl-core is released, try it, it may work more stable.