Based on paid challenge https://app.codecrafters.io/courses/bittorrent/introduction, i tried to implement the challenge on free version of course, just reading the docs. And i managed to download the file in sample.torrent, so i am sharing my implementation here.
This cannot be used to download a real torrent because it do not check if the first peer has the piece before request.