DEV Community

DeChamp
DeChamp

Posted on • Edited on

How I bypassed Hulu's website geolocation error, so I could log in

The issue

So I pay a monthly fee for Hulu, they rock and I love them. However, a recent change they did, made it so that in Safari it was giving me a geo location error and not letting me log in. It just sat at the welcome message.

Imgur

I have to use Safari, due to the reason that I use Pipifier to let me watch video, over the top of the rest of my screens (picture in picture).

The search

So here I am, clearing my cookies and double checking everything. I keep hitting "accept" on giving my location. Still nothing. So I do what any good developer does at this point. I open my developer console and get to digging.

First thing I see is error [geo lib] โ€“ 2... Well no wonder it's not doing anything then.

Imgur

So next, I open up the error and click to the code so that I can see whats going on. I kind of ignore the main error, and follow the trace stack. I see that it's happing during the function that sets the cookie!

Imgur

Boom! I know that this means that most likely I can just find the logic that sets the cookie, and set it myself. I can see where it's calling setCookie and it has clear as day, the logic they use to create the cookie string.

I'm going to leave out how they set the cookie far as inner workings, but the cookie name ended up being geo.

So I take that logic, and I use it to replicate the cookie as it would. I can see I need my location, so I go and look up my location on google maps, get my lat and lon, then back to the code.

I paste in the values real quick, and create the cookie via my console.

The solution

document.cookie = "geo=" + "".concat(xx.xxxxxx, "&").concat(-xxx.xxxxxx, "&").concat(Date.now())

Then I go back to Hulu, do a refresh and I'm in!!!

Imgur

NOTE!!!
This is NOT a hack, but a temporary fix. I pay full price monthly subscription and do not abuse my permissions. I do not promote misusing this in a malicious manor.

It's totally worth the money!

Feedback

Let me know your thoughts. Have you done similar things like this?


Varymade LLC.

Current projects are https://charactergenerator4000.com and https://coder.exchange. Please check them out and let us know your thoughts.

Top comments (2)

Collapse
 
bgadrian profile image
Adrian B.G.

So Safari is the new IE?

I didn't had to maintain production-level front-end JS in the last ~4yrs, from the outside the browser-compatibility seems resolved, kind of.

Collapse
 
dechamp profile image
DeChamp

Well even though most browsers are fairly unified today, there are still some differences that will cause your code to not work exactly across all platforms. It's important to check that functionality is available per browser.

I like to refer to caniuse.com which is very clear on what browser support what functionality. It's why I only got serious about Javascript in the last 5 years but I've been developing for 24 years now. lol. Back in the day I just couldn't deal with the huge differences between browsers. It drove me crazy.