Improved video id replacement