The Secret Squirrel Show (1965) : Yo Ho Ho

Squiddly finds a time machine out in the desert, gets in it, and starts playing with the controls. He finds himself back in time and on a ship being attacked by Blackbeard the pirate.