Audio/video stream recording forums (http://stream-recorder.com/forum/index.php)
-   (Russian) Запись онлайн (http://stream-recorder.com/forum/forumdisplay.php?f=50)
-   -  

www.tsr.ch - не могу стянуть с ТСР флэш фильм

(http://stream-recorder.com/forum/showthread.php?t=6729)

any ANONYMOUS forum user 05-27-2010 08:01 AM

www.tsr.ch - не могу стянуть с ТСР флэш фильм


 
А я никак не могу стянуть с ТСР фильм на 45 минут, грабить экран не хочу, будут глюки, нужен именно флэш

Code:

http://www.tsr.ch/video/divertissement/1966345-roller-babies.html#id=1966345

elch 05-27-2010 08:20 AM

Re: www.tsr.ch - не могу стянуть с ТСР флэш фильм


 
They're using HTTP.

Sorry, I don't speak Russian. Would you mind translating your message to English?

alexthunder 05-27-2010 09:10 AM

Re: www.tsr.ch - не могу стянуть с ТСР флэш фильм


 
Если встречается Adobe Flash Player, при этом видео не помогают скачать плагины для браузера, такие как Fast Video Download для огнелиса, то нужно пробовать Flash stream recorders, которые поддерживают RTMP или RTMPE протокол.

В данном случае используется RTMP, так что скачать его можно легко. Попробуйте бесплатные StreamTransport, Orbit Grab Pro, CooJah + Blader. Также можно использовать rtmpdump, VLC player, хотя ссылки на потоки придется находить не при помощи этих программ. Из платных рекомендую Jaksta.

alexthunder 05-27-2010 09:11 AM

Re: www.tsr.ch - не могу стянуть с ТСР флэш фильм


 
Quote:

Originally Posted by elch (Post 19177)
Sorry, I don't speak Russian. Would you mind translating your message to English?

I can't grab a 45 min movie from TCP. I don't want to capture from screen, because of the glitches. I need flash.

elch 05-27-2010 12:24 PM

Re: www.tsr.ch - не могу стянуть с ТСР флэш фильм


 
Thanks for translating, Alex!

Here's a quick'n'dirty script I've written several months ago. Still seems to work perfectly:

Code:

$ cat tsr-scan
#!/usr/bin/php
<?php

error_reporting(E_ALL);

$subscriptions = array (
        '55', // temps present
        '97', // services religieux
        '90'  // nouvo
);

$fp = fopen('tsrdl.sh', 'w');

fwrite($fp, '#!/bin/sh' . PHP_EOL);

$path = '/mnt/usb/Series';

foreach ($subscriptions as $id) {
        $url = "http://search2.tsr.ch/solr/select?q=xobix_program_id:$id;broadcast_date%20desc,%20xobix_broadcast_position%20asc&wt=xml";
        $contents = file_get_contents($url);

        preg_match('/<str name="source_name">(.*)<\/str>/Umis', $contents, $matches);

        if (!$matches[1]) {
                echo $id . ' is invalid!';
                continue;
        }

        $title = $matches[1];

        fwrite($fp, PHP_EOL);
        fwrite($fp, '# ' . $title . PHP_EOL);
        fwrite($fp, '# -----------------------------------' . PHP_EOL);

        preg_match_all('/<str name="subtitle">(.*)<\/str>/Umis', $contents, $matches2);
        preg_match_all('/<arr name="media_file_info">(.*)<\/arr>/Umis', $contents, $matches3);

        foreach ($matches2[1] as $key => $subtitle) {
                $urls = $matches3[1][$key];

                preg_match_all('/<str>(.*)<\/str>/Umis', $urls, $matchesUrls);

                for ($i = count($matchesUrls[1]) - 1; $i >= 0; $i--) {
                        preg_match('/"url" : \'(.*)\'/', $matchesUrls[1][$i], $match);
                        $url = $match[1];

                        if (stripos($url, 'real.xobix.ch') !== false) {
                                continue;
                        }

                        fwrite($fp, PHP_EOL);
                        fwrite($fp, '# ' . $subtitle . PHP_EOL);

                        $fullpath = $path . '/' . $title . '/' . $subtitle;
                        $filepath =    $fullpath . '/'. substr(basename($url), 0, strrpos(basename($url), '?'));

                        $comment = '';
                        if ((stripos($subtitle, 'Version courte') !== false) || file_exists($fullpath)) {
                                        $comment = '# ';
                        }

                        fwrite($fp, $comment . 'mkdir -p ' . escapeshellarg($fullpath) . PHP_EOL);
                        fwrite($fp, $comment . 'wget ' . escapeshellarg($url) . ' -O ' . escapeshellarg($filepath) . ' || exit 1' . PHP_EOL);

                        break;
                }
        }

        fwrite($fp, PHP_EOL);

        sleep(1);
}

shell_exec('chmod +x tsrdl.sh');

Then use ./tsrdl.sh for downloading.

Edit: Oh yeah, and it's Linux-only but porting to Windows should be quite easy since wget is available there too. Only the last command should be changed coz Windows has no executable flag in their file system, as far as I know.

alexthunder 05-27-2010 12:40 PM

Re: www.tsr.ch - не могу стянуть с ТСР флэш фильм


 
You are welcome! I got an RTMP stream with Replay Media Catcher, so I don't know how you've managed to get it with wget :confused:

Вольный перевод, для тех, кто в танке :D:
Quote:

Originally Posted by elch (Post 19199)
Вот хз какой-то скрипт, который я написал несколько месяцев назад. Он, кажется, все еще работает отлично:

Code:

$ cat tsr-scan
#!/usr/bin/php
<?php

error_reporting(E_ALL);

$subscriptions = array (
        '55', // temps present
        '97', // services religieux
        '90'  // nouvo
);

$fp = fopen('tsrdl.sh', 'w');

fwrite($fp, '#!/bin/sh' . PHP_EOL);

$path = '/mnt/usb/Series';

foreach ($subscriptions as $id) {
        $url = "http://search2.tsr.ch/solr/select?q=xobix_program_id:$id;broadcast_date%20desc,%20xobix_broadcast_position%20asc&wt=xml";
        $contents = file_get_contents($url);

        preg_match('/<str name="source_name">(.*)<\/str>/Umis', $contents, $matches);

        if (!$matches[1]) {
                echo $id . ' is invalid!';
                continue;
        }

        $title = $matches[1];

        fwrite($fp, PHP_EOL);
        fwrite($fp, '# ' . $title . PHP_EOL);
        fwrite($fp, '# -----------------------------------' . PHP_EOL);

        preg_match_all('/<str name="subtitle">(.*)<\/str>/Umis', $contents, $matches2);
        preg_match_all('/<arr name="media_file_info">(.*)<\/arr>/Umis', $contents, $matches3);

        foreach ($matches2[1] as $key => $subtitle) {
                $urls = $matches3[1][$key];

                preg_match_all('/<str>(.*)<\/str>/Umis', $urls, $matchesUrls);

                for ($i = count($matchesUrls[1]) - 1; $i >= 0; $i--) {
                        preg_match('/"url" : \'(.*)\'/', $matchesUrls[1][$i], $match);
                        $url = $match[1];

                        if (stripos($url, 'real.xobix.ch') !== false) {
                                continue;
                        }

                        fwrite($fp, PHP_EOL);
                        fwrite($fp, '# ' . $subtitle . PHP_EOL);

                        $fullpath = $path . '/' . $title . '/' . $subtitle;
                        $filepath =    $fullpath . '/'. substr(basename($url), 0, strrpos(basename($url), '?'));

                        $comment = '';
                        if ((stripos($subtitle, 'Version courte') !== false) || file_exists($fullpath)) {
                                        $comment = '# ';
                        }

                        fwrite($fp, $comment . 'mkdir -p ' . escapeshellarg($fullpath) . PHP_EOL);
                        fwrite($fp, $comment . 'wget ' . escapeshellarg($url) . ' -O ' . escapeshellarg($filepath) . ' || exit 1' . PHP_EOL);

                        break;
                }
        }

        fwrite($fp, PHP_EOL);

        sleep(1);
}

shell_exec('chmod +x tsrdl.sh');

Затем используйте ./tsrdl.sh для скачивания.

Исправлено: О да, и это только для Линукс, но портировать в Винду должно быть достаточно просто, т.к. wget там тоже есть. Только последнюю компанду нужно изменить, потому что в Винде нет флага для исполняемых файлов, насколько я знаю.


elch 05-28-2010 08:40 AM

Re: www.tsr.ch - не могу стянуть с ТСР флэш фильм


 
Yeah, probably they also offer RTMP for some streams. That's why it might have shown something in Replay Media Catcher.
I used Wireshark. There, an HTTP response popped up pointing to some MP4 URLs in different qualities.


All times are GMT -6. The time now is 09:19 AM.