The invention relates to a flexibly peristaltic pipeline robot. Left and right hemispherical shells of the robot are fixedly provided with ring flanges inside, the ring flanges are provided with connected pipelines and are connected with honeycomb ducts; the end of the right hemispherical shell is provided with a vane wheel connected with a generator, the right hemispherical shell is connected with a cavity, the cavity is connected with the honeycomb ducts, a DC brushless motor and a flexible shaft with screw thread guide rail are arranged on the ring flange of the right hemispherical shell, the DC brushless motor is connected with a rotary baffle; the ring flange of the left hemispherical shell is provided with a receiving channel, the flexible shaft passes through the channel, the flexible shaft is provided with a dual-sided screw nut through screw threads, the nut is externally connected with a gear which is fixed on the ring flange of the left hemispherical shell and is connected with the DC brushless motor; two ring flanges are both sleeved with electromagnets. The pipeline robot has the advantages of fast moving speed in pipelines and low energy consumption and charge by own structure; the design of the flexible shaft can make the pipeline robot smoothly pass through pipelines such as elbows, taper pipes, vertical tubes and so on; the pipeline robot also has the advantages of low manufacturing costs, obvious effects and wide application prospects in aspects such as pipeline detection and maintain and so on.