View Single Post
  #60  
Old 04-05-2016, 04:00 AM
biezom biezom is offline
Senior Member
 
Join Date: Sep 2014
Posts: 1,025
biezom is on a distinguished road
Default

Re: Downloading from voot.com


hi

two codes php and python

no need vpn it works without indian ip

Code:
<?php

$idcontent = substr($argv[1], -6);
$data = '{"initObj":{"Locale":{"LocaleLanguage":"","LocaleCountry":"","LocaleDevice":"","LocaleUserState":"Unknown"},"Platform":"Web","SiteGuid":"","DomainID":0,"UDID":"","ApiUser":"tvpapi_225","ApiPass":"11111"},"MediaID":"' . $idcontent . '","mediaType":0,"picSize":"full","withDynamic":false}';

$time_start = microtime(true);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://tvpapi-as.ott.kaltura.com/v3_4/gateways/jsonpostgw.aspx?m=GetMediaInfo');
curl_setopt($ch, CURLOPT_POST, 1);   
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json;charset=utf-8'));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_REFERER, $argv[1]);
curl_setopt($ch, CURLOPT_ENCODING , "gzip");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Linux i686; rv:41.0) Gecko/20100101 Firefox/41.0 Iceweasel/41.0");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
$result = curl_exec($ch);
curl_close ($ch);

preg_match('/"Format":"dash Main".*?CoGuid":"(.*?)"/', $result, $ids);
preg_match('/"MediaName":"(.*?)"/', $result, $name);
$name= str_ireplace(' ', '-', $name[1]);

preg_match('/(.*?)_0_/', $ids[1], $entryId);
preg_match('/(.*?),/', $ids[1], $low);
preg_match('/0_.*?_(.*)/', $low[1], $lflavorId);
preg_match('/,(.*?),/', $ids[1], $medium);
preg_match('/0_.*?_(.*)/', $medium[1], $mflavorId);
preg_match('/.*?,.*?,(.*)/', $ids[1], $high);
preg_match('/0_.*?_(.*)/', $high[1], $hflavorId);

$link = 'http://video.voot.com/enc/fhls/p/1982551/sp/198255100/serveFlavor/entryId/' . $entryId[1] . '/v/2/pv/1/flavorId/' . $hflavorId[1] . '/name/a.mp4/index.m3u8';

echo "$link\n\n";

echo "Starting  livestreamer...\n\n";
	echo shell_exec("livestreamer \"hls://$link\" best -o $name.ts&");
	echo "Done.\n";

?>


Code:
import requests
import re
import os
import sys

idcontent= sys.argv[1][-6:]
pageUrl2= 'http://tvpapi-as.ott.kaltura.com/v3_4/gateways/jsonpostgw.aspx?m=GetMediaInfo'
headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux i686; rv:41.0) Gecko/20100101 Firefox/41.0 Iceweasel/41.0.2', 'Referer': 'http://www.voot.com/', 'Content-Type': 'application/json;charset=utf-8'}
data= '{"initObj":{"Locale":{"LocaleLanguage":"","LocaleCountry":"","LocaleDevice":"","LocaleUserState":"Unknown"},"Platform":"Web","SiteGuid":"","DomainID":0,"UDID":"","ApiUser":"tvpapi_225","ApiPass":"11111"},"MediaID":"' + idcontent + '","mediaType":0,"picSize":"full","withDynamic":false}'

source = requests.post(pageUrl2, headers=headers, data=data)

name = re.findall('"MediaName":"(.*?)"', source.text)[0].replace(' ', '-')
ids=',' + re.findall('"Format":"dash Main".*?CoGuid":"(.*?)"', source.text)[0] + ','

quality = re.search(r',(.*?),(.*?),(.*?),', ids)

entryIdflavorId= re.search(r'(0_.*?)\_(0_.*)', quality.group(3))

link = 'http://video.voot.com/enc/fhls/p/1982551/sp/198255100/serveFlavor/entryId/' + entryIdflavorId.group(1) + '/v/2/pv/1/flavorId/' + entryIdflavorId.group(2) + '/name/a.mp4/index.m3u8'

print link

command = 'livestreamer  "hls://' + link + '" best -o ' + name + '.ts'
os.system(command)


Code:
php voot.php "http://www.voot.com/shows/khatron-ke-khiladi-s08/8/368214/the-grand-finale/389224"
Code:
http://video.voot.com/enc/fhls/p/1982551/sp/198255100/serveFlavor/entryId/0_vv9bzx3d/v/2/pv/1/flavorId/0_o8ql2x0l/name/a.mp4/index.m3u8

Starting  livestreamer...

[download][..ason-08---Episode-20.ts] Written 6.5 MB (9s @ 708.4 KB/s)

Code:
python voot.py "http://www.voot.com/shows/khatron-ke-khiladi-s08/8/368214/the-grand-finale/389224"
Code:
http://video.voot.com/enc/fhls/p/1982551/sp/198255100/serveFlavor/entryId/0_vv9bzx3d/v/2/pv/1/flavorId/0_o8ql2x0l/name/a.mp4/index.m3u8
[cli][info] Found matching plugin stream for URL hls://http://video.voot.com/enc/fhls/p/1982551/sp/198255100/serveFlavor/entryId/0_vv9bzx3d/v/2/pv/1/flavorId/0_o8ql2x0l/name/a.mp4/index.m3u8
[cli][info] Available streams: live (worst, best)
[cli][info] Opening stream: live (hls)
[download][..ason-08---Episode-20.ts] Written 9.8 MB (12s @ 798.5 KB/s)
Reply With Quote