tunlr - dns service for accessing geo locked video content

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
rogerthis Offline
Posts: 213
Joined: Apr 2011
Reputation: 2
Location: Connacht
Post: #1
http://tunlr.net/ Tunlr is a free dns proxy, for getting videos in geo locked sites in the UK and US.

http://tunlr.net/faq/supported-services-players/ - supported players

Here is the code to use tunlr in an addon, I have used bbc iplayer as an example:
Original code here https://github.com/oe-alliance/oe-allian...iplayer.py

You need import dnspython http://www.dnspython.org/
from dns.resolver import Resolver

if html1.find('notukerror') > 0:
            self.notUK = 1
            print "Non UK Address"
            opener = urllib2.build_opener(MyHTTPHandler)
            old_opener = urllib2._opener
            urllib2.install_opener (opener)
            url2 = 'http://www.bbc.co.uk/mediaselector/4/mtis/stream/'+links
            #print 'url2',url2
            req = urllib2.Request(url2)
            req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv: Gecko/2008092417 Firefox/3.0.3')
            response = urllib2.urlopen(req)
            html1 = str(response.read())
            urllib2.install_opener (old_opener)

class MyHTTPConnection(httplib.HTTPConnection):
    def connect (self):
        resolver = Resolver()
        resolver.nameservers = ['']  #tunlr dns address
        answer = resolver.query(self.host,'A')
        self.host = answer.rrset.items[0].address
        self.sock = socket.create_connection ((self.host, self.port))

class MyHTTPHandler(urllib2.HTTPHandler):
    def http_open(self, req):
        return self.do_open (MyHTTPConnection, req)

What this code does is, when it is detected that you have an outside UK IP, it uses tunlr as your dns server. Then it turns it off again once the play url is found. And it will play using your own dns. So it not wasting tunlr dns unless it needs to.
find quote
akiaki Offline
Posts: 59
Joined: Sep 2008
Reputation: 0
Post: #2
This is great, can you make this into an addon?
Is this code meant to go into the iplayer addon directly somewhere?
find quote
perro6969 Offline
Senior Member
Posts: 110
Joined: May 2010
Reputation: 0
Post: #3
More than great! Have someone tried it on the Vevo addon?
find quote
moneymaker Offline
Posts: 601
Joined: Feb 2012
Reputation: 37
Location: USE
Post: #4
This could be even code in to hulu

// GitHub // Repository

// USTV VoD (Video-on-Demand) / World News Live / MRT Play

find quote
ShinobiX9X Offline
Junior Member
Posts: 38
Joined: Sep 2010
Reputation: 0
Post: #5
Could i get a howto to do this for this and hulu and others?

Thanks in advance

SONY STR-DH820 | SONY SA-VE705 | Intel® Core™2 Quad Processor Q8400, ASUS P5QD Turbo, SAMSUNG SH-B123L Blu-Ray Combo, ZALMAN HD503 | PANASONIC TX-P42U10E
find quote
deadbuzzard Offline
Junior Member
Posts: 1
Joined: Dec 2013
Reputation: 0
Post: #6
Where do I need to add the code posted here to?
(This post was last modified: 2013-12-21 21:51 by deadbuzzard.)
find quote
RedPenguin Offline
Posts: 422
Joined: Jan 2012
Reputation: 18
Post: #7
Do you think you could work this "code" into your tunlr script and enable us to watch live BBC streams in XBMC's iPlayer addon?


This method works perfectly with Firefox and using Tunlr as DNS.

According to this thread http://forum.xbmc.org/showthread.php?tid=77500 it's already possible to modify an outgoing HTTP Header so I would assume this shouldn't be insanely difficult.

My librtmp & rtmpdump files for Android-ARM (APKs also), ATV1, iOS (Apple TV 2, iPhone, iPod Touch, & iPad), Linux (32bit & 64bit), MacOS x86 (32bit & 64bit), RasPi, & Windows

My technological website:

(This post was last modified: 2013-12-30 08:21 by RedPenguin.)
find quote