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

No Kodi Library Update: AttributeError: 'str' object has no attribute 'decode' #6354

Closed
desepticon opened this issue Mar 15, 2019 · 3 comments
Labels

Comments

@desepticon
Copy link

desepticon commented Mar 15, 2019

Describe the bug
When trying to update the Kodi Library I get the error"

"AttributeError: 'str' object has no attribute 'decode'"

I get a similar error if I try to test Kodi notifications. The notifications go through, but I get an error and the test results field remains blank and glitched out.

pastebin to this other error log. (main error log below)

To Reproduce
Steps to reproduce the behavior:

  1. Enable Kodi Library Updating
  2. Post-Process a media file, through a script or manually.
  3. Medusa bugs out and Kodi doesn't update the Library.
  4. See error

Medusa should be updating the Kodi library.

Medusa (please complete the following information):

  • OS: [MacOS 10.13.6]
  • Branch: [master]
  • Commit: [94fae84]
  • Version: [0.3.0]

Logs:

2019-03-15 05:03:02 ERROR    TORNADO :: [94fae84] API :: AttributeError("'str' object has no attribute 'decode'")
Traceback (most recent call last):
  File "/Users/matt/Builds/medusa/medusa/server/api/v1/core.py", line 142, in get
    out_dict = _call_dispatcher(args, kwargs)
  File "/Users/matt/Builds/medusa/medusa/server/api/v1/core.py", line 212, in call_dispatcher
    cur_out_dict = func(cur_args, cur_kwargs).run()  # call function and get response
  File "/Users/matt/Builds/medusa/medusa/server/api/v1/core.py", line 1308, in run
    failed=self.failed, proc_type=self.type
  File "/Users/matt/Builds/medusa/medusa/process_tv.py", line 145, in process
    ignore_subs=ignore_subs)
  File "/Users/matt/Builds/medusa/medusa/process_tv.py", line 335, in process_files
    self.process_media(path, self.video_files, force, is_priority, ignore_subs)
  File "/Users/matt/Builds/medusa/medusa/process_tv.py", line 556, in process_media
    self.result = processor.process()
  File "/Users/matt/Builds/medusa/medusa/post_processor.py", line 1289, in process
    notifiers.notify_download(ep_obj)
  File "/Users/matt/Builds/medusa/medusa/notifiers/__init__.py", line 100, in notify_download
    n.notify_download(ep_obj)
  File "/Users/matt/Builds/medusa/medusa/notifiers/kodi.py", line 434, in notify_download
    self._notify_kodi(common.notifyStrings[common.NOTIFY_DOWNLOAD], ep_obj.pretty_name_with_quality())
  File "/Users/matt/Builds/medusa/medusa/notifiers/kodi.py", line 133, in _notify_kodi
    result += cur_host + ':' + notify_result['result'].decode('utf-8')
AttributeError: 'str' object has no attribute 'decode'
2019-03-15 05:03:02 INFO     TORNADO :: [94fae84] Selected poster for series 275557 (score=3.3221824253021945, score_bay=5.644364850604389, rating=6.8, votes=20, res=680x1000): https://www.thetvdb.com/banners/posters/275557-6.jpg
2019-03-15 05:03:02 INFO     TORNADO :: [94fae84] Selected fanart for series 275557 (score=3.9240400637751476, score_bay=5.848080127550295, rating=6.9, votes=9, res=1920x1080): https://www.thetvdb.com/banners/fanart/original/275557-8.jpg
2019-03-15 05:03:00 INFO     TORNADO :: [94fae84] 275557: Changed modify date of Broad.City.S05E08.Sleep.No.More.720p.WEB-DL.mkv to series air date Mar 14,2019 (22:00)
2019-03-15 05:02:46 INFO     TORNADO :: [94fae84] Release name (broad.city.s05e08.720p.web.x264-tbs) found from file (broad.city.s05e08.720p.web.x264-tbs.nfo)
2019-03-15 05:02:46 INFO     TORNADO :: [94fae84] This download is marked a priority download so I'm going to replace an existing file if I find one
2019-03-15 05:02:46 INFO     TORNADO :: [94fae84] New size: 432.58 MB
2019-03-15 05:02:46 INFO     TORNADO :: [94fae84] New file: /Volumes/dvorak.8tb/SABnzbd/tv/Broad.City.S05E08.720p.WEB.x264-TBS[TGx]/broad.city.s05e08.720p.web.x264-tbs.mkv
2019-03-15 05:02:46 INFO     TORNADO :: [94fae84] Processing /Volumes/dvorak.8tb/SABnzbd/tv/Broad.City.S05E08.720p.WEB.x264-TBS[TGx]/broad.city.s05e08.720p.web.x264-tbs.mkv

Additional context
Works fine in the python2.7 version. Made sure to run new version with python3.7 and install the requirements.txt with pip-3.7. Manually pressing the "Update Kodi" button in the Manage tab does actually work though.

Looking briefly into this, as a layman, it seems there is no decode in python3 as its already decoded. I hope there is a fix for this soon as it is a rather crucial feature for me.

@triage-new-issues triage-new-issues bot added the triage Untriaged issue label Mar 15, 2019
@medariox
Copy link
Contributor

You don't have to use Python 3 with the new version. You can keep using Python 2.7 until this is fixed.

@medariox medariox added the Bug label Mar 15, 2019
@triage-new-issues triage-new-issues bot removed the triage Untriaged issue label Mar 15, 2019
medariox added a commit that referenced this issue Mar 15, 2019
* Fix Kodi notifications decoding. Fixes #6354

* Fix Slack notifications

* Update CHANGELOG.md

* flake8
@desepticon
Copy link
Author

desepticon commented Mar 15, 2019

Thanks! I'll check how that works out.

@desepticon
Copy link
Author

It works. Thanks so much for the quick fix!

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

2 participants