This commit is contained in:
marco
2021-11-06 14:46:50 +01:00
parent aafb008d5a
commit 06239735f5
4 changed files with 13 additions and 10 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ def peliculas(item):
def itemHook(item): def itemHook(item):
if not sceneTitle: if not sceneTitle:
item.title = item.title.replace('_', ' ') item.title = item.title.replace('_', ' ')
item.title = support.urlparse.unquote(item.title) item.title = support.scrapertools.decodeHtmlentities(support.urlparse.unquote(item.title))
return item return item
if 'search' not in item.args: if 'search' not in item.args:
+4 -3
View File
@@ -7,9 +7,10 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from collections import namedtuple from collections import namedtuple
from functools import partial from functools import partial
from pkg_resources import resource_stream # @UnresolvedImport # from pkg_resources import resource_stream # @UnresolvedImport
from .converters import ConverterManager from .converters import ConverterManager
from . import basestr from . import basestr
import os, io
COUNTRIES = {} COUNTRIES = {}
@@ -18,10 +19,10 @@ COUNTRY_MATRIX = []
#: The namedtuple used in the :data:`COUNTRY_MATRIX` #: The namedtuple used in the :data:`COUNTRY_MATRIX`
IsoCountry = namedtuple('IsoCountry', ['name', 'alpha2']) IsoCountry = namedtuple('IsoCountry', ['name', 'alpha2'])
f = resource_stream('babelfish', 'data/iso-3166-1.txt') f = io.open(os.path.join(os.path.dirname(__file__), 'data/iso-3166-1.txt'), encoding='utf-8')
f.readline() f.readline()
for l in f: for l in f:
iso_country = IsoCountry(*l.decode('utf-8').strip().split(';')) iso_country = IsoCountry(*l.strip().split(';'))
COUNTRIES[iso_country.alpha2] = iso_country.name COUNTRIES[iso_country.alpha2] = iso_country.name
COUNTRY_MATRIX.append(iso_country) COUNTRY_MATRIX.append(iso_country)
f.close() f.close()
+4 -3
View File
@@ -7,12 +7,13 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from collections import namedtuple from collections import namedtuple
from functools import partial from functools import partial
from pkg_resources import resource_stream # @UnresolvedImport # from pkg_resources import resource_stream # @UnresolvedImport
from .converters import ConverterManager from .converters import ConverterManager
from .country import Country from .country import Country
from .exceptions import LanguageConvertError from .exceptions import LanguageConvertError
from .script import Script from .script import Script
from . import basestr from . import basestr
import os, io
LANGUAGES = set() LANGUAGES = set()
@@ -21,10 +22,10 @@ LANGUAGE_MATRIX = []
#: The namedtuple used in the :data:`LANGUAGE_MATRIX` #: The namedtuple used in the :data:`LANGUAGE_MATRIX`
IsoLanguage = namedtuple('IsoLanguage', ['alpha3', 'alpha3b', 'alpha3t', 'alpha2', 'scope', 'type', 'name', 'comment']) IsoLanguage = namedtuple('IsoLanguage', ['alpha3', 'alpha3b', 'alpha3t', 'alpha2', 'scope', 'type', 'name', 'comment'])
f = resource_stream('babelfish', 'data/iso-639-3.tab') f = io.open(os.path.join(os.path.dirname(__file__), 'data/iso-639-3.tab'), encoding='utf-8')
f.readline() f.readline()
for l in f: for l in f:
iso_language = IsoLanguage(*l.decode('utf-8').split('\t')) iso_language = IsoLanguage(*l.split('\t'))
LANGUAGES.add(iso_language.alpha3) LANGUAGES.add(iso_language.alpha3)
LANGUAGE_MATRIX.append(iso_language) LANGUAGE_MATRIX.append(iso_language)
f.close() f.close()
+4 -3
View File
@@ -6,8 +6,9 @@
# #
from __future__ import unicode_literals from __future__ import unicode_literals
from collections import namedtuple from collections import namedtuple
from pkg_resources import resource_stream # @UnresolvedImport # from pkg_resources import resource_stream # @UnresolvedImport
from . import basestr from . import basestr
import os, io
#: Script code to script name mapping #: Script code to script name mapping
SCRIPTS = {} SCRIPTS = {}
@@ -18,10 +19,10 @@ SCRIPT_MATRIX = []
#: The namedtuple used in the :data:`SCRIPT_MATRIX` #: The namedtuple used in the :data:`SCRIPT_MATRIX`
IsoScript = namedtuple('IsoScript', ['code', 'number', 'name', 'french_name', 'pva', 'date']) IsoScript = namedtuple('IsoScript', ['code', 'number', 'name', 'french_name', 'pva', 'date'])
f = resource_stream('babelfish', 'data/iso15924-utf8-20131012.txt') f = io.open(os.path.join(os.path.dirname(__file__), 'data/iso15924-utf8-20131012.txt'), encoding='utf-8')
f.readline() f.readline()
for l in f: for l in f:
l = l.decode('utf-8').strip() l = l.strip()
if not l or l.startswith('#'): if not l or l.startswith('#'):
continue continue
script = IsoScript._make(l.split(';')) script = IsoScript._make(l.split(';'))