|
|
|
@ -3,7 +3,7 @@ import logging
|
|
|
|
|
import re
|
|
|
|
|
import io
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
from random import randint
|
|
|
|
|
from bs4 import BeautifulSoup
|
|
|
|
|
from zipfile import ZipFile, is_zipfile
|
|
|
|
|
from rarfile import RarFile, is_rarfile
|
|
|
|
@ -18,6 +18,7 @@ from subliminal.subtitle import guess_matches
|
|
|
|
|
from subliminal.video import Episode, Movie
|
|
|
|
|
from subliminal.subtitle import fix_line_ending
|
|
|
|
|
from subzero.language import Language
|
|
|
|
|
from .utils import FIRST_THOUSAND_OR_SO_USER_AGENTS as AGENT_LIST
|
|
|
|
|
|
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
|
@ -65,7 +66,7 @@ class SubsSabBzProvider(Provider):
|
|
|
|
|
|
|
|
|
|
def initialize(self):
|
|
|
|
|
self.session = Session()
|
|
|
|
|
self.session.headers['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36'
|
|
|
|
|
self.session.headers['User-Agent'] = AGENT_LIST[randint(0, len(AGENT_LIST) - 1)]
|
|
|
|
|
self.session.headers["Accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
|
|
|
|
|
self.session.headers["Accept-Language"] = "en-US,en;q=0.5"
|
|
|
|
|
self.session.headers["Accept-Encoding"] = "gzip, deflate, br"
|