aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--libs/subliminal_patch/providers/subscene.py10
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)