djoole/couchpotato.provider.HDO

Mauvais encodage accent

danylich opened this issue · 4 comments

Steps to reproduce:

  1. Search a release for the movie " '71 "

Information:

Movie(s) I have this with: '71
Quality of the movie being searched: 1080p
Providers I use: HD_only
Version of CouchPotato: git:(RuudBurger:CouchPotatoServer master) 69825f9d (2015-05-27 14:06:41)
Running on: synology

Logs:

07-25 23:07:38 DEBUG [                   hdonly] movie titles : ['71'] 
07-25 23:07:38 DEBUG [                   hdonly] Searching HD-Only for 71 
07-25 23:07:38 DEBUG [hpotato.core.plugins.base] Waiting for hdonly, 1 seconds 
07-25 23:07:38  INFO [hpotato.core.plugins.base] Opening url: get https://hd-only.org/ajax.php?action=browse&searchstr=71, data: [] 
07-25 23:07:38 DEBUG [hpotato.core.plugins.base] Setting cache 9a54309605111eaf817d4471dbc95cf7 
07-25 23:07:38 DEBUG [hpotato.core.plugins.base] Waiting for hdonly, 1 seconds 
07-25 23:07:38 DEBUG [o.core.notifications.core] Getting messages with id: 395a7c0f-6b1e-4f06-8461-131ec8ebf11c 
07-25 23:07:38 DEBUG [o.core.notifications.core] Returning for 395a7c0f-6b1e-4f06-8461-131ec8ebf11c 0 messages 
07-25 23:07:39  INFO [hpotato.core.plugins.base] Opening url: get https://hd-only.org/ajax.php?action=torrent&id=3740, data: [] 
07-25 23:07:39 DEBUG [hpotato.core.plugins.base] Setting cache 2539357eaf4aab9b1a6b6f165ce2babb 
07-25 23:07:39 DEBUG [hpotato.core.plugins.base] Getting cache 2539357eaf4aab9b1a6b6f165ce2babb 
07-25 23:07:39 DEBUG [                   hdonly] Filename is '71.2014.vostfr.1080p.bluray.remux.avc.dtshdma-diy-decibel-gr.mkv{{{29605064088}}} 
07-25 23:07:39 DEBUG [                   hdonly] Torrent added to results : id 3740; name '71.2014.1080p.Blu-Ray Remux.AVC; detail_url https://hd-only.org/ajax.php?action=torrent&id=3740; size 28233; seeders 3; leechers 0 
07-25 23:07:39 DEBUG [tato.core.plugins.quality] Found 1080p via identifier 1080p in '71.2014.1080p.Blu-Ray Remux.AVC 
07-25 23:07:39 DEBUG [tato.core.plugins.quality] Found bd50 via release size: 20000.0 MB < 28233.0 MB < 60000.0 MB 
07-25 23:07:39 DEBUG [tato.core.plugins.quality] Found 1080p via release size: 5000.0 MB < 28233.0 MB < 30000.0 MB 
07-25 23:07:39 DEBUG [hpotato.core.plugins.base] Setting cache [u'&#39;71.2014.1080p.Blu-Ray Remux'] 
07-25 23:07:39 DEBUG [hpotato.core.plugins.base] Getting cache [u'&#39;71.2014.1080p.Blu-Ray Remux'] 
07-25 23:07:39  INFO [core.media.movie.searcher] Wrong: &#39;71.2014.1080p.Blu-Ray Remux.AVC, undetermined naming. Looking for ''71 (2014)' 
07-25 23:07:39 DEBUG [hpotato.core.plugins.base] Getting cache cf748b0ea97221a562cb09875107efec
### Steps to reproduce:
1. ..
2. ..

### Information:
Movie(s) I have this with: ...
Quality of the movie being searched: ...
Providers I use: ...
Version of CouchPotato: git:(RuudBurger:CouchPotatoServer master) 69825f9d (2015-05-27 14:06:41)
Running on: ...

### Logs:

07-25 23:07:39 ERROR [ hdonly] Failed to detect FR titles : Traceback (most recent call last):
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/hdonly/main.py", line 40, in _searchOnTitle
if detect(t) == 'fr' and t not in titles:
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector_factory.py", line 130, in detect
return detector.detect()
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector.py", line 135, in detect
probabilities = self.get_probabilities()
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector.py", line 142, in get_probabilities
self._detect_block()
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector.py", line 149, in _detect_block
raise LangDetectException(ErrorCode.CantDetectError, 'No features in text.')
LangDetectException: No features in text.
07-25 23:07:39 ERROR [ hdonly] Failed to detect FR titles : Traceback (most recent call last):
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/hdonly/main.py", line 40, in _searchOnTitle
if detect(t) == 'fr' and t not in titles:
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector_factory.py", line 130, in detect
return detector.detect()
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector.py", line 135, in detect
probabilities = self.get_probabilities()
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector.py", line 142, in get_probabilities
self._detect_block()
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector.py", line 149, in _detect_block
raise LangDetectException(ErrorCode.CantDetectError, 'No features in text.')
LangDetectException: No features in text.
07-25 23:07:40 ERROR [ hdonly] Failed to detect FR titles : Traceback (most recent call last):
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/hdonly/main.py", line 40, in _searchOnTitle
if detect(t) == 'fr' and t not in titles:
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector_factory.py", line 130, in detect
return detector.detect()
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector.py", line 135, in detect
probabilities = self.get_probabilities()
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector.py", line 142, in get_probabilities
self._detect_block()
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector.py", line 149, in _detect_block
raise LangDetectException(ErrorCode.CantDetectError, 'No features in text.')
LangDetectException: No features in text.
07-25 23:07:40 ERROR [ hdonly] Failed to detect EN titles : Traceback (most recent call last):
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/hdonly/main.py", line 49, in _searchOnTitle
if detect(t) == 'en' and t not in titles:
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector_factory.py", line 130, in detect
return detector.detect()
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector.py", line 135, in detect
probabilities = self.get_probabilities()
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector.py", line 142, in get_probabilities
self._detect_block()
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector.py", line 149, in _detect_block
raise LangDetectException(ErrorCode.CantDetectError, 'No features in text.')
LangDetectException: No features in text.
07-25 23:07:40 ERROR [ hdonly] Failed to detect EN titles : Traceback (most recent call last):
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/hdonly/main.py", line 49, in _searchOnTitle
if detect(t) == 'en' and t not in titles:
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector_factory.py", line 130, in detect
return detector.detect()
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector.py", line 135, in detect
probabilities = self.get_probabilities()
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector.py", line 142, in get_probabilities
self._detect_block()
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector.py", line 149, in _detect_block
raise LangDetectException(ErrorCode.CantDetectError, 'No features in text.')
LangDetectException: No features in text.
07-25 23:07:40 ERROR [ hdonly] Failed to detect EN titles : Traceback (most recent call last):
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/hdonly/main.py", line 49, in _searchOnTitle
if detect(t) == 'en' and t not in titles:
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector_factory.py", line 130, in detect
return detector.detect()
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector.py", line 135, in detect
probabilities = self.get_probabilities()
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector.py", line 142, in get_probabilities
self._detect_block()
File "/usr/local/couchpotatoserver-custom/var/custom_plugins/langdetect/detector.py", line 149, in _detect_block
raise LangDetectException(ErrorCode.CantDetectError, 'No features in text.')
LangDetectException: No features in text.

Faut que tu mettes les logs en DEBUG (y a l'option quelque part dans CP) car là je ne vois que les erreur de détection de langue (qui sont "normales").
Mais je vais essayer de le reproduire chez moi de toute façon..

C'est déjà en debug d'où les debug au début des premières lignes :-P

Oups j'avais regardé que les logs de la fin du message!
Bref, je reproduis le problème, et c'est effectivement un problème d'encoding.
Je suis en train de me cultiver avec ça : http://sametmax.com/lencoding-en-python-une-bonne-fois-pour-toute/
En espérant qu'à l'issue de ma lecture je sache quoi faire pour corriger le bug ^^

C'est bon j'ai trouvé!
from HTMLParser import HTMLParser
h = HTMLParser()
name = h.unescape(name)

Je commite et tu me confirmes si c'est bon