Update adapter_storiesonlinenet.py

Add check for SOL accounts in renewal warning period to verbosely explain to users why their downloads don't work
This commit is contained in:
Brian 2025-10-11 15:16:11 -07:00 committed by Jim Miller
parent d5f8891e4f
commit 39500a9386

View file

@ -196,6 +196,13 @@ class StoriesOnlineNetAdapter(BaseSiteAdapter):
self.performLogin(url)
data = self.get_request(url,usecache=False)
## SOL adds intermediate page to remind users to renew at 3-30 days before expiration - this breaks the soup 'a' search below
if "Your premier membership is going to expire" in data:
soup = self.make_soup(data)
expire = soup.find(string=re.compile("Your premier membership is going to expire"))
remindurl=(soup.find(href=re.compile("later.php"))).get('href')
raise exceptions.FailedToDownload(self.getSiteDomain() +" says: "+expire+"\n"+"Renew or reduce expiration warning time in account setting\n"+remindurl)
## Premium account might redirect to a chapter, while regular
## account doesn't redirect to the URL with embedded /story-title
## So pull url from <a href="/s/000/story-title" rel="bookmark">