added file not found error

master
Arjix 2021-06-21 20:43:29 +03:00 committed by GitHub
parent 9e3df85d3a
commit 52bda62aed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import re
from anime_downloader.extractors.base_extractor import BaseExtractor
from anime_downloader.sites import helpers
from requests.exceptions import HTTPError
logger = logging.getLogger(__name__)
@ -10,7 +11,13 @@ logger = logging.getLogger(__name__)
class Yourupload(BaseExtractor):
def _get_data(self):
regex = r"file: '([^']*)"
file = re.search(regex, helpers.get(self.url).text).group(1)
try:
response = helpers.get(self.url)
except HTTPError:
logger.error('File not found.')
raise
file = re.search(regex, response.text).group(1)
return {
'stream_url': file,
'referer': self.url