Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 'latin-1' codec can't encode character '\u2026', when running the script #25

Closed
TGreatOne opened this issue Jan 29, 2021 · 12 comments
Labels

Comments

@TGreatOne
Copy link

OS: Ubuntu 20.04.1, Windows 10 Home
Version: 1.0.122 Python Script and Windows EXE
URL: https://www.hulu.com/series/freaks-and-geeks-0e7d9831-22bb-455d-8255-412be0415b2c
Description: The tool shows the following error when trying to download the subs of this series, in both English and Spanish

DEBUG: eab_id_matches: ['and', 'geeks', '0e7d9831', '22bb', '455d', '8255', '412be0415b2c']
DEBUG: initial eab_id: geeks-0e7d9831-22bb-455d-8255-412be0415b2c
DEBUG: GET url: https://discover.hulu.com/content/v5/hubs/series/geeks-0e7d9831-22bb-455d-8255-412be0415b2c?schema=1&limit=999&device_info=web:3.10.0&referralHost=production
DEBUG: GET proxy: {'http': None, 'https': None}
DEBUG: Starting new HTTPS connection (1): discover.hulu.com:443
DEBUG: HuluException: 'latin-1' codec can't encode character '\u2026' in position 512: ordinal not in range(256)

I tried the same process with MASH (https://www.hulu.com/series/mash-ae94231d-0f04-482a-b9ee-9911e339e3ed), but to no avail. The issue is present on both Ubuntu and Windows :(

@Xonshiz Xonshiz added the bug label Jan 29, 2021
@Xonshiz
Copy link
Owner

Xonshiz commented Jan 29, 2021

Thanks for the detailed information. Seems like a string conversion issue. I'll take a look at this over the weekend.

@yousie642
Copy link

Same issue. Posting my log, in case it helps

OS: Windows 10 Pro (2004)
Version: Windows EXE
URL: https://www.hulu.com/series/my-hero-academia-36e318dc-3daf-47fb-8219-9e3cb5cd28f2

DEBUG: eab_id_matches: ['hero', 'academia', '36e318dc', '3daf', '47fb', '8219', '9e3cb5cd28f2']
DEBUG: initial eab_id: academia-36e318dc-3daf-47fb-8219-9e3cb5cd28f2
DEBUG: GET url: https://discover.hulu.com/content/v5/hubs/series/academia-36e318dc-3daf-47fb-8219-9e3cb5cd28f2?schema=1&limit=999&device_info=web:3.10.0&referralHost=production
DEBUG: GET proxy: {'http': None, 'https': None}
DEBUG: Starting new HTTPS connection (1): discover.hulu.com:443
DEBUG: HuluException: 'latin-1' codec can't encode character '\u2026' in position 512: ordinal not in range(256)

@yousie642
Copy link

Hey @Xonshiz, just wondering if an update is coming that fixes this?

@IRLPinkiePie
Copy link

@Xonshiz hi, i was running into this issue myself, and after about two hours poking through python libraries it turns out that the code works entirely fine; rather, if you try to copy and paste your cookie from firefox, it'll shorten it and add an ellipsis, and that ellipsis is the \u2026 that's throwing an error. there's not really a good way around that beyond right-click > copy all and then just trimming all of the formatting around the cookie value, but it is not anything to do with the code itself - which means this can probably be closed, though maybe with an added note in the readme about this issue so you don't get further questions about it

@Xonshiz
Copy link
Owner

Xonshiz commented Mar 27, 2021

Hey Thanks a lot for this! Damn, this is very disturbing to read. I think I'll add that in documentation and also do some kind of checking in the code to notify the user that your cookie value isn't proper. I'll leave this bug as open for now. But, will try to push an update.

Also, is this tool still working? Because I had someone telling me that Hulu changed things again. Not sure about that, will need to verify that.

@IRLPinkiePie
Copy link

it is as of earlier today, yeah! i can write a little fix to search for an ellipsis character before it gets pulled into requests if you'd like, though unfortunately i don't know the cookie structure super well and thus probably can't do much more complicated than that

@Xonshiz
Copy link
Owner

Xonshiz commented Mar 27, 2021

That's fine. I'll be working on this today, so there should be a fix by tomorrow for this. Your research is very helpful, saved tons of my time :P

@Xonshiz
Copy link
Owner

Xonshiz commented Jun 5, 2021

Update on this one, can't work on it as of now because Hulu wouldn't let me sign up (since I'm not in US region, it's not letting me make payments). I'll see if I can get an account to work.

@ghost
Copy link

ghost commented Jun 6, 2021

To get the cookie on Firefox without \u2026 after the searching for discover.hulu.com/content/v5/me/state right click on one of the links and stand on "Copy" then press on "Copy Request Headers" and paste the contents in a text file and remove the text from "GET" to "Connection: keep-alive".

cookie

@ghost
Copy link

ghost commented Jun 6, 2021

@Xonshiz Please when you have the time it would be great if you could do what you wrote about the way of handling the cookies in the "To Do" list https://github.com/Xonshiz/Hulusubs_dl/blob/master/ToDo.md.

@Xonshiz
Copy link
Owner

Xonshiz commented Jun 6, 2021

Thanks for that screenshot and info on Firefox, but I'll still need to put in a check in the code itself for this. Better to handle it on my end as well and about the cookies in TO DO list, it's not going to happen anytime soon, as I've tried many times and have gracefully failed. I'll update as soon as I can figure anything out. Let's see if I can find anything about that :(.

Xonshiz added a commit that referenced this issue Jun 6, 2021
- Fix for #29
- Fix for #28
- Fix for #25
@Xonshiz
Copy link
Owner

Xonshiz commented Jun 6, 2021

Should be fixed with the latest commit.

@Xonshiz Xonshiz closed this as completed Jun 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants