rewrite scritp for latest popcorn time git