Recently, peer-to-peer has been becoming a promising architecture for developing video streaming services because it can reduce the bottlenecks and the load at the server side. However, P2P systems implement their own routing protocols on overlay networks, which are largely independent of the Internet routing. As a result, the traffic generated by P2P systems is immense and unpredictable. Controlling the P2P traffic is therefore becoming a big challenge for internet service providers (ISPs). Considering the P2P traffic localization is one of the most efficient solutions to optimize the traffic. The existing approaches, however, require several modifications of the application software. In this paper, we propose a novel traffic localization method for P2P streaming application (P2PTV) by deep packet inspection. Based on the peer list and the geographical location of the listed peers, we propose two mechanisms for localizing the traffic: the modification of the peer list packets and the redirection of the video request packets at network routers. Since our method is implemented on the network routers, it can be applied for all P2P applications without any software modifications. The experiments evaluated on a popular P2PTV, namely PPStream, prove the effectiveness of our proposed method on the problem of traffic localization.