MGTS IPTV: Channel Search
Write a paper, and give a talk, about any idea, no matter how insignificant it may seem to you.
SP Jones, How to write a great research paper
In Moscow, MGTS is taking measures to replace copper wiring with optics using GPON technology. As a result, MGTS subscribers get the opportunity to use not only telephone communications, but also Internet access, as well as watch IP-TV. To watch TV programs MGTS offers to rent a set-top box, which will provide viewing.
Below I will tell you how, using the available tools of Debian Linux, find the channels that are available for viewing without a prefix.
Recently, more and more often, from friends and colleagues I began to hear the new word GPON - the story was accompanied by heartbreaking details: they say people from MGTS come to your house, cut an old copper telephone wire, beat a 220 V socket and a box near the front door, through which the telephone now works, and if desired, the Internet, and even television.
It got to the point that, as a guest, I saw this very television through GPON with my own eyes - a prefix with the inscription MTS flaunted near the TV , and a white box ZTE ZXA10 F660 glittered with lights in the hallway. The prefix with ZTE F660 was connected by an ordinary two-pair Cat5 cable with RJ45 connectors at the ends; From the description of the ZTE F660, it became clear that Ethernet is used to transfer data to the set-top box. There was an seditious thought: "Well, how can I connect a laptop instead of a console - can I watch TV?"
Searches led me to a suitable forum . It turned out that the question of watching TV without a console does not only torment me:
Is it possible to watch TV channels directly on a computer? Most providers download the playlist and open it in the client, for example, VLC. At MGTS GPON, everything is focused on the use of a set-top box and a TV ... technical support from a question falls into a stupor. If someone had experience setting up, share, pls.
From the reading of the forum, it became clear that if the ZTE F660 is configured “by default”, then you must connect to the LAN4 socket to watch TV, and you also need to get this very “playlist” (there is no official “playlist” from MGTS).
I managed to find several "playlists": for example, here .
It turned out that only some channels from the "playlists" work. And some work in half - instead of a picture, it shows garbage, but the sound is broadcast normally (such channels are encrypted, you need to pay separately for viewing them).
There was an idea that a “playlist” is a volatile thing, and it’s worth making your own by sorting out the appropriate ranges of IP addresses based on the contents of the old “playlists”. In order not to search manually, a simple script was written in bash. The script iterates over the addresses from which it is possible to broadcast, and, if successful, pulls out one frame of the TV show:
#!/bin/bash
for i in $(seq 1 255); do
IP=239.255.2.$i
URL=udp://@$IP:5500
echo "== $URL =="
mplayer -ac none -really-quiet -vo png -frames 1 $URL 2>/dev/null
mv 00000001.png $IP.png
done
For each of the IP addresses for which it was possible to catch the TV channel, a file with the name of the view will be created
$IP.png.
Further, it is not difficult to erase those files that correspond to encrypted (or unwanted channels) and generate your own M3U “playlist”:
( echo '#EXTM3U' ; \
ls -1 *png | sort -V | sed "s/^\(.*\)\.png/#EXTINF:-1,\1\nudp:\/\/@\1\:5500/" ) > playlist
I got such a list with 28 open channels:
#EXTM3U
#EXTINF:-1,5 канал
udp://@239.255.2.18:5500
#EXTINF:-1,Russian Musicbox
udp://@239.255.2.37:5500
#EXTINF:-1,Детский
udp://@239.255.2.47:5500
#EXTINF:-1,ТРО
udp://@239.255.2.52:5500
#EXTINF:-1,Перец
udp://@239.255.2.54:5500
#EXTINF:-1,Disney
udp://@239.255.2.57:5500
#EXTINF:-1,ТВЦ
udp://@239.255.2.58:5500
#EXTINF:-1,РЕН ТВ
udp://@239.255.2.59:5500
#EXTINF:-1,СТС
udp://@239.255.2.61:5500
#EXTINF:-1,Ю
udp://@239.255.2.62:5500
#EXTINF:-1,Домашний
udp://@239.255.2.63:5500
#EXTINF:-1,Россия 2
udp://@239.255.2.65:5500
#EXTINF:-1,Россия 1
udp://@239.255.2.67:5500
#EXTINF:-1,Россия К
udp://@239.255.2.68:5500
#EXTINF:-1,ТВ3
udp://@239.255.2.90:5500
#EXTINF:-1,Звезда
udp://@239.255.2.91:5500
#EXTINF:-1,НТВ
udp://@239.255.2.95:5500
#EXTINF:-1,Первый канал
udp://@239.255.2.97:5500
#EXTINF:-1,ПЯТНИЦА!
udp://@239.255.2.98:5500
#EXTINF:-1,ТНТ
udp://@239.255.2.100:5500
#EXTINF:-1,Россия 24
udp://@239.255.2.109:5500
#EXTINF:-1,СТС love
udp://@239.255.2.112:5500
#EXTINF:-1,2x2
udp://@239.255.2.115:5500
#EXTINF:-1,PRO Бизнес
udp://@239.255.2.119:5500
#EXTINF:-1,Россия HD
udp://@239.255.2.120:5500
#EXTINF:-1,HD life
udp://@239.255.2.156:5500
#EXTINF:-1,Первый канал HD
udp://@239.255.2.185:5500
#EXTINF:-1,ОТР
udp://@239.255.2.210:5500
The application of the method described above confirms the empirical Pareto law as best as possible: with little effort (writing a simple script and a few minutes to view the “picture gallery”), we managed to get a result quite suitable for practical use (M3U “playlist”).
Of course, I would like to receive a “playlist” with a minimum investment of manual labor. This can be done, for example, by looking at the traffic of the network set-top box immediately after its inclusion and making efforts to decrypt the protocol by which the set-top box receives data about the list of channels. But this is a completely different story ...
PS Before publishing, I decided to run the script, sorting the addresses, one more time and discovered at least three new channels:
#EXTINF:-1,ТНВ Татарстан
udp://@239.255.2.86:5500
#EXTINF:-1,Ля Минор
udp://@239.255.2.233:5500
#EXTINF:-1,МТС
udp://@239.255.2.249:5500