apt update; apt upgrade -y; apt install php ffmpeg apache2 php-gd samba python3-pip -y rm -rf /var/www/html/* mkdir -p /var/www/html/download /var/www/html/downloader /var/www/html/download/queue /var/www/html/download/ready cp -r downloader/* /var/www/html/downloader # Create system user if it doesn't exist sudo useradd -m -s /bin/bash shreebhattji sudo smbpasswd -a shreebhattji echo "foreverstreamingpartner" | sudo smbpasswd -s -a shreebhattji sudo chmod 755 /var/www/html # Add shreebhattji to www-data group to avoid read/write conflicts sudo usermod -a -G www-data shreebhattji sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.backup cat << EOF | sudo tee -a /etc/samba/smb.conf [download] path = /var/www/html/download browseable = yes writable = yes guest ok = no read only = no valid users = shreebhattji EOF sudo systemctl restart smbd nmbd sudo systemctl enable smbd nmbd cp transcode.sh /var/www/transcode.sh cat << EOF | sudo tee -a /etc/systemd/system/transcode.service [Unit] Description=Video Transcoding Service After=network.target [Service] Type=simple User=www-data Group=www-data WorkingDirectory=/var/www/ ExecStart=/bin/bash /var/www/transcode.sh Restart=always RestartSec=10 StandardOutput=journal StandardError=journal [Install] WantedBy=multi-user.target EOF pip install yt-dlp --break-system-packages