From 3217a475f2c15e87b99e950d824a2d1c9eb328d0 Mon Sep 17 00:00:00 2001 From: panni Date: Thu, 30 May 2019 04:46:43 +0200 Subject: [PATCH] core: update to subliminal_patch:head; react on inexistent subscene endpoint if possible --- libs/subscene_api/subscene.py | 46 ++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/libs/subscene_api/subscene.py b/libs/subscene_api/subscene.py index c8450518a..823e379fe 100644 --- a/libs/subscene_api/subscene.py +++ b/libs/subscene_api/subscene.py @@ -30,6 +30,7 @@ import enum import sys import requests import time +import logging is_PY2 = sys.version_info[0] < 3 if is_PY2: @@ -39,8 +40,13 @@ else: from contextlib import suppress from urllib2.request import Request, urlopen +from dogpile.cache.api import NO_VALUE +from subliminal.cache import region from bs4 import BeautifulSoup, NavigableString + +logger = logging.getLogger(__name__) + # constants HEADERS = { } @@ -50,6 +56,13 @@ DEFAULT_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWeb"\ "Kit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36" +ENDPOINT_RE = re.compile(ur'(?uis)
.*?