Fixes subscene issue with Python dropping unescape

This commit is contained in:
Jake Soenneker 2020-12-12 16:21:21 -06:00
parent fc4f78f8a5
commit 4f7d436254
1 changed files with 8 additions and 2 deletions

View File

@ -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)