diff options
author | Jake Soenneker <[email protected]> | 2020-12-12 16:21:21 -0600 |
---|---|---|
committer | Jake Soenneker <[email protected]> | 2020-12-12 16:21:21 -0600 |
commit | 4f7d43625417aeaa2849426f1399a4ec669a6195 (patch) | |
tree | 3b7c03399acdb9ca062aeae897d516d18f8e44cc | |
parent | fc4f78f8a50a2d70f27b756fbc18a95347cbb9ba (diff) | |
download | bazarr-4f7d43625417aeaa2849426f1399a4ec669a6195.tar.gz bazarr-4f7d43625417aeaa2849426f1399a4ec669a6195.zip |
Fixes subscene issue with Python dropping unescape
-rw-r--r-- | libs/subliminal_patch/providers/subscene.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/subliminal_patch/providers/subscene.py b/libs/subliminal_patch/providers/subscene.py index 8868a270a..638eaacb4 100644 --- a/libs/subliminal_patch/providers/subscene.py +++ b/libs/subliminal_patch/providers/subscene.py @@ -12,9 +12,15 @@ import requests import inflect import re import json -import six.moves.html_parser import six.moves.urllib.parse +import sys +if sys.version_info[0] >= 3: + import html +else: + from six.moves import html_parser + html = html_parser.HTMLParser() + from zipfile import ZipFile from babelfish import language_converters from guessit import guessit @@ -160,7 +166,7 @@ class SubsceneProvider(Provider, ProviderSubtitleArchiveMixin): match = re.search(r"<script id='modelJson' type='application/json'>\s*(.+)\s*</script>", r.text) if match: - h = six.moves.html_parser.HTMLParser() + h = html data = json.loads(h.unescape(match.group(1))) login_url = six.moves.urllib.parse.urljoin(data["siteUrl"], data["loginUrl"]) time.sleep(1.0) |