These imports are only appropriate inside commands.  Just another indication that this code should be inside the cache_subtitles command.