You may not have realized it, but when you painted your drain pipe you probably doubled its life span. Plastic pipe and the sun just don't get along, and paint works as a terrific barrier to the sun's ultraviolet rays. By the way, this holds true for all plastic pipe we know about.
You've protected the pipe the best you can, so you need tougher pipe. This time ask for at least a "Schedule 40" pipe. The higher the schedule number, the thicker the pipe. Ask the clerk at the hardware store for either "Rigid ABS" or "Rigid PVC" type pipe. ABS is black in color, and is used primarily for sewer lines. PVC is white in color, and is used primarily as water supply line. In either case, the schedule number will be printed on the pipe. Generally speaking the thicker the pipe the longer it will last.
Painting is an absolute must, regardless of the type pipe you select. Use an acrylic latex paint, and use it to cover all surfaces (inside or out) that will be exposed to the sun.