Removed some Python 2.7.x compatibility code.

pull/1214/head
morpheus65535 4 years ago
parent d7333d9172
commit e7d68f4316

@ -1,20 +1,18 @@
# coding=utf-8 # coding=utf-8
from __future__ import absolute_import
import io import io
import logging import logging
import os import os
import time import time
import traceback import traceback
from urllib import parse
import requests import requests
import inflect import inflect
import re import re
import json import json
import six.moves.urllib.parse
import sys
import html import html
from zipfile import ZipFile from zipfile import ZipFile
@ -32,7 +30,6 @@ from subliminal_patch.subtitle import Subtitle, guess_matches
from subliminal_patch.converters.subscene import language_ids, supported_languages from subliminal_patch.converters.subscene import language_ids, supported_languages
from subscene_api.subscene import search, Subtitle as APISubtitle, SITE_DOMAIN from subscene_api.subscene import search, Subtitle as APISubtitle, SITE_DOMAIN
from subzero.language import Language from subzero.language import Language
import six
p = inflect.engine() p = inflect.engine()
@ -164,7 +161,7 @@ class SubsceneProvider(Provider, ProviderSubtitleArchiveMixin):
if match: if match:
h = html h = html
data = json.loads(h.unescape(match.group(1))) data = json.loads(h.unescape(match.group(1)))
login_url = six.moves.urllib.parse.urljoin(data["siteUrl"], data["loginUrl"]) login_url = parse.urljoin(data["siteUrl"], data["loginUrl"])
time.sleep(1.0) time.sleep(1.0)
r = self.session.post(login_url, r = self.session.post(login_url,
@ -192,7 +189,7 @@ class SubsceneProvider(Provider, ProviderSubtitleArchiveMixin):
else: else:
cj = self.session.cookies.copy() cj = self.session.cookies.copy()
store_cks = ("scene", "idsrv", "idsrv.xsrf", "idsvr.clients", "idsvr.session", "idsvr.username") store_cks = ("scene", "idsrv", "idsrv.xsrf", "idsvr.clients", "idsvr.session", "idsvr.username")
for cn in six.iterkeys(self.session.cookies): for cn in self.session.cookies.keys():
if cn not in store_cks: if cn not in store_cks:
del cj[cn] del cj[cn]

Loading…
Cancel
Save