automatically running js functions to fetch videos