To run TVerRec in a Google Colab environment, you must perform a multi-step setup: install system dependencies (including PowerShell), clone the repository, configure paths for the Colab filesystem, and mount Google Drive for persistent storage.
Follow these steps in order:
- Install System Dependencies: Update
apt and install wget, git, and powershell via the Microsoft repository. - Clone Repository: Clone
https://github.com/dongaba/TVerRec and ensure shell scripts are executable. - Configure Colab Paths: Use
sed to fix relative paths in shell scripts and append Colab-specific directory settings to conf/user_setting.ps1. - Mount Drive: Mount Google Drive to allow saving downloads to your Drive storage.
- Execute: Run the startup script.
# 1. Install dependencies and PowerShell
!sudo apt-get update
!sudo apt-get install -y wget apt-transport-https software-properties-common git
!wget -q "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb"
!sudo dpkg -i packages-microsoft-prod.deb
!rm -rf packages-microsoft-prod.deb*
!sudo apt-get update
!sudo apt-get install -y powershell
# 2. Clone and prepare repository
!if [ ! -d /content/TVerRec ] ; then git clone https://github.com/dongaba/TVerRec ; else cd /content/TVerRec && git pull && cd - ; fi
!chmod a+x /content/TVerRec/unix/*.sh
# 3. Configure for Colab environment
!sed -i -e "s|\.\./src|/content/TVerRec/src|g" /content/TVerRec/unix/*.sh
!echo '$script:downloadBaseDir = "/content/drive/MyDrive/Work"' >> /content/TVerRec/conf/user_setting.ps1
!echo '$script:downloadWorkDir = "/tmp"' >> /content/TVerRec/conf/user_setting.ps1
!echo '$script:saveBaseDir = "/content/drive/MyDrive/Save"' >> /content/TVerRec/conf/user_setting.ps1
# 4. Mount Google Drive
from google.colab import drive
drive.mount('/content/drive')
# 5. Start TVerRec
!/content/TVerRec/unix/start_tverrec.sh