fix unicode issues
This commit is contained in:
parent
6e6801cdf2
commit
30db5a92a2
2 changed files with 4 additions and 0 deletions
|
|
@ -62,6 +62,8 @@ class YoutubeBackend(BaseBackend, ICapVideo):
|
||||||
while True:
|
while True:
|
||||||
query = gdata.youtube.service.YouTubeVideoQuery()
|
query = gdata.youtube.service.YouTubeVideoQuery()
|
||||||
if pattern is not None:
|
if pattern is not None:
|
||||||
|
if isinstance(pattern, unicode):
|
||||||
|
pattern = pattern.encode('utf-8')
|
||||||
query.vq = pattern
|
query.vq = pattern
|
||||||
query.orderby = ('relevance', 'rating', 'viewCount', 'published')[sortby]
|
query.orderby = ('relevance', 'rating', 'viewCount', 'published')[sortby]
|
||||||
query.racy = 'include' if nsfw else 'exclude'
|
query.racy = 'include' if nsfw else 'exclude'
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ from weboob.core.backendscfg import BackendsConfig, BackendAlreadyExists
|
||||||
from weboob.tools.application.formatters.iformatter import MandatoryFieldsNotFound
|
from weboob.tools.application.formatters.iformatter import MandatoryFieldsNotFound
|
||||||
from weboob.tools.browser import BrowserUnavailable, BrowserIncorrectPassword
|
from weboob.tools.browser import BrowserUnavailable, BrowserIncorrectPassword
|
||||||
from weboob.tools.value import Value, ValueBool, ValueFloat, ValueInt
|
from weboob.tools.value import Value, ValueBool, ValueFloat, ValueInt
|
||||||
|
from weboob.tools.misc import to_unicode
|
||||||
|
|
||||||
from .base import BackendNotFound, BaseApplication
|
from .base import BackendNotFound, BaseApplication
|
||||||
from .formatters.load import FormattersLoader, FormatterLoadError
|
from .formatters.load import FormattersLoader, FormatterLoadError
|
||||||
|
|
@ -405,6 +406,7 @@ class ReplApplication(Cmd, BaseApplication):
|
||||||
"""
|
"""
|
||||||
This REPL method is overrided to catch some particular exceptions.
|
This REPL method is overrided to catch some particular exceptions.
|
||||||
"""
|
"""
|
||||||
|
line = to_unicode(line)
|
||||||
cmd, arg, ignored = self.parseline(line)
|
cmd, arg, ignored = self.parseline(line)
|
||||||
|
|
||||||
# Set the right formatter for the command.
|
# Set the right formatter for the command.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue