From 0fc334f731ddda1d70fb4b0ad6fc7c0329c76048 Mon Sep 17 00:00:00 2001 From: Hlib Date: Tue, 6 Aug 2024 14:15:50 +0300 Subject: [PATCH] Fixed AvistaZ and CinemaZ scraping when the Reseed notification is displayed --- custom_libs/subliminal_patch/providers/avistaz_network.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/custom_libs/subliminal_patch/providers/avistaz_network.py b/custom_libs/subliminal_patch/providers/avistaz_network.py index 2c5796ce3..30e68d047 100644 --- a/custom_libs/subliminal_patch/providers/avistaz_network.py +++ b/custom_libs/subliminal_patch/providers/avistaz_network.py @@ -5,7 +5,7 @@ from random import randint import pycountry from requests.cookies import RequestsCookieJar -from subliminal.exceptions import AuthenticationError +from subliminal.exceptions import AuthenticationError, ProviderError from subliminal.providers import ParserBeautifulSoup from subliminal_patch.http import RetryingCFSession from subliminal_patch.pitcher import store_verification @@ -354,7 +354,10 @@ class AvistazNetworkProviderBase(Provider): def _parse_release_table(self, html): release_data_table = (ParserBeautifulSoup(html, ['html.parser']) - .select_one('#content-area > div:nth-child(4) > div.table-responsive > table > tbody')) + .select_one('#content-area > div.block > div.table-responsive > table > tbody')) + + if release_data_table is None: + raise ProviderError('Unexpected HTML page layout - no release data table found') rows = {} for tr in release_data_table.find_all('tr', recursive=False):