Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 34 lines (27 sloc) 1015 Bytes
#!/usr/bin/ruby
#
# Nie mam Microsoft Silverlight i miec nie bede !
#
# (c) Lukasz Jagiello <lukasz@jagiello.org>
#
require 'rubygems'
require 'json'
require 'net/http'
def download(url)
resp = Net::HTTP.get_response(URI.parse(url))
resp.body
end
base_url = "http://tvnplayer.pl/api/?platform=ConnectedTV&terminal=Samsung&format=json&authKey=ba786b315508f0920eca1c34d65534cd"
# Glowne menu
#url = "#{base_url}&m=mainInfo"
fakty_lista_url = "#{base_url}&m=getItems&type=series&id=516&limit=500&page=1&sort=newest"
fakty_lista = JSON.parse(download(fakty_lista_url))
fakty_lista['items'].each do |odc|
fakty_id_url = "#{base_url}&type=episodes&id=#{odc['id']}&v=2.0&sort=newest&m=getItem&deviceScreenHeight=1080&deviceScreenWidth=720"
fakty_id = JSON.parse(download(fakty_id_url))
print fakty_id['item']['serie_title'] + ' '
print fakty_id['item']['title'] + "\n"
fakty_id['item']['videos']['main']['video_content'].each do |res|
puts "\t" + res['profile_name'] + ' : ' + download(res['url'])
end
end