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

Unicode error when downloading show with a fada in the title... #5

Open
goodlucknow opened this issue Sep 2, 2019 · 4 comments
Open

Comments

@goodlucknow
Copy link

  • RTE Player video downloader version: 0.0.2
  • Python version: 2.7
  • Operating System: OSX 10.14.4

Description

Attempting to download a show with a fada in the title produces a unicode error...

What I Did

Example: 
Tríd an Lionsa - 
command:
`rteplayer_dl --debug --video-directory="/Users/*****/Downloads/" --video-source="ismv" --video-xml="https://link.eu.theplatform.com/s/1uC-gC/media/BfcmDVQp3LoA?auth=eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiJydGUtcHJkLXByZC10cnQvYW5vbnltb3VzX25ncnBfcGxheWVyQHJ0ZS5pZSIsImlzcyI6IjEiLCJleHAiOjE1Njc1MTc0MjQsImlhdCI6MTU2NzQzMTAyNDkxMSwianRpIjoiOTU0Y2MwNjktY2VmMy00NmRjLWEzN2ItOGI1MTE4ZjEwNjZhIiwiZGlkIjoicnRlLXByZC1wcmQtdHJ0IiwidW5tIjoiYW5vbnltb3VzX25ncnBfcGxheWVyQHJ0ZS5pZSIsImN0eCI6IntcInVzZXJOYW1lXCI6XCJhbm9ueW1vdXNfbmdycF9wbGF5ZXJAcnRlLmllXCJ9XG4iLCJvaWQiOm51bGx9.dILUwRoENCvD3LyquwruAtuRvNHileIusf948uONYK3tA_4CqRCm-crGPKuvgG-_97LiL6t2bo-lVsm9Rrhg8tzS8ueBZdUiPmcp2xew5pR7y4L6KK1v2t_s9AuHtf30Ad9eA1zrpj5JDIb9qWZqqGksxxv6EINI-6s6JmtD9_IY6Oyu3oN417MYYkfxzRj-yC7HLqkTWz42EN00EDRrw_CUnVOEGbWU3Pr2dTpvqymzgjKe4H5vlrtwdkKlD3G6T6vgqyL38H_XfTUJ72fVHXqSVfHhIZIuUqQpFms-xX_UxAbBzj_6iHF27jZpPWf5jtjj9nK26ABi8EPxq4oxGA&formats=mpeg-dash&format=SMIL&embedded=true&tracking=true"`

error:

> Traceback (most recent call last):
>   File "/usr/local/bin/rteplayer_dl", line 9, in <module>
>     load_entry_point('rteplayer-dl==0.0.2', 'console_scripts', 'rteplayer_dl')()
>   File "/Users/*****/Library/Python/2.7/lib/python/site-packages/click/core.py", line 764, in __call__
>     return self.main(*args, **kwargs)
>   File "/Users/*****/Library/Python/2.7/lib/python/site-packages/click/core.py", line 717, in main
>     rv = self.invoke(ctx)
>   File "/Users/*****/Library/Python/2.7/lib/python/site-packages/click/core.py", line 956, in invoke
>     return ctx.invoke(self.callback, **ctx.params)
>   File "/Users/*****/Library/Python/2.7/lib/python/site-packages/click/core.py", line 555, in invoke
>     return callback(*args, **kwargs)
>   File "/Library/Python/2.7/site-packages/rteplayer_dl-0.0.2-py2.7.egg/rteplayer_dl/cli.py", line 29, in main
>     download(video_xml, video_directory, video_source, overwrite, debug)
>   File "/Library/Python/2.7/site-packages/rteplayer_dl-0.0.2-py2.7.egg/rteplayer_dl/rteplayer.py", line 36, in download
>     print("video title = {}".format(video_title))
> UnicodeEncodeError: 'ascii' codec can't encode characters in position 2-3: ordinal not in range(128)

@goodlucknow
Copy link
Author

have a workaround by adding .encode('ascii', 'ignore').decode('ascii') on video_title in line 36 of rteplayer.py file, not the most elegant solution...

@philroche
Copy link
Owner

Thank you for the bug report but as this is python 2 and rte_player targets python 3 I was tempted to mark this as won't fix as the issue is not present in python 3.

I found a quick fix though and have released 0.0.3 https://pypi.org/project/rteplayer-dl/0.0.3/ to address this issue. Please let me know if this fixes the problem for you.

@goodlucknow
Copy link
Author

This does indeed fix the issue. The title gets changed in the process (e.g. filed saved as "Tríd an Lionsa") but the download doesn't fail as it did before. Thank you.
Apologies also, I hadn't realised my python version was outdated for the project.
Thank you for making this!

@philroche
Copy link
Owner

Yes, it does change the title and isn't as expected so I will leave this open.

But for now at least you are unblocked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants