debug: Added Session Language code as a debug message

It will show this message when Localization is called by muxed hls or 
dash streams.

```
$ streamlink ... --locale ru_RU
...
[plugin.dash][debug] Parsing MPD URL: ...
[utils.l10n][debug] Language code: ru_RU
```

or your local system code

```
$ streamlink ...
...
[plugin.dash][debug] Parsing MPD URL: ...
[utils.l10n][debug] Language code: xx_XX
```
This commit is contained in:
back-to 2018-07-12 15:04:23 +02:00
parent 6bf654a291
commit 86214d93eb
No known key found for this signature in database
GPG Key ID: 476EB48A8967E369
1 changed files with 4 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import locale
import logging
from streamlink.compat import is_py2
@ -16,6 +17,8 @@ DEFAULT_LANGUAGE = "en"
DEFAULT_COUNTRY = "US"
DEFAULT_LANGUAGE_CODE = "{0}_{1}".format(DEFAULT_LANGUAGE, DEFAULT_COUNTRY)
log = logging.getLogger(__name__)
class Country(object):
def __init__(self, alpha2, alpha3, numeric, name, official_name=None):
@ -147,6 +150,7 @@ class Localization(object):
self._language_code = DEFAULT_LANGUAGE_CODE
else:
raise
log.debug("Language code: {0}".format(self._language_code))
def equivalent(self, language=None, country=None):
equivalent = True