DEV Community

DeChamp
DeChamp

Posted on โ€ข Edited on

11 2

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.

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more

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.

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

๐Ÿ‘‹ Kindness is contagious

Please leave a โค๏ธ or a friendly comment on this post if you found it helpful!

Okay